diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-28 16:14:46 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-28 16:15:37 +0200 |
commit | f19dd674e012639f8511ff2e531f24e74ef701ac (patch) | |
tree | 49157cd9688744206b041ec4e2258081fa279c6c /ext/opcache/tests/opt | |
parent | 6738241aece97979bdb7531babcfdf12e3c4b45b (diff) | |
download | php-git-f19dd674e012639f8511ff2e531f24e74ef701ac.tar.gz |
SCCP: Fix handling of ASSIGN_OBJ_REF
The generic BOT handling is not away of OP_DATA, so need to handle
this opcode before we get to that.
Diffstat (limited to 'ext/opcache/tests/opt')
-rw-r--r-- | ext/opcache/tests/opt/sccp_029.phpt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/opcache/tests/opt/sccp_029.phpt b/ext/opcache/tests/opt/sccp_029.phpt new file mode 100644 index 0000000000..3a16477711 --- /dev/null +++ b/ext/opcache/tests/opt/sccp_029.phpt @@ -0,0 +1,27 @@ +--TEST-- +SCCP 029: Don't propagate assignments to references to typed properties +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +opcache.preload= +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + +class Test { + public string $x = "x"; +} +function test() { + $test = new Test(); + $ref = "y"; + $test->x =& $ref; + $ref = 42; + var_dump($ref); +} +test(); + +?> +--EXPECT-- +string(2) "42" |