summaryrefslogtreecommitdiff
path: root/ext/opcache/tests/opt/sccp_025.phpt
blob: f78e8822d7648abe64884ef0cd0defcb87a8955d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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"));
?>
--EXPECT--
array(1) {
  [0]=>
  array(1) {
    ["expected"]=>
    array(1) {
      [0]=>
      array(1) {
        ["viewtopic"]=>
        string(19) "phpBB/viewtopic.xxx"
      }
    }
  }
}