diff options
author | Xinchen Hui <laruence@gmail.com> | 2017-09-12 21:34:53 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2017-09-12 21:35:30 +0800 |
commit | 07ed545abfb5a5caed6de3b8cf18930398759559 (patch) | |
tree | 7e9f6386448e7cbe92537835f0203d66a98ae5ff /ext/opcache/tests/opt | |
parent | 0a98998b3c1ba9733c0ce24c28d930f0b16be87a (diff) | |
download | php-git-07ed545abfb5a5caed6de3b8cf18930398759559.tar.gz |
Fixed memleak in SCCP
Diffstat (limited to 'ext/opcache/tests/opt')
-rw-r--r-- | ext/opcache/tests/opt/sccp_021.phpt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/opcache/tests/opt/sccp_021.phpt b/ext/opcache/tests/opt/sccp_021.phpt new file mode 100644 index 0000000000..27d1c91b11 --- /dev/null +++ b/ext/opcache/tests/opt/sccp_021.phpt @@ -0,0 +1,30 @@ +--TEST-- +SCCP 020: Memleak +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +;opcache.opt_debug_level=0x20000 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +class A { + public function memleak($num_tokens) { + $queries = array(); + for ( $i = 0; $i < $num_tokens; ++$i ) { + if ( 0 < $i ) + $queries[$i] = $queries[$i - 1] . '&'; + else + $queries[$i] = ''; + + $queries[$i] .= $query_token; + } + + return; + } +} +okey +?> +--EXPECT-- +okey |