diff options
Diffstat (limited to 'Examples/test-suite')
-rw-r--r-- | Examples/test-suite/php/default_args_runme.php | 17 | ||||
-rw-r--r-- | Examples/test-suite/php/director_classes_runme.php | 8 | ||||
-rw-r--r-- | Examples/test-suite/php/director_thread_runme.php | 2 |
3 files changed, 3 insertions, 24 deletions
diff --git a/Examples/test-suite/php/default_args_runme.php b/Examples/test-suite/php/default_args_runme.php index 59350644f..31cbe0ff4 100644 --- a/Examples/test-suite/php/default_args_runme.php +++ b/Examples/test-suite/php/default_args_runme.php @@ -42,19 +42,6 @@ check::equal($f->double_if_void_ptr_is_null(6, Null), 12, "\$f->double_if_void_p check::equal($f->double_if_void_ptr_is_null(7), 14, "\$f->double_if_void_ptr_is_null(7)"); -# For the testcases below, PHP 7 emits an error, while PHP 8 throws an -# exception. To simplify the testcases we install an error handler function -# for PHP7 which throws an ArgumentCountError exception (which we have to -# define ourselves for PHP 7.0). - -if (PHP_MAJOR_VERSION == 7) { - if (PHP_MINOR_VERSION == 0) { - # ArgumentCountError was added in PHP 7.1. - class ArgumentCountError extends Error {} - } - $old_error_handler = set_error_handler(function($n,$s,$f,$l){throw preg_match('/^Wrong parameter count/', $s) ? new ArgumentCountError($s) : new Error($s);}); -} - try { $f = new Foo(1); check::fail("Foo::Foo ignore is not working"); @@ -91,10 +78,6 @@ try { } catch (Error $e) { } -if (PHP_MAJOR_VERSION == 7) { - set_error_handler($old_error_handler); -} - check::equal(Klass::inc(100, new Klass(22))->val, 122, "Klass::inc failed"); check::equal(klass::inc(100)->val, 99, "klass::inc failed"); diff --git a/Examples/test-suite/php/director_classes_runme.php b/Examples/test-suite/php/director_classes_runme.php index d187ed82e..937d0db3f 100644 --- a/Examples/test-suite/php/director_classes_runme.php +++ b/Examples/test-suite/php/director_classes_runme.php @@ -41,12 +41,8 @@ if (PHP_MAJOR_VERSION < 8) { class PHPDerived extends Base { function Val(DoubleHolder $x) { return $x; } function Ref(DoubleHolder $x) { return $x; } - // PHP 7.0 fails to parse the `?` - revert once we drop 7.0 support: - // function Ptr(?DoubleHolder $x) { return $x; } - function Ptr($x) { return $x; } - // PHP 7.0 fails to parse the `?` - revert once we drop 7.0 support: - // function ConstPtrRef(?DoubleHolder $x) { return $x; } - function ConstPtrRef($x) { return $x; } + function Ptr(?DoubleHolder $x) { return $x; } + function ConstPtrRef(?DoubleHolder $x) { return $x; } function FullyOverloaded($x) { $rv = parent::FullyOverloaded($x); $rv = preg_replace('/Base/', 'PHPDerived', $rv); diff --git a/Examples/test-suite/php/director_thread_runme.php b/Examples/test-suite/php/director_thread_runme.php index 190dbad71..e4eb3684a 100644 --- a/Examples/test-suite/php/director_thread_runme.php +++ b/Examples/test-suite/php/director_thread_runme.php @@ -3,7 +3,7 @@ require "tests.php"; # Fails in a ZTS-build of PHP5 - see: https://github.com/swig/swig/pull/155 -# FIXME: Does this still fail in a threaded build of PHP7? +# FIXME: Does this still fail in a threaded build of PHP8? exit(0); // New functions |