php-src/Zend/tests/ctor_promotion_by_ref.phpt
2020-06-05 15:15:51 +02:00

21 lines
260 B
PHP

--TEST--
Constructor promotion of by-ref parameter
--FILE--
<?php
class Ary {
public function __construct(public array &$array) {}
}
$array = [];
$ary = new Ary($array);
$array[] = 42;
var_dump($ary->array);
?>
--EXPECT--
array(1) {
[0]=>
int(42)
}