PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/php/enum/runme.php

#
PHP | 32 lines | 21 code | 9 blank | 2 comment | 0 complexity | 6fc48f63156444965aa67f89d5d90ffe MD5 | raw file
 1<?php
 2
 3require "example.php";
 4
 5# ----- Object creation -----
 6
 7# Print out the value of some enums
 8print "*** color ***";
 9print "    RED    =" . RED;
10print "    BLUE   =" . BLUE;
11print "    GREEN  =" . GREEN;
12
13print "\n*** Foo::speed ***";
14print "    Foo_IMPULSE   =" . Foo_IMPULSE;
15print "    Foo_WARP      =" . Foo_WARP;
16print "    Foo_LUDICROUS =" . Foo_LUDICROUS;
17
18print "\nTesting use of enums with functions\n";
19
20enum_test(RED, Foo_IMPULSE);
21enum_test(BLUE, Foo_WARP);
22enum_test(GREEN, Foo_LUDICROUS);
23enum_test(1234,5678);
24
25print "\nTesting use of enum with class method\n";
26$f = new_Foo();
27
28Foo_enum_test($f,Foo_IMPULSE);
29Foo_enum_test($f,Foo_WARP);
30Foo_enum_test($f,Foo_LUDICROUS);
31
32?>