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)
8.3.60.0060.00918.41
8.3.50.0130.00522.11
8.3.40.0180.00019.09
8.3.30.0110.01118.91
8.3.20.0040.00418.88
8.3.10.0040.00421.05
8.3.00.0040.00423.55
8.2.180.0160.00616.88
8.2.170.0070.01022.96
8.2.160.0040.01120.34
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0030.00519.76
8.2.110.0060.00322.20
8.2.100.0060.00617.91
8.2.90.0030.00619.16
8.2.80.0000.00819.28
8.2.70.0040.00817.75
8.2.60.0040.00417.91
8.2.50.0040.00418.07
8.2.40.0020.00518.34
8.2.30.0040.00419.34
8.2.20.0000.00717.75
8.2.10.0040.00417.81
8.2.00.0030.00617.87
8.1.280.0130.01025.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00722.45
8.1.230.0040.00820.89
8.1.220.0040.00418.77
8.1.210.0060.00320.48
8.1.200.0060.00317.60
8.1.190.0030.00617.52
8.1.180.0080.00018.10
8.1.170.0000.00818.59
8.1.160.0040.00418.99
8.1.150.0040.00418.75
8.1.140.0050.00217.59
8.1.130.0030.00317.84
8.1.120.0030.00617.57
8.1.110.0040.00417.58
8.1.100.0050.00217.56
8.1.90.0040.00417.55
8.1.80.0040.00417.61
8.1.70.0030.00517.48
8.1.60.0040.00417.56
8.1.50.0030.00517.59
8.1.40.0040.00417.60
8.1.30.0000.00817.61
8.1.20.0000.00817.72
8.1.10.0070.00017.66
8.1.00.0040.00417.60
8.0.300.0030.00519.98
8.0.290.0000.00717.28
8.0.280.0030.00518.52
8.0.270.0030.00517.34
8.0.260.0030.00316.94
8.0.250.0050.00517.06
8.0.240.0030.00617.04
8.0.230.0030.00317.13
8.0.220.0030.00317.09
8.0.210.0030.00317.01
8.0.200.0030.00517.04
8.0.190.0040.00417.21
8.0.180.0060.00317.05
8.0.170.0080.00017.01
8.0.160.0030.00317.12
8.0.150.0030.00516.99
8.0.140.0030.00517.07
8.0.130.0000.00613.41
8.0.120.0060.00317.01
8.0.110.0000.00716.97
8.0.100.0040.00416.96
8.0.90.0040.00416.99
8.0.80.0070.00717.14
8.0.70.0040.00416.97
8.0.60.0000.00717.06
8.0.50.0040.00417.08
8.0.30.0110.00817.30
8.0.20.0150.00717.40
8.0.10.0000.00717.25
8.0.00.0050.01416.81
7.4.330.0050.00016.73
7.4.320.0040.00416.68
7.4.300.0030.00316.57
7.4.290.0000.00716.48
7.4.280.0080.00416.56
7.4.270.0000.00716.50
7.4.260.0050.00013.27
7.4.250.0090.00016.47
7.4.240.0030.00316.59
7.4.230.0050.00316.66
7.4.220.0130.01216.68
7.4.210.0070.00816.64
7.4.200.0050.00216.61
7.4.190.0000.00716.50
7.4.160.0060.01116.42
7.4.150.0090.00917.40
7.4.140.0160.00817.86
7.4.130.0090.00916.65
7.4.120.0110.00716.69
7.4.110.0040.01416.78
7.4.100.0130.01016.91
7.4.90.0140.00716.67
7.4.80.0070.01419.39
7.4.70.0070.01416.70
7.4.60.0030.01316.66
7.4.50.0000.00816.43
7.4.40.0030.01622.77
7.4.30.0130.00316.43
7.4.00.0130.00414.98
7.3.330.0030.00313.42
7.3.320.0000.00613.49
7.3.310.0000.00816.61
7.3.300.0000.00716.42
7.3.290.0080.00816.53
7.3.280.0110.00416.45
7.3.270.0030.01417.40
7.3.260.0120.00918.24
7.3.250.0090.00816.56
7.3.240.0030.01316.41
7.3.230.0070.01016.53
7.3.210.0100.00616.46
7.3.200.0100.01019.39
7.3.190.0150.00816.59
7.3.180.0110.00716.62
7.3.170.0080.00816.55
7.3.160.0100.00716.52
7.3.120.0110.00515.09
7.3.110.0030.01114.71
7.3.100.0030.01014.96
7.3.90.0090.00914.83
7.3.80.0070.00714.82
7.3.70.0030.00615.02
7.3.60.0000.01414.74
7.3.50.0040.00814.88
7.3.40.0070.00714.87
7.3.30.0000.01015.06
7.3.20.0030.00816.70
7.3.10.0070.01116.37
7.3.00.0080.00816.47
7.2.330.0070.01116.75
7.2.320.0040.02016.82
7.2.310.0100.00716.55
7.2.300.0070.01016.51
7.2.290.0070.01016.58
7.2.250.0080.00815.09
7.2.240.0030.01614.92
7.2.230.0070.00615.12
7.2.220.0030.01715.13
7.2.210.0030.01315.34
7.2.200.0000.00915.12
7.2.190.0000.01114.97
7.2.180.0080.00414.67
7.2.170.0000.01415.22
7.2.130.0200.00616.58
7.2.120.0090.00916.62
7.2.110.0200.00316.88
7.2.100.0160.00316.73
7.2.90.0200.00016.69
7.2.80.0140.00916.46
7.2.70.0160.00216.18
7.2.60.0110.00616.65
7.2.50.0150.00616.70
7.2.40.0100.00516.29
7.2.30.0130.00716.36
7.2.20.0140.00016.51
7.2.10.0150.00416.59
7.2.00.0160.00316.73
7.1.330.0060.00915.97
7.1.320.0030.01315.42
7.1.310.0060.00315.73
7.1.300.0070.00715.50
7.1.290.0030.01215.61
7.1.280.0060.00315.80
7.1.270.0000.01215.80
7.1.260.0000.01215.71
7.1.250.0180.00815.50
7.1.200.0000.01115.72
7.1.70.0040.00417.09
7.1.60.0070.00317.12
7.1.50.0210.01434.92
7.1.00.0000.06022.41
7.0.200.0040.01216.54
7.0.140.0070.06322.09
7.0.100.0270.07019.86
7.0.90.0130.04719.88
7.0.80.0100.08319.90
7.0.70.0000.07719.89
7.0.60.0130.07019.94
7.0.50.0070.07720.30
7.0.40.0070.08020.10
7.0.30.0130.08020.06
7.0.20.0170.08020.08
7.0.10.0170.08019.94
7.0.00.0130.07319.99
5.6.280.0000.07721.04
5.6.250.0100.07320.71
5.6.240.0130.04020.64
5.6.230.0100.08320.64
5.6.220.0100.07320.62
5.6.210.0070.05020.52
5.6.200.0030.08021.01
5.6.190.0070.05021.07
5.6.180.0170.07320.96
5.6.170.0200.06721.13
5.6.160.0070.08720.99
5.6.150.0070.08021.00
5.6.140.0170.07321.04
5.6.130.0170.06021.13
5.6.120.0070.08320.97
5.6.110.0070.09020.96
5.6.100.0000.08321.08
5.6.90.0070.05020.88
5.6.80.0170.05320.30
5.6.70.0070.07320.38
5.6.60.0030.07720.49
5.6.50.0030.04320.45
5.6.40.0030.05720.26
5.6.30.0070.03720.27
5.6.20.0000.04320.37
5.6.10.0070.03320.36
5.6.00.0000.04020.40
5.5.380.0070.08320.37
5.5.370.0070.04320.27
5.5.360.0130.07720.32
5.5.350.0170.07720.34
5.5.340.0070.04720.69
5.5.330.0030.04720.76
5.5.320.0130.06020.69
5.5.310.0030.08020.84
5.5.300.0070.07720.79
5.5.290.0130.04020.87
5.5.280.0130.08320.75
5.5.270.0130.06320.83
5.5.260.0030.09020.82
5.5.250.0100.08020.60
5.5.240.0070.06320.25
5.5.230.0070.05720.26
5.5.220.0000.05320.22
5.5.210.0130.03020.15
5.5.200.0030.04019.95
5.5.190.0000.04320.12
5.5.180.0000.04320.10
5.5.160.0030.04720.08
5.5.150.0070.03320.09
5.5.140.0000.04020.10
5.5.130.0070.04020.22
5.5.120.0030.05720.13
5.5.110.0070.04020.07
5.5.100.0070.03720.07
5.5.90.0070.03720.00
5.5.80.0030.03319.96
5.5.70.0000.04320.10
5.5.60.0030.03720.01
5.5.50.0030.03720.04
5.5.40.0130.03020.09
5.5.30.0030.04720.00
5.5.20.0070.03720.00
5.5.10.0130.03019.99
5.5.00.0030.04020.10
5.4.450.0130.07019.51
5.4.440.0130.07319.27
5.4.430.0070.07719.45
5.4.420.0070.08019.27
5.4.410.0070.06719.07
5.4.400.0000.08319.26
5.4.390.0070.06719.12
5.4.380.0030.06319.05
5.4.370.0070.04018.96
5.4.360.0000.03719.14
5.4.350.0030.03319.03
5.4.340.0000.03718.91
5.4.320.0030.03718.87
5.4.310.0030.04318.90
5.4.300.0000.04319.04
5.4.290.0030.06319.13
5.4.280.0030.04719.11
5.4.270.0130.04019.23
5.4.260.0000.04018.87
5.4.250.0000.06319.11
5.4.240.0030.04019.09
5.4.230.0030.03719.16
5.4.220.0000.04719.12
5.4.210.0030.03319.12
5.4.200.0070.03319.15
5.4.190.0070.04719.20
5.4.180.0070.03319.17
5.4.170.0000.04019.22
5.4.160.0030.04019.21
5.4.150.0030.03718.82
5.4.140.0000.03716.13
5.4.130.0000.04016.37
5.4.120.0000.03316.25
5.4.110.0070.03016.52
5.4.100.0070.03316.47
5.4.90.0000.03316.49
5.4.80.0000.04016.34
5.4.70.0100.02716.50
5.4.60.0070.04016.31
5.4.50.0070.03016.33
5.4.40.0000.04016.45
5.4.30.0070.06716.39
5.4.20.0030.04016.46
5.4.10.0030.06716.39
5.4.00.0100.02715.84
5.3.290.0000.04714.64
5.3.280.0000.03714.73
5.3.270.0000.04014.73
5.3.260.0030.03714.58
5.3.250.0030.03714.71
5.3.240.0030.04014.55
5.3.230.0030.04014.65
5.3.220.0100.03014.62
5.3.210.0070.03314.59
5.3.200.0030.05014.52
5.3.190.0000.04014.57
5.3.180.0070.03314.64
5.3.170.0030.04314.62
5.3.160.0030.03714.70
5.3.150.0030.04014.55
5.3.140.0000.03314.67
5.3.130.0030.04014.68
5.3.120.0030.04014.43
5.3.110.0100.02714.51
5.3.100.0130.07013.97
5.3.90.0070.08014.05
5.3.80.0070.07014.16
5.3.70.0100.07014.01
5.3.60.0170.06313.91
5.3.50.0170.06713.84
5.3.40.0070.07014.00
5.3.30.0000.06014.00
5.3.20.0070.06313.69
5.3.10.0000.07013.68
5.3.00.0070.05013.66
5.2.170.0130.05011.24
5.2.160.0030.04011.16
5.2.150.0030.06311.14
5.2.140.0070.06311.27
5.2.130.0100.05710.98
5.2.120.0030.06010.98
5.2.110.0030.06310.96
5.2.100.0100.05311.02
5.2.90.0070.06010.96
5.2.80.0070.06311.20
5.2.70.0030.05711.09
5.2.60.0030.06711.11
5.2.50.0070.06311.03
5.2.40.0100.06011.09
5.2.30.0030.06310.97
5.2.20.0130.05311.02
5.2.10.0070.05711.00
5.2.00.0070.05710.70
5.1.60.0070.05010.11
5.1.50.0070.05010.03
5.1.40.0100.0479.98
5.1.30.0000.05710.20
5.1.20.0030.05710.34
5.1.10.0030.03310.19
5.1.00.0070.05310.15
5.0.50.0030.0478.58
5.0.40.0030.0438.44
5.0.30.0100.0608.21
5.0.20.0070.0308.29
5.0.10.0030.0438.24
5.0.00.0070.0678.22
4.4.90.0000.0407.57
4.4.80.0070.0337.57
4.4.70.0000.0407.57
4.4.60.0100.0207.57
4.4.50.0000.0377.57
4.4.40.0000.0337.57
4.4.30.0070.0307.57
4.4.20.0030.0237.57
4.4.10.0030.0237.57
4.4.00.0000.0537.57
4.3.110.0070.0207.57
4.3.100.0000.0337.57
4.3.90.0000.0237.57
4.3.80.0000.0577.57
4.3.70.0030.0337.57
4.3.60.0030.0307.57
4.3.50.0070.0277.57
4.3.40.0000.0537.57
4.3.30.0000.0377.57
4.3.20.0000.0337.57
4.3.10.0000.0377.57
4.3.00.0030.0337.57

preferences:
37.92 ms | 401 KiB | 5 Q