3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(!class_exists('DateInterval')) return; $x = DateInterval::createFromDateString('10 minutes'); $y = DateInterval::createFromDateString('30 minutes'); compare($x, $y); print_r($x, true); print_r($y, true); echo "\nAFTER\n"; compare($x, $y); function compare($x, $y) { echo 'x > y: '; var_dump($x > $y); echo 'x < y: '; var_dump($x < $y); echo 'x == y: '; var_dump($x == $y); echo 'x != y: '; var_dump($x != $y); }
Output for git.master, git.master_jit, rfc.property-hooks
x > y: Warning: Cannot compare DateInterval objects in /in/jLSDU on line 14 bool(false) x < y: Warning: Cannot compare DateInterval objects in /in/jLSDU on line 16 bool(false) x == y: Warning: Cannot compare DateInterval objects in /in/jLSDU on line 18 bool(false) x != y: Warning: Cannot compare DateInterval objects in /in/jLSDU on line 20 bool(true) AFTER x > y: Warning: Cannot compare DateInterval objects in /in/jLSDU on line 14 bool(false) x < y: Warning: Cannot compare DateInterval objects in /in/jLSDU on line 16 bool(false) x == y: Warning: Cannot compare DateInterval objects in /in/jLSDU on line 18 bool(false) x != y: Warning: Cannot compare DateInterval objects in /in/jLSDU on line 20 bool(true)

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:
48.57 ms | 402 KiB | 8 Q