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