1--TEST--
2Using ternary associativity is deprecated
3--FILE--
4<?php
5
61 ? 2 : 3 ? 4 : 5;   // deprecated
7(1 ? 2 : 3) ? 4 : 5; // ok
81 ? 2 : (3 ? 4 : 5); // ok
9
10// While the associativity of ?: is also incorrect, it will not cause a
11// functional difference, only some unnecessary checks.
121 ?: 2 ?: 3;   // ok
13(1 ?: 2) ?: 3; // ok
141 ?: (2 ?: 3); // ok
15
161 ?: 2 ? 3 : 4;   // deprecated
17(1 ?: 2) ? 3 : 4; // ok
181 ?: (2 ? 3 : 4); // ok
19
201 ? 2 : 3 ?: 4;   // deprecated
21(1 ? 2 : 3) ?: 4; // ok
221 ? 2 : (3 ?: 4); // ok
23
24?>
25--EXPECTF--
26Deprecated: 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
27
28Deprecated: Unparenthesized `a ?: b ? c : d` is deprecated. Use either `(a ?: b) ? c : d` or `a ?: (b ? c : d)` in %s on line 13
29
30Deprecated: Unparenthesized `a ? b : c ?: d` is deprecated. Use either `(a ? b : c) ?: d` or `a ? b : (c ?: d)` in %s on line 17
31