3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = DateTime; echo date.format('Y');
based on jhu1q
Output for 7.2.6
Warning: Use of undefined constant DateTime - assumed 'DateTime' (this will throw an Error in a future version of PHP) in /in/ukj3g on line 2 Warning: Use of undefined constant date - assumed 'date' (this will throw an Error in a future version of PHP) in /in/ukj3g on line 3 Fatal error: Uncaught Error: Call to undefined function format() in /in/ukj3g:3 Stack trace: #0 {main} thrown in /in/ukj3g on line 3
Process exited with code 255.
Output for 7.0.0 - 7.1.20
Notice: Use of undefined constant DateTime - assumed 'DateTime' in /in/ukj3g on line 2 Notice: Use of undefined constant date - assumed 'date' in /in/ukj3g on line 3 Fatal error: Uncaught Error: Call to undefined function format() in /in/ukj3g:3 Stack trace: #0 {main} thrown in /in/ukj3g on line 3
Process exited with code 255.
Output for hhvm-3.22.0
Notice: Use of undefined constant DateTime - assumed 'DateTime' in /in/ukj3g on line -1 Notice: Use of undefined constant date - assumed 'date' in /in/ukj3g on line -1 Fatal error: Uncaught Error: Call to undefined function format() in /in/ukj3g:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Notice: Use of undefined constant DateTime - assumed 'DateTime' in /in/ukj3g on line 2 Notice: Use of undefined constant date - assumed 'date' in /in/ukj3g on line 3 Fatal error: Uncaught Error: Call to undefined function format() in /in/ukj3g:3 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Notice: Use of undefined constant DateTime - assumed 'DateTime' in /in/ukj3g on line 2 Notice: Use of undefined constant date - assumed 'date' in /in/ukj3g on line 3 Fatal error: Call to undefined function format() in /in/ukj3g on line 3
Process exited with code 255.