summaryrefslogtreecommitdiff
path: root/Zend/tests/ctor_promotion_by_ref.phpt
blob: 4b07149c579ef51f272e784d79d660ade18271d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--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)
}