summaryrefslogtreecommitdiff
path: root/Zend/tests/ternary_associativity.phpt
blob: edc04991437d668e4645fa1a52d546259e68d9dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--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===