3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //round pour le changement d'heure $debut = mktime(0, 0, 0, 10, 27, 2013); $fin = mktime(23, 0, 0, 10, 27, 2013); echo date('H:i:s d/m/Y',strtotime('+23 hours',$debut))."\n"; $d1 = new DateTime ('now',new DateTimeZone('Europe/Paris')); $d2 = new DateTime ('now',new DateTimeZone('Europe/Paris')); $d1->setTimestamp($debut); $d2->setTimestamp($fin); $diff = $d1->diff($d2); print_r($diff->h); $d3 = $d1->add($diff); print_r($d3['date']);
Output for 7.0.0 - 7.1.0
23:00:00 27/10/2013 24 Fatal error: Uncaught Error: Cannot use object of type DateTime as array in /in/bECSD:16 Stack trace: #0 {main} thrown in /in/bECSD on line 16
Process exited with code 255.
Output for hhvm-3.12.0
23:00:00 27/10/2013 24 Fatal error: Uncaught Error: Object does not implement ArrayAccess in /in/bECSD:16 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
23:00:00 27/10/2013 24 Fatal error: Object does not implement ArrayAccess in /in/bECSD on line 16
Process exited with code 255.
Output for 5.4.24 - 5.4.45, 5.5.8 - 5.6.28
23:00:00 27/10/2013 24 Fatal error: Cannot use object of type DateTime as array in /in/bECSD on line 16
Process exited with code 255.
Output for 5.3.0 - 5.4.23, 5.5.0 - 5.5.7
23:00:00 27/10/2013 23 Fatal error: Cannot use object of type DateTime as array in /in/bECSD on line 16
Process exited with code 255.
Output for 5.2.0 - 5.2.17
23:00:00 27/10/2013 Fatal error: Call to undefined method DateTime::setTimestamp() in /in/bECSD on line 10
Process exited with code 255.
Output for 5.1.0 - 5.1.6
23:00:00 27/10/2013 Fatal error: Class 'DateTime' not found in /in/bECSD on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.5
22:00:00 27/10/2013 Fatal error: Class 'DateTime' not found in /in/bECSD on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.9
22:00:00 27/10/2013 Fatal error: Cannot instantiate non-existent class: datetime in /in/bECSD on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
22:00:00 27/10/2013 Fatal error: Cannot instantiate non-existent class: datetime in /in/bECSD on line 8