summaryrefslogtreecommitdiff
path: root/ext/opcache/tests/opt
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2018-01-07 14:17:47 +0800
committerXinchen Hui <laruence@gmail.com>2018-01-07 14:17:47 +0800
commit63a96ebf6a833aa1a0133948ad537a8d77bf75c7 (patch)
treea127f6eb1f609868dda5c3ee5b487dbe90c47c67 /ext/opcache/tests/opt
parent6e94f943c1943984b55de159404d480f82357f7c (diff)
downloadphp-git-63a96ebf6a833aa1a0133948ad537a8d77bf75c7.tar.gz
Fixed bug while dealing with ADD_ARRAY_ELEMENT against an existing const array
Diffstat (limited to 'ext/opcache/tests/opt')
-rw-r--r--ext/opcache/tests/opt/sccp_025.phpt55
1 files changed, 55 insertions, 0 deletions
diff --git a/ext/opcache/tests/opt/sccp_025.phpt b/ext/opcache/tests/opt/sccp_025.phpt
new file mode 100644
index 0000000000..020973368e
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_025.phpt
@@ -0,0 +1,55 @@
+--TEST--
+SCCP 025: ADD_ARRAY_ELEMENT against an existing const array
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function test($phpEx)
+{
+ $expected_data_sets = array(
+ 1 => array(
+ 'id' => 1,
+ ),
+ 6 => array(
+ 'viewtopic' => strval("phpBB/viewtopic.$phpEx"),
+
+ ),
+ );
+
+ $test_cases = array(
+ array(
+ 'expected' => array(6),
+ ),
+ );
+
+ foreach ($test_cases as $case => $case_data)
+ {
+ foreach ($case_data['expected'] as $data_set => $expected)
+ {
+ $test_cases[$case]['expected'][$data_set] = $expected_data_sets[$expected];
+ }
+ }
+
+ return $test_cases;
+}
+var_dump(test("xxx"));
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ array(1) {
+ ["expected"]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ ["viewtopic"]=>
+ string(19) "phpBB/viewtopic.xxx"
+ }
+ }
+ }
+}