summaryrefslogtreecommitdiff
path: root/Zend/tests/ternary_associativity.phpt
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-07-24 10:35:03 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-07-24 10:35:42 +0200
commit0a5b7c81b705869618755ed2d559702be6f9d6e4 (patch)
treed0e8331c5e31c8695c96b4017332a6ef8e24d2ef /Zend/tests/ternary_associativity.phpt
parent9bf119832dbf625174794834c71b1e793450d87f (diff)
downloadphp-git-0a5b7c81b705869618755ed2d559702be6f9d6e4.tar.gz
Make nested ternary without parentheses a compile error
This was deprecated in PHP 7.4.
Diffstat (limited to 'Zend/tests/ternary_associativity.phpt')
-rw-r--r--Zend/tests/ternary_associativity.phpt16
1 files changed, 4 insertions, 12 deletions
diff --git a/Zend/tests/ternary_associativity.phpt b/Zend/tests/ternary_associativity.phpt
index 32326513ca..edc0499143 100644
--- a/Zend/tests/ternary_associativity.phpt
+++ b/Zend/tests/ternary_associativity.phpt
@@ -1,30 +1,22 @@
--TEST--
-Using ternary associativity is deprecated
+Allowed nested ternary cases
--FILE--
<?php
-1 ? 2 : 3 ? 4 : 5; // deprecated
(1 ? 2 : 3) ? 4 : 5; // ok
1 ? 2 : (3 ? 4 : 5); // ok
-// While the associativity of ?: is also incorrect, it will not cause a
-// functional difference, only some unnecessary checks.
1 ?: 2 ?: 3; // ok
(1 ?: 2) ?: 3; // ok
1 ?: (2 ?: 3); // ok
-1 ?: 2 ? 3 : 4; // deprecated
(1 ?: 2) ? 3 : 4; // ok
1 ?: (2 ? 3 : 4); // ok
-1 ? 2 : 3 ?: 4; // deprecated
(1 ? 2 : 3) ?: 4; // ok
1 ? 2 : (3 ?: 4); // ok
?>
---EXPECTF--
-Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in %s on line 3
-
-Deprecated: Unparenthesized `a ?: b ? c : d` is deprecated. Use either `(a ?: b) ? c : d` or `a ?: (b ? c : d)` in %s on line 13
-
-Deprecated: Unparenthesized `a ? b : c ?: d` is deprecated. Use either `(a ? b : c) ?: d` or `a ? b : (c ?: d)` in %s on line 17
+===DONE===
+--EXPECT--
+===DONE===