sccp_025.phpt 997 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --TEST--
  2. SCCP 025: ADD_ARRAY_ELEMENT against an existing const array
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.optimization_level=-1
  7. opcache.opt_debug_level=0
  8. --EXTENSIONS--
  9. opcache
  10. --FILE--
  11. <?php
  12. function 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. $test_cases = array(
  23. array(
  24. 'expected' => array(6),
  25. ),
  26. );
  27. foreach ($test_cases as $case => $case_data)
  28. {
  29. foreach ($case_data['expected'] as $data_set => $expected)
  30. {
  31. $test_cases[$case]['expected'][$data_set] = $expected_data_sets[$expected];
  32. }
  33. }
  34. return $test_cases;
  35. }
  36. var_dump(test("xxx"));
  37. ?>
  38. --EXPECT--
  39. array(1) {
  40. [0]=>
  41. array(1) {
  42. ["expected"]=>
  43. array(1) {
  44. [0]=>
  45. array(1) {
  46. ["viewtopic"]=>
  47. string(19) "phpBB/viewtopic.xxx"
  48. }
  49. }
  50. }
  51. }