3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "blah 2015 yar"; $pos = strpos($string, "20"); $year = substr($string, $pos, 4); echo $year . "<br />\n"; $end_year = "12/31/" . $year; echo $end_year; $end_time = new DateTime($end_year); $start_time = new DateTime(); $diff = $end_time->diff($start_time); var_dump($diff); ?>

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.0.110.0000.00816.94
8.0.100.0000.00717.13
8.0.90.0070.00016.93
8.0.80.0060.00917.11
8.0.70.0070.00017.11
8.0.60.0070.00017.16
8.0.50.0040.00416.97
8.0.30.0050.01817.10
8.0.20.0090.01017.40
8.0.10.0000.00717.20
8.0.00.0150.00316.96
7.4.240.0010.00616.66
7.4.230.0000.00816.70
7.4.220.0100.01016.71
7.4.210.0100.00316.73
7.4.200.0070.00016.57
7.4.160.0140.00416.64
7.4.150.0090.00917.40
7.4.140.0120.01017.86
7.4.130.0100.00716.61
7.4.120.0110.01016.54
7.4.110.0040.01316.50
7.4.100.0110.00716.48
7.4.90.0140.00616.48
7.4.80.0060.01716.73
7.4.70.0150.00316.52
7.4.60.0100.00716.49
7.4.50.0050.00316.45
7.4.40.0070.01016.71
7.4.30.0090.01216.60
7.4.00.0060.01014.92
7.3.300.0040.00416.32
7.3.290.0100.01016.37
7.3.280.0070.00916.34
7.3.270.0090.00917.40
7.3.260.0070.01216.68
7.3.250.0070.01316.55
7.3.240.0060.01816.71
7.3.230.0120.00916.54
7.3.210.0050.01416.36
7.3.200.0110.01219.39
7.3.190.0130.01016.38
7.3.180.0070.01016.64
7.3.170.0070.01116.57
7.3.160.0070.01316.56
7.2.330.0080.01216.79
7.2.320.0060.01216.86
7.2.310.0090.01216.64
7.2.300.0090.00916.75
7.2.290.0060.01116.97
7.2.60.0140.01116.94
7.1.200.0110.00715.98
7.1.100.0030.01218.36
7.1.70.0000.00817.17
7.1.60.0170.00719.32
7.1.50.0070.00317.04
7.1.00.0030.07722.50
7.0.200.0040.00417.00
7.0.140.0030.07321.98
7.0.60.0030.08019.86
7.0.50.0100.03717.66
7.0.40.0130.07719.84
7.0.30.0230.08720.16
7.0.20.0170.06020.17
7.0.10.0270.07320.00
7.0.00.0070.04020.20
5.6.280.0070.07021.12
5.6.210.0130.07720.51
5.6.200.0130.08318.16
5.6.190.0070.04020.66
5.6.180.0130.08020.29
5.6.170.0300.05020.52
5.6.160.0100.07720.50
5.6.150.0130.06718.18
5.6.140.0070.08018.07
5.6.130.0030.08318.18
5.6.120.0100.04320.98
5.6.110.0100.08320.89
5.6.100.0100.08021.10
5.6.90.0070.04720.99
5.6.80.0100.03720.39
5.5.350.0000.03320.38
5.5.340.0070.04718.01
5.5.330.0030.04020.15
5.5.320.0070.08020.13
5.5.310.0300.05020.21
5.5.300.0100.07717.89
5.5.290.0070.03717.98
5.5.280.0100.08020.87
5.5.270.0000.04320.95
5.5.260.0030.04720.79
5.5.250.0100.06320.61
5.5.240.0070.07320.04
5.4.450.0170.05719.64
5.4.440.0500.06319.41
5.4.430.0570.05719.60
5.4.420.0300.04319.27
5.4.410.0530.06319.41
5.4.400.0330.06018.81
5.4.390.0170.04718.81
5.4.380.0400.06018.69
5.4.370.0370.06318.50
5.4.360.0330.05318.74
5.4.350.0300.07718.50
5.4.340.0430.07018.68
5.4.320.0040.03712.46
5.4.310.0020.04212.46
5.4.300.0060.03712.46
5.4.290.0080.03712.45
5.4.280.0070.03512.35
5.4.270.0070.03512.35
5.4.260.0060.03912.35
5.4.250.0080.03512.35
5.4.240.0070.03512.35
5.4.230.0030.04512.34
5.4.220.0030.04212.34
5.4.210.0040.04112.34
5.4.200.0070.03712.34
5.4.190.0050.03912.34
5.4.180.0040.03912.34
5.4.170.0050.03712.35
5.4.160.0040.03712.35
5.4.150.0060.03512.34
5.4.140.0070.03612.03
5.4.130.0070.03312.01
5.4.120.0060.03511.97
5.4.110.0080.03311.97
5.4.100.0080.03311.97
5.4.90.0050.03811.96
5.4.80.0080.03511.96
5.4.70.0050.04611.96
5.4.60.0090.04111.97
5.4.50.0060.03511.96
5.4.40.0090.03211.95
5.4.30.0060.03411.95
5.4.20.0040.03711.95
5.4.10.0040.03511.95
5.4.00.0070.03411.43
5.3.290.0070.03812.80
5.3.280.0090.03512.71
5.3.270.0090.03512.73
5.3.260.0080.03712.72
5.3.250.0090.03512.72
5.3.240.0080.03612.72
5.3.230.0060.03912.71
5.3.220.0050.03812.68
5.3.210.0060.03912.68
5.3.200.0060.03612.68
5.3.190.0040.03912.68
5.3.180.0070.03612.67
5.3.170.0040.03912.67
5.3.160.0040.03812.67
5.3.150.0070.03612.68
5.3.140.0070.03512.66
5.3.130.0080.03712.66
5.3.120.0040.04112.65
5.3.110.0110.03512.66
5.3.100.0060.03712.12
5.3.90.0070.03412.08
5.3.80.0070.03512.07
5.3.70.0040.03812.08
5.3.60.0060.03612.07
5.3.50.0070.03512.00
5.3.40.0070.03512.00
5.3.30.0040.03611.95
5.3.20.0040.03711.73
5.3.10.0070.03311.69
5.3.00.0040.03811.68
5.2.170.0070.0289.18
5.2.160.0060.0369.19
5.2.150.0040.0319.18
5.2.140.0040.0349.18
5.2.130.0060.0289.14
5.2.120.0120.0239.14
5.2.110.0070.0269.15
5.2.100.0040.0299.15
5.2.90.0040.0289.14
5.2.80.0030.0329.14
5.2.70.0050.0319.14
5.2.60.0060.0289.09
5.2.50.0060.0289.07
5.2.40.0030.0309.04
5.2.30.0050.0289.02
5.2.20.0050.0279.01
5.2.10.0040.0288.93
5.2.00.0030.0308.79
5.1.60.0020.0268.07
5.1.50.0020.0268.07
5.1.40.0040.0248.05
5.1.30.0030.0278.40
5.1.20.0020.0298.42
5.1.10.0040.0268.14
5.1.00.0040.0258.14
5.0.50.0010.0236.62
5.0.40.0030.0196.48
5.0.30.0050.0296.29
5.0.20.0050.0266.27
5.0.10.0040.0186.24
5.0.00.0020.0316.24
4.4.90.0050.0144.78
4.4.80.0000.0174.75
4.4.70.0050.0124.75
4.4.60.0030.0154.75
4.4.50.0030.0154.77
4.4.40.0050.0294.71
4.4.30.0020.0224.76
4.4.20.0030.0204.84
4.4.10.0030.0194.85
4.4.00.0020.0254.76
4.3.110.0040.0144.67
4.3.100.0030.0164.66
4.3.90.0020.0184.63
4.3.80.0030.0234.59
4.3.70.0020.0144.63
4.3.60.0050.0114.63
4.3.50.0000.0194.63
4.3.40.0050.0234.54
4.3.30.0020.0203.29
4.3.20.0020.0203.26
4.3.10.0010.0183.22
4.3.00.0030.0237.52

preferences:
31.44 ms | 401 KiB | 5 Q