3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = null; echo ($date ?: date_create())->format('Y-m-d');
Output for 7.0.20 - 7.2.0
2016-01-07
Output for 7.0.6
2016-05-21
Output for 7.0.5
2016-04-03
Output for 7.0.4
2016-03-10
Output for 7.0.3
2016-03-18
Output for 7.0.2
2016-03-23
Output for 7.0.1
2016-03-24
Output for 7.0.0
2016-03-27
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ',' or ';' in /in/vaYPU on line 5
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/vaYPU on line 5
Process exited with code 255.