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.0120.00916.88
8.3.50.0140.00322.20
8.3.40.0130.01019.05
8.3.30.0040.01819.11
8.3.20.0070.00020.35
8.3.10.0080.00023.36
8.3.00.0070.00020.77
8.2.180.0090.00616.60
8.2.170.0070.00722.96
8.2.160.0030.01022.13
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00422.08
8.2.110.0090.00022.16
8.2.100.0040.00717.84
8.2.90.0040.00419.11
8.2.80.0000.00817.97
8.2.70.0030.00617.49
8.2.60.0060.00317.93
8.2.50.0030.00718.07
8.2.40.0090.00018.22
8.2.30.0040.00418.13
8.2.20.0000.00717.73
8.2.10.0030.00519.63
8.2.00.0060.00317.70
8.1.280.0110.00325.92
8.1.270.0050.00323.92
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00023.96
8.1.230.0080.00319.05
8.1.220.0080.00017.91
8.1.210.0060.00318.77
8.1.200.0090.00317.47
8.1.190.0040.00417.52
8.1.180.0060.00318.10
8.1.170.0030.00618.71
8.1.160.0050.00222.05
8.1.150.0030.00518.64
8.1.140.0040.00417.50
8.1.130.0000.00717.70
8.1.120.0040.00417.58
8.1.110.0000.00717.55
8.1.100.0030.00517.52
8.1.90.0000.00717.55
8.1.80.0030.00317.48
8.1.70.0030.00317.61
8.1.60.0000.00717.54
8.1.50.0050.00517.57
8.1.40.0040.00417.59
8.1.30.0040.00417.63
8.1.20.0020.00517.70
8.1.10.0100.00017.59
8.1.00.0040.00417.66
8.0.300.0040.00418.77
8.0.290.0040.00417.18
8.0.280.0030.00318.54
8.0.270.0050.00517.39
8.0.260.0000.00617.09
8.0.250.0000.00717.15
8.0.240.0050.00317.15
8.0.230.0030.00317.20
8.0.220.0040.00417.03
8.0.210.0000.00717.05
8.0.200.0030.00317.17
8.0.190.0000.00817.05
8.0.180.0000.00717.12
8.0.170.0040.00417.10
8.0.160.0040.00416.97
8.0.150.0070.00016.93
8.0.140.0000.00716.99
8.0.130.0030.00313.42
8.0.120.0080.00017.10
8.0.110.0040.00417.14
8.0.100.0040.00416.96
8.0.90.0040.00416.98
8.0.80.0110.00417.03
8.0.70.0070.00017.17
8.0.60.0040.00417.04
8.0.50.0040.00416.90
8.0.30.0090.01117.18
8.0.20.0070.01117.40
8.0.10.0080.00017.03
8.0.00.0110.00916.93
7.4.330.0030.00315.04
7.4.320.0060.00016.65
7.4.300.0030.00316.63
7.4.290.0070.00016.44
7.4.280.0000.00916.57
7.4.270.0000.00716.73
7.4.260.0000.00716.64
7.4.250.0090.00016.56
7.4.240.0010.00616.57
7.4.230.0070.00016.66
7.4.220.0000.01716.54
7.4.210.0060.00916.70
7.4.200.0000.00716.65
7.4.190.0030.00316.82
7.4.160.0100.00516.48
7.4.150.0120.00617.40
7.4.140.0150.00517.86
7.4.130.0080.00916.59
7.4.120.0080.00916.58
7.4.110.0100.00716.67
7.4.100.0100.01416.68
7.4.90.0140.00416.62
7.4.80.0130.00616.48
7.4.70.0100.01216.93
7.4.60.0080.00916.66
7.4.50.0040.00416.49
7.4.40.0070.00722.77
7.4.30.0130.00316.75
7.4.00.0060.01214.94
7.3.330.0020.00213.30
7.3.320.0000.00513.36
7.3.310.0080.00016.43
7.3.300.0030.00316.35
7.3.290.0130.00716.43
7.3.280.0080.00816.43
7.3.270.0100.00917.40
7.3.260.0110.00516.48
7.3.250.0100.01016.48
7.3.240.0120.00616.51
7.3.230.0030.01316.39
7.3.210.0120.00616.75
7.3.200.0100.01119.39
7.3.190.0030.01416.58
7.3.180.0120.00616.52
7.3.170.0120.01116.35
7.3.160.0080.00816.52
7.3.120.0030.01314.73
7.2.330.0090.00916.63
7.2.320.0090.00916.75
7.2.310.0030.01316.91
7.2.300.0030.01316.78
7.2.290.0060.01116.73
7.2.60.0110.00316.90
7.2.00.0060.00919.67
7.1.200.0080.00315.84
7.1.100.0060.00617.95
7.1.70.0000.01017.32
7.1.60.0060.01619.27
7.1.50.0070.00316.90
7.1.00.0030.07722.57
7.0.200.0080.00416.77
7.0.140.0070.07022.01
7.0.60.0070.08019.91
7.0.50.0030.07317.87
7.0.40.0030.08720.09
7.0.30.0170.04320.07
7.0.20.0300.07320.06
7.0.10.0070.04720.16
7.0.00.0030.04020.25
5.6.280.0070.07021.15
5.6.210.0130.06720.51
5.6.200.0070.05018.23
5.6.190.0100.08320.61
5.6.180.0230.05320.67
5.6.170.0170.04320.47
5.6.160.0130.07720.57
5.6.150.0030.05318.14
5.6.140.0000.04018.28
5.6.130.0170.07018.15
5.6.120.0000.08321.14
5.6.110.0130.07321.11
5.6.100.0130.05721.01
5.6.90.0200.07320.96
5.6.80.0070.07020.36
5.5.350.0270.03720.34
5.5.340.0070.04717.92
5.5.330.0100.07720.21
5.5.320.0070.05320.37
5.5.310.0230.05320.34
5.5.300.0130.07718.03
5.5.290.0100.08017.92
5.5.280.0100.08720.74
5.5.270.0170.07320.89
5.5.260.0100.05020.77
5.5.250.0070.08320.59
5.5.240.0000.08020.36
5.4.450.0530.06319.55
5.4.440.1230.07019.61
5.4.430.1100.05019.69
5.4.420.0570.06019.60
5.4.410.0130.05018.69
5.4.400.0370.04318.81
5.4.390.0330.05318.74
5.4.380.0130.05318.84
5.4.370.0030.04018.38
5.4.360.0000.04018.57
5.4.350.0070.04412.02
5.4.340.0060.03412.02
5.4.320.0050.03812.51
5.4.310.0070.04512.50
5.4.300.0060.03612.50
5.4.290.0050.04412.50
5.4.280.0060.04512.40
5.4.270.0020.04212.39
5.4.260.0090.04312.40
5.4.250.0070.03512.40
5.4.240.0060.03812.40
5.4.230.0070.03512.39
5.4.220.0120.03912.39
5.4.210.0070.03312.39
5.4.200.0080.04512.39
5.4.190.0210.04012.38
5.4.180.0400.07912.38
5.4.170.0160.04112.39
5.4.160.0150.04512.39
5.4.150.0110.04912.38
5.4.140.0150.04312.07
5.4.130.0140.04412.06
5.4.120.0140.04412.01
5.4.110.0110.04612.01
5.4.100.0150.04312.01
5.4.90.0190.03812.01
5.4.80.0390.07912.01
5.4.70.0120.04412.00
5.4.60.0140.04312.00
5.4.50.0130.04412.00
5.4.40.0100.04611.99
5.4.30.0180.04211.98
5.4.20.0140.04511.99
5.4.10.0170.03911.99
5.4.00.0330.08411.48
5.3.290.0130.03912.80
5.3.280.0030.04012.71
5.3.270.0180.04312.72
5.3.260.0180.04312.71
5.3.250.0140.04712.72
5.3.240.0160.04612.72
5.3.230.0180.04412.71
5.3.220.0150.04712.68
5.3.210.0150.04712.68
5.3.200.0370.08412.68
5.3.190.0170.04812.68
5.3.180.0170.04412.67
5.3.170.0150.04612.67
5.3.160.0170.04312.67
5.3.150.0440.07612.68
5.3.140.0150.04412.66
5.3.130.0220.04012.66
5.3.120.0160.04412.66
5.3.110.0140.04612.66
5.3.100.0240.06612.12
5.3.90.0150.04312.10
5.3.80.0170.04312.09
5.3.70.0160.04312.09
5.3.60.0130.04612.08
5.3.50.0190.04012.02
5.3.40.0310.05812.02
5.3.30.0180.04112.00
5.3.20.0130.04611.77
5.3.10.0170.04111.73
5.3.00.0190.03811.71
5.2.170.0150.0329.21
5.2.160.0200.0579.21
5.2.150.0150.0329.21
5.2.140.0180.0319.21
5.2.130.0120.0359.17
5.2.120.0150.0619.17
5.2.110.0130.0359.18
5.2.100.0140.0359.18
5.2.90.0160.0369.18
5.2.80.0140.0369.17
5.2.70.0140.0349.17
5.2.60.0120.0359.13
5.2.50.0150.0329.09
5.2.40.0110.0379.07
5.2.30.0110.0379.05
5.2.20.0090.0389.04
5.2.10.0110.0348.94
5.2.00.0120.0328.80
5.1.60.0170.0528.09
5.1.50.0110.0308.08
5.1.40.0100.0308.07
5.1.30.0140.0318.42
5.1.20.0130.0298.44
5.1.10.0100.0328.15
5.1.00.0130.0288.16
5.0.50.0110.0226.65
5.0.40.0100.0226.50
5.0.30.0100.0336.31
5.0.20.0120.0196.28
5.0.10.0070.0256.25
5.0.00.0080.0366.25
4.4.90.0080.0174.78
4.4.80.0080.0174.76
4.4.70.0060.0194.75
4.4.60.0060.0214.76
4.4.50.0070.0194.77
4.4.40.0090.0284.71
4.4.30.0110.0194.76
4.4.20.0270.0604.84
4.4.10.0060.0204.85
4.4.00.0110.0264.76
4.3.110.0060.0204.67
4.3.100.0090.0164.66
4.3.90.0090.0164.63
4.3.80.0230.0744.58
4.3.70.0050.0204.63
4.3.60.0070.0174.63
4.3.50.0070.0184.63
4.3.40.0060.0294.54
4.3.30.0040.0193.29
4.3.20.0050.0183.29
4.3.10.0060.0183.25
4.3.00.0170.0237.13

preferences:
54.38 ms | 401 KiB | 5 Q