swig/Examples/php5/enum/runme.php
Olly Betts 1169874f59 [PHP] Add support for PHP7.
PHP5's C extension API has changed substantially so you need to use
-php7 to specify you want PHP7 compatible wrappers.
Fixes https://github.com/swig/swig/issues/571
2016-11-30 13:05:59 +13:00

32 lines
694 B
PHP

<?php
require "example.php";
# ----- Object creation -----
# Print out the value of some enums
print "*** color ***";
print " RED =" . RED;
print " BLUE =" . BLUE;
print " GREEN =" . GREEN;
print "\n*** Foo::speed ***";
print " Foo_IMPULSE =" . Foo_IMPULSE;
print " Foo_WARP =" . Foo_WARP;
print " Foo_LUDICROUS =" . Foo_LUDICROUS;
print "\nTesting use of enums with functions\n";
enum_test(RED, Foo_IMPULSE);
enum_test(BLUE, Foo_WARP);
enum_test(GREEN, Foo_LUDICROUS);
enum_test(1234,5678);
print "\nTesting use of enum with class method\n";
$f = new_Foo();
Foo_enum_test($f,Foo_IMPULSE);
Foo_enum_test($f,Foo_WARP);
Foo_enum_test($f,Foo_LUDICROUS);
?>