3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SerialDateTime extends DateTime implements JsonSerializable{ public function jsonSerialize(){ return ['timestamp' => $this->getTimestamp()]; } public function __toString(){ return $this->getTimestamp(); } // TODO: Is this the best way, or is there a better way? public static function createFromFormat($f, $t, $tz=NULL){ $dateTime = call_user_func( array('SerialDateTime', 'parent::createFromFormat'), $f, $t, $tz ); $ret = new self(); return $ret->setTimestamp($dateTime->getTimestamp()); } } echo(strnatcasecmp(new SerialDateTime, new SerialDateTime('January 1, 2013'));

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.190.0130.04712.40
5.4.180.0190.04012.40
5.4.170.0120.04912.41
5.4.160.0180.04412.40
5.4.150.0150.04512.39
5.4.140.0150.04412.09
5.4.130.0120.04812.07
5.4.120.0140.04412.04
5.4.110.0130.04412.03
5.4.100.0110.04912.03
5.4.90.0150.04312.03
5.4.80.0160.04312.03
5.4.70.0240.03512.03
5.4.60.0160.04212.03
5.4.50.0150.04212.02
5.4.40.0190.03912.01
5.4.30.0170.04212.01
5.4.20.0140.04412.00
5.4.10.0100.04712.01
5.4.00.0170.03811.51
5.3.270.0170.04512.73
5.3.260.0150.04612.72
5.3.250.0190.04312.72
5.3.240.0220.03912.71
5.3.230.0200.04212.71
5.3.220.0140.04912.68
5.3.210.0150.04912.68
5.3.200.0130.04912.68
5.3.190.0160.04612.68
5.3.180.0190.04212.67
5.3.170.0190.04112.67
5.3.160.0150.04712.67
5.3.150.0170.04712.67
5.3.140.0150.04612.66
5.3.130.0170.04312.66
5.3.120.0160.04412.66
5.3.110.0120.05012.66
5.3.100.0230.04412.12
5.3.90.0220.03912.10
5.3.80.0190.04312.09
5.3.70.0170.04612.09
5.3.60.0150.04812.07
5.3.50.0160.04412.02
5.3.40.0180.04212.02
5.3.30.0200.03811.99
5.3.20.0180.04211.77
5.3.10.0140.04411.73
5.3.00.0210.03911.71

preferences:
139.82 ms | 1394 KiB | 7 Q