bug75698.phpt 416 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Bug #75698: Using @ crashes php7.2-fpm
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.optimization_level=-1
  7. --EXTENSIONS--
  8. opcache
  9. --FILE--
  10. <?php
  11. function test() {
  12. $a = array("a","b","c","b");
  13. $b = array();
  14. foreach ($a as $c)
  15. @$b[$c]++; // the @ is required to crash PHP 7.2.0
  16. var_dump($b);
  17. }
  18. test();
  19. ?>
  20. --EXPECT--
  21. array(3) {
  22. ["a"]=>
  23. int(1)
  24. ["b"]=>
  25. int(2)
  26. ["c"]=>
  27. int(1)
  28. }