diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-12-12 11:52:51 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-12-12 11:52:51 +0100 |
commit | d56768817b6c8df0f8966bd1ee1d121741631ac2 (patch) | |
tree | 14209bd78f9269bf744bd6fe1c7d915965bdd622 /ext | |
parent | cf9362195bdd790f5da1f5d37b336f900fdb022b (diff) | |
parent | be89a5c7f191b319c11b3b487a1366e20a1fdc17 (diff) | |
download | php-git-d56768817b6c8df0f8966bd1ee1d121741631ac2.tar.gz |
Merge branch 'PHP-7.4'
* PHP-7.4:
Fixed bug #78950: Preloading trait method with static variables
Diffstat (limited to 'ext')
-rw-r--r-- | ext/opcache/tests/preload_trait_static.inc | 12 | ||||
-rw-r--r-- | ext/opcache/tests/preload_trait_static.phpt | 16 |
2 files changed, 28 insertions, 0 deletions
diff --git a/ext/opcache/tests/preload_trait_static.inc b/ext/opcache/tests/preload_trait_static.inc new file mode 100644 index 0000000000..a2acff2ddb --- /dev/null +++ b/ext/opcache/tests/preload_trait_static.inc @@ -0,0 +1,12 @@ +<?php + +trait Foo { + public function test() { + static $bar; + var_dump($bar); + } +} + +class Bar { + use Foo; +} diff --git a/ext/opcache/tests/preload_trait_static.phpt b/ext/opcache/tests/preload_trait_static.phpt new file mode 100644 index 0000000000..55e3a2cd8a --- /dev/null +++ b/ext/opcache/tests/preload_trait_static.phpt @@ -0,0 +1,16 @@ +--TEST-- +Preload trait with static variables in method +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +opcache.preload={PWD}/preload_trait_static.inc +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +$bar = new Bar; +$bar->test(); +?> +--EXPECT-- +NULL |