php-src/Zend/tests/add_optional_by_ref_arg.phpt
2022-04-18 17:57:16 +02:00

23 lines
348 B
PHP

--TEST--
Adding an optional by-ref arg in a child method
--FILE--
<?php
class Test1 {
public function method1() {
$this->method2($x);
var_dump($x);
}
public function method2() {}
}
class Test2 extends Test1 {
public function method2(&$x = null) {
++$x;
}
}
(new Test2)->method1();
?>
--EXPECT--
int(1)