xref: /PHP-7.4/ext/opcache/tests/opt/sccp_025.phpt (revision ded3d984)
1--TEST--
2SCCP 025: ADD_ARRAY_ELEMENT against an existing const array
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7opcache.opt_debug_level=0
8--SKIPIF--
9<?php require_once('skipif.inc'); ?>
10--FILE--
11<?php
12function test($phpEx)
13{
14	$expected_data_sets = array(
15		1 => array(
16			'id'  => 1,
17		),
18		6 => array(
19			'viewtopic' => strval("phpBB/viewtopic.$phpEx"),
20
21		),
22	);
23
24	$test_cases = array(
25		array(
26			'expected' => array(6),
27		),
28	);
29
30	foreach ($test_cases as $case => $case_data)
31	{
32		foreach ($case_data['expected'] as $data_set => $expected)
33		{
34			$test_cases[$case]['expected'][$data_set] = $expected_data_sets[$expected];
35		}
36	}
37
38	return $test_cases;
39}
40var_dump(test("xxx"));
41?>
42--EXPECT--
43array(1) {
44  [0]=>
45  array(1) {
46    ["expected"]=>
47    array(1) {
48      [0]=>
49      array(1) {
50        ["viewtopic"]=>
51        string(19) "phpBB/viewtopic.xxx"
52      }
53    }
54  }
55}
56