run code in 200+ php & hhvm versions
Bugs & Features
<?php // on first glance, the following appears to output 'true' echo (true?'true':false?'t':'f'); // however, the actual output of the above is 't' // this is because ternary expressions are evaluated from left to right // the following is a more obvious version of the same code as above echo ((true ? 'true' : false) ? 't' : 'f'); // here, you can see that the first expression is evaluated to 'true', which // in turn evaluates to (bool)true, thus returning the true branch of the // second ternary expression.
based on GvPiZ
Output for 4.3.0 - 5.0.5, 5.1.1 - 7.2.0
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/KdoBP on line 13
Process exited with code 255.