3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!class_exists('DateTime') ) { die('Feature not available yet'); } echo "Same date:\n"; $a = new DateTime('2015-01-31 01:23:45 UTC'); $b = new DateTime('2015-01-31 02:23:45 Europe/Paris'); var_dump($a, $b, $a<$b, $a==$b, $a>$b); echo "\n"; echo "First greater than second:\n"; $a = new DateTime('2015-01-31 01:23:46 UTC'); $b = new DateTime('2015-01-31 02:23:45 Europe/Paris'); var_dump($a, $b, $a<$b, $a==$b, $a>$b); echo "\n"; echo "First less than second:\n"; $a = new DateTime('2015-01-31 01:23:45 UTC'); $b = new DateTime('2015-01-31 02:23:46 Europe/Paris'); var_dump($a, $b, $a<$b, $a==$b, $a>$b);
Output for git.master, git.master_jit
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for rfc.property-hooks
Same date: object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-31 01:23:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTime)#2 (3) { ["date"]=> string(26) "2015-01-31 02:23:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Europe/Paris" } bool(false) bool(true) bool(false) First greater than second: object(DateTime)#3 (3) { ["date"]=> string(26) "2015-01-31 01:23:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-31 02:23:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Europe/Paris" } bool(false) bool(false) bool(true) First less than second: object(DateTime)#2 (3) { ["date"]=> string(26) "2015-01-31 01:23:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-01-31 02:23:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Europe/Paris" } bool(true) bool(false) bool(false)

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:
18.74 ms | 409 KiB | 5 Q