1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/opcache/tests/inc_array.phpt
2021-09-16 14:43:08 +02:00

28 lines
441 B
PHP

--TEST--
Do not constant fold increment of array
--FILE--
<?php
function test_inc_array() {
$a = [];
$a++;
}
function test_inc_partial_array($k) {
$a = [];
$a[$k] = 0;
$a++;
}
try {
test_inc_array();
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
try {
test_inc_partial_array(0);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Cannot increment array
Cannot increment array