summaryrefslogtreecommitdiff
path: root/Examples
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2023-04-14 17:38:01 +1200
committerOlly Betts <olly@survex.com>2023-04-14 17:38:01 +1200
commite3b112c69ceed5c39cb07fa45a3ba62b27712679 (patch)
treec7c771a2b1d09862632facdf01ae10a05e2d61a4 /Examples
parent33f6a2d0b2c3d90b928f56ddfa599afe87903f76 (diff)
downloadswig-e3b112c69ceed5c39cb07fa45a3ba62b27712679.tar.gz
Remove support for PHP7
PHP7 security support ended 2022-11-28 so it doesn't make sense to include support for it in the SWIG 4.2.x release series.
Diffstat (limited to 'Examples')
-rw-r--r--Examples/test-suite/php/default_args_runme.php17
-rw-r--r--Examples/test-suite/php/director_classes_runme.php8
-rw-r--r--Examples/test-suite/php/director_thread_runme.php2
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