php-src/Zend/tests/ternary_associativity.phpt
Nikita Popov 0a5b7c81b7 Make nested ternary without parentheses a compile error
This was deprecated in PHP 7.4.
2020-07-24 10:35:42 +02:00

23 lines
307 B
PHP

--TEST--
Allowed nested ternary cases
--FILE--
<?php
(1 ? 2 : 3) ? 4 : 5; // ok
1 ? 2 : (3 ? 4 : 5); // ok
1 ?: 2 ?: 3; // ok
(1 ?: 2) ?: 3; // ok
1 ?: (2 ?: 3); // ok
(1 ?: 2) ? 3 : 4; // ok
1 ?: (2 ? 3 : 4); // ok
(1 ? 2 : 3) ?: 4; // ok
1 ? 2 : (3 ?: 4); // ok
?>
===DONE===
--EXPECT--
===DONE===