3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'Should see 'default value'; $empty_string = ""; $result1 = $empty_string ?: "default value"; var_dump($result1); echo 'Should see 'overridden value'; $non_empty_string = "something"; $result2 = $non_empty_string ?: "overridden value"; var_dump($result2);
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected 'default' (T_DEFAULT), expecting ',' or ';' in /in/v3E0B on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_DEFAULT, expecting ',' or ';' in /in/v3E0B on line 2
Process exited with code 255.

preferences:
180.6 ms | 1395 KiB | 62 Q