[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
This commit is contained in:
Olly Betts 2016-11-30 13:05:59 +13:00
commit 1169874f59
202 changed files with 11575 additions and 719 deletions

View file

@ -0,0 +1,20 @@
<?php
require "tests.php";
require "cpp_basic.php";
// New functions
check::functions(array(foo_func1,foo_func2,foo___str__,foosubsub___str__,bar_test,bar_testfoo,get_func1_ptr,get_func2_ptr,test_func_ptr,fl_window_show));
// New classes
check::classes(array(cpp_basic,Foo,FooSub,FooSubSub,Bar,Fl_Window));
// New vars
check::globals(array(foo_num,foo_func_ptr,bar_fptr,bar_fref,bar_fval,bar_cint,bar_global_fptr,bar_global_fref,bar_global_fval));
$f = new Foo(3);
$f->func_ptr = get_func1_ptr();
check::equal(test_func_ptr($f, 7), 2*7*3, "get_func1_ptr() didn't work");
$f->func_ptr = get_func2_ptr();
check::equal(test_func_ptr($f, 7), -7*3, "get_func2_ptr() didn't work");
check::done();
?>