php-src/Zend/tests/ternary_associativity_2.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

11 lines
223 B
PHP

--TEST--
Forbidden nested ternary, case 2
--FILE--
<?php
1 ?: 2 ? 3 : 4;
?>
--EXPECTF--
Fatal error: Unparenthesized `a ?: b ? c : d` is not supported. Use either `(a ?: b) ? c : d` or `a ?: (b ? c : d)` in %s on line %d