summaryrefslogtreecommitdiff
path: root/ext/opcache/tests/opt
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2017-09-12 21:34:53 +0800
committerXinchen Hui <laruence@gmail.com>2017-09-12 21:35:30 +0800
commit07ed545abfb5a5caed6de3b8cf18930398759559 (patch)
tree7e9f6386448e7cbe92537835f0203d66a98ae5ff /ext/opcache/tests/opt
parent0a98998b3c1ba9733c0ce24c28d930f0b16be87a (diff)
downloadphp-git-07ed545abfb5a5caed6de3b8cf18930398759559.tar.gz
Fixed memleak in SCCP
Diffstat (limited to 'ext/opcache/tests/opt')
-rw-r--r--ext/opcache/tests/opt/sccp_021.phpt30
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