3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(0); $date = new DateTime('yesterday'); $null = null; var_dump($date->format('U')); var_dump($date < $null); var_dump($date > $null); var_dump($null < $date); var_dump($null > $date); if (class_exists('DateTimeImmutable')) { $dati = new DateTimeImmutable(); var_dump($dati < $date); var_dump($dati > $date); var_dump($null < $dati); var_dump($null > $dati); } else { echo 'Not Implemented'; }
Output for 5.5.4 - 7.1.0
string(10) "1400018400" bool(false) bool(true) bool(true) bool(false) bool(false) bool(true) bool(true) bool(false)
Output for 5.5.0 - 5.5.3
string(10) "1400018400" bool(false) bool(true) bool(true) bool(false) bool(false) bool(false) bool(true) bool(false)
Output for 5.2.0 - 5.4.45
string(10) "1400018400" bool(false) bool(true) bool(true) bool(false) Not Implemented
Output for 4.3.2 - 5.1.6

Process exited with code 255.
Output for 4.3.0 - 4.3.1