Am I doing something wrong?
$i==3 ? break : $i++ ; I do not get the expected result.
The ternary operator uses data of the same type. You cannot use words like break or continue .
Example of use:
$i += $i > 5 ? 1 : 2; Use
if ($i == 3) break; $i++; break not a value .. in the ternary operator you need to return something
Source: https://ru.stackoverflow.com/questions/623511/
All Articles
if/elseentry. What could there be abreak? - Alexey Shimanskyifthere is nobreak. Separated from cycles, this in itself is a meaningless construction - Alexey Shimansky