3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date1 = new DateTime(); $date2 = new DateTime('2 hours ago'); var_dump($date1); var_dump($date2); var_dump($date1 - $date2);
Output for git.master
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-28 08:36:38.003913" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-28 06:36:38.003927" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Uncaught TypeError: Unsupported operand types: DateTime - DateTime in /in/gqEK5:9 Stack trace: #0 {main} thrown in /in/gqEK5 on line 9
Process exited with code 255.
Output for git.master_jit
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-28 08:36:38.004084" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-28 06:36:38.004095" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Uncaught TypeError: Unsupported operand types: DateTime - DateTime in /in/gqEK5:9 Stack trace: #0 {main} thrown in /in/gqEK5 on line 9
Process exited with code 255.
Output for rfc.property-hooks
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-28 08:36:38.003818" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-12-28 06:36:38.003823" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Uncaught TypeError: Unsupported operand types: DateTime - DateTime in /in/gqEK5:9 Stack trace: #0 {main} thrown in /in/gqEK5 on line 9
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
57.53 ms | 401 KiB | 8 Q