diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-07-02 02:00:34 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-07-02 02:00:34 +0300 |
commit | fa1abb567798fb50a2d84e82021b79909c6aefba (patch) | |
tree | 892e01ce96d8bf494074d037d1edeadcc40efef9 /ext/opcache/tests/leak_001.phpt | |
parent | e6f1638ad033292d2cd0cf94a8f308d15ce7c45a (diff) | |
download | php-git-fa1abb567798fb50a2d84e82021b79909c6aefba.tar.gz |
Fixed memory leak because of incorrect 'if ();' optimization
Diffstat (limited to 'ext/opcache/tests/leak_001.phpt')
-rw-r--r-- | ext/opcache/tests/leak_001.phpt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/opcache/tests/leak_001.phpt b/ext/opcache/tests/leak_001.phpt new file mode 100644 index 0000000000..c590943fcb --- /dev/null +++ b/ext/opcache/tests/leak_001.phpt @@ -0,0 +1,34 @@ +--TEST-- +Leak 001: Incorrect 'if ();' optimization +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache_only=0 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +if (false); + +if (true); + +if (2 + 3); + +$x = 2; +$y = 3; +if ($x + $y); + +if ($x); + +$a = [[$x]]; +if ($a[0]); + +if (new stdClass()); + +$x = 2; +$a = [1,$x]; +if ((object)$a); +?> +OK +--EXPECT-- +OK |