Fix director_classes_runme.php for PHP 7.0
PHP 7.0 fails to parse `?` before a parameter type (meaning Nullable in newer versions), so just omit these parameter type declarations in the testcase until we drop PHP 7.0 support. Also drop some `var_dump($x);` left over from debugging this testcase.
This commit is contained in:
parent
14df91f8a0
commit
b7f82d78e9
1 changed files with 7 additions and 3 deletions
|
|
@ -14,7 +14,7 @@ if (PHP_MAJOR_VERSION < 8) {
|
||||||
class PHPDerived extends Base {
|
class PHPDerived extends Base {
|
||||||
function Val($x) { return $x; }
|
function Val($x) { return $x; }
|
||||||
function Ref($x) { return $x; }
|
function Ref($x) { return $x; }
|
||||||
function Ptr($x) { var_dump($x); return $x; }
|
function Ptr($x) { return $x; }
|
||||||
function ConstPtrRef($x) { return $x; }
|
function ConstPtrRef($x) { return $x; }
|
||||||
function FullyOverloaded($x) {
|
function FullyOverloaded($x) {
|
||||||
$rv = parent::FullyOverloaded($x);
|
$rv = parent::FullyOverloaded($x);
|
||||||
|
|
@ -41,8 +41,12 @@ if (PHP_MAJOR_VERSION < 8) {
|
||||||
class PHPDerived extends Base {
|
class PHPDerived extends Base {
|
||||||
function Val(DoubleHolder $x) { return $x; }
|
function Val(DoubleHolder $x) { return $x; }
|
||||||
function Ref(DoubleHolder $x) { return $x; }
|
function Ref(DoubleHolder $x) { return $x; }
|
||||||
function Ptr(?DoubleHolder $x) { var_dump($x); return $x; }
|
// PHP 7.0 fails to parse the `?` - revert once we drop 7.0 support:
|
||||||
function ConstPtrRef(?DoubleHolder $x) { return $x; }
|
// 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 FullyOverloaded($x) {
|
function FullyOverloaded($x) {
|
||||||
$rv = parent::FullyOverloaded($x);
|
$rv = parent::FullyOverloaded($x);
|
||||||
$rv = preg_replace('/Base/', 'PHPDerived', $rv);
|
$rv = preg_replace('/Base/', 'PHPDerived', $rv);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue