xref: /PHP-7.4/ext/opcache/tests/opt/sccp_029.phpt (revision f19dd674)
1--TEST--
2SCCP 029: Don't propagate assignments to references to typed properties
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7opcache.preload=
8--SKIPIF--
9<?php require_once('skipif.inc'); ?>
10--FILE--
11<?php
12
13class Test {
14    public string $x = "x";
15}
16function test() {
17    $test = new Test();
18    $ref = "y";
19    $test->x =& $ref;
20    $ref = 42;
21    var_dump($ref);
22}
23test();
24
25?>
26--EXPECT--
27string(2) "42"
28