[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:
parent
bb98147965
commit
1169874f59
202 changed files with 11575 additions and 719 deletions
43
Examples/test-suite/php5/threads_exception_runme.php
Normal file
43
Examples/test-suite/php5/threads_exception_runme.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
require "tests.php";
|
||||
require "threads_exception.php";
|
||||
|
||||
// Check functions
|
||||
check::functions(array(test_simple,test_message,test_hosed,test_unknown,test_multi,is_python_builtin));
|
||||
// Check classes.
|
||||
check::classes(array(Exc,Test,threads_exception));
|
||||
// Chek globals.
|
||||
check::globals(array(exc_code,exc_msg));
|
||||
|
||||
$t = new Test();
|
||||
try {
|
||||
$t->unknown();
|
||||
} catch (Exception $e) {
|
||||
check::equal($e->getMessage(), 'C++ A * exception thrown', '');
|
||||
}
|
||||
|
||||
try {
|
||||
$t->simple();
|
||||
} catch (Exception $e) {
|
||||
check::equal($e->getCode(), 37, '');
|
||||
}
|
||||
|
||||
try {
|
||||
$t->message();
|
||||
} catch (Exception $e) {
|
||||
check::equal($e->getMessage(), 'I died.', '');
|
||||
}
|
||||
|
||||
try {
|
||||
$t->hosed();
|
||||
} catch (Exception $e) {
|
||||
check::equal($e->getMessage(), 'C++ Exc exception thrown', '');
|
||||
}
|
||||
|
||||
foreach (Array(1,2,3,4) as $i) {
|
||||
try {
|
||||
$t->multi($i);
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue