3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Jenny's garden is one of the best in town, it has lush greens and colorful flowers. With what happened to her recently, she could use a new sprinkler system so that she does not have to over exert herself. Perhaps Joel can sell that extra bike to raise money or perhaps put up a garage sale."; $keyword = "garden"; $length = 136; if ($keyword != "") { $strpos = strpos($string, $keyword); $strStart = substr($string, $strpos - ($length / 2), $length / 2); $strEnd = substr($string, $strpos + strlen($keyword), $length / 2); $result = $strStart . $keyword . $strEnd; } else { $result = substr($string, 0, $length); } echo $result;

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.01316.38
8.3.50.0140.01021.95
8.3.40.0070.00718.73
8.3.30.0070.00719.04
8.3.20.0040.00420.33
8.3.10.0040.00423.62
8.3.00.0070.00417.46
8.2.180.0070.01016.63
8.2.170.0120.00822.96
8.2.160.0080.00520.43
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0070.00022.27
8.2.110.0040.00722.22
8.2.100.0040.00817.91
8.2.90.0000.00719.11
8.2.80.0080.00017.97
8.2.70.0050.00317.38
8.2.60.0030.00618.05
8.2.50.0030.00618.07
8.2.40.0000.00818.16
8.2.30.0000.00817.98
8.2.20.0000.00817.75
8.2.10.0070.00019.91
8.2.00.0050.00517.76
8.1.280.0110.00425.92
8.1.270.0080.00023.71
8.1.260.0020.00526.35
8.1.250.0070.00028.09
8.1.240.0030.00623.82
8.1.230.0090.00319.07
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0030.00617.22
8.1.190.0040.00417.28
8.1.180.0060.00318.10
8.1.170.0000.00818.57
8.1.160.0030.00521.89
8.1.150.0040.00418.64
8.1.140.0000.00717.46
8.1.130.0070.00017.76
8.1.120.0000.00717.46
8.1.110.0050.00217.45
8.1.100.0070.00017.48
8.1.90.0000.00717.45
8.1.80.0030.00317.50
8.1.70.0000.00717.46
8.1.60.0040.00417.61
8.1.50.0040.00417.52
8.1.40.0030.00517.48
8.1.30.0000.00817.63
8.1.20.0040.00417.65
8.1.10.0050.00217.39
8.1.00.0000.00817.51
8.0.300.0070.00018.77
8.0.290.0070.00017.16
8.0.280.0000.00818.45
8.0.270.0070.00017.36
8.0.260.0030.00317.14
8.0.250.0030.00316.98
8.0.240.0040.00416.97
8.0.230.0000.00817.03
8.0.220.0000.00716.83
8.0.210.0030.00316.90
8.0.200.0030.00316.86
8.0.190.0000.00817.00
8.0.180.0070.00016.96
8.0.170.0040.00416.81
8.0.160.0070.00016.77
8.0.150.0110.00016.74
8.0.140.0000.00716.87
8.0.130.0030.00313.33
8.0.120.0080.00016.93
8.0.110.0070.00016.78
8.0.100.0030.00516.90
8.0.90.0050.00216.94
8.0.80.0090.01216.83
8.0.70.0000.00716.95
8.0.60.0000.00716.86
8.0.50.0070.00016.80
8.0.30.0090.00917.00
8.0.20.0110.00817.40
8.0.10.0050.00216.88
8.0.00.0080.01116.83
7.4.330.0030.00315.00
7.4.320.0070.00016.57
7.4.300.0030.00316.45
7.4.290.0000.00716.54
7.4.280.0030.00616.43
7.4.270.0040.00416.66
7.4.260.0000.00716.43
7.4.250.0070.00016.57
7.4.240.0020.00516.54
7.4.230.0000.00616.59
7.4.220.0070.01116.58
7.4.210.0090.00616.65
7.4.200.0000.00716.70
7.4.190.0040.00416.71
7.4.160.0190.00416.59
7.4.150.0070.01417.40
7.4.140.0070.01017.86
7.4.130.0060.01116.61
7.4.120.0090.00816.41
7.4.110.0060.01016.44
7.4.100.0060.01316.53
7.4.90.0130.00316.59
7.4.80.0080.01219.39
7.4.70.0070.00716.60
7.4.60.0070.01016.33
7.4.50.0000.00816.59
7.4.40.0070.01022.77
7.4.30.0100.00716.37
7.4.10.0070.01115.25
7.4.00.0120.00514.88
7.3.330.0000.00613.01
7.3.320.0000.00512.93
7.3.310.0040.00316.20
7.3.300.0000.00716.10
7.3.290.0100.01016.26
7.3.280.0130.00616.27
7.3.270.0090.00917.40
7.3.260.0000.01716.27
7.3.250.0080.00916.38
7.3.240.0060.01016.25
7.3.230.0030.01416.39
7.3.210.0120.00316.52
7.3.200.0030.01616.38
7.3.190.0130.00916.32
7.3.180.0080.00816.56
7.3.170.0120.00316.53
7.3.160.0160.00016.54
7.3.130.0060.01314.79
7.3.120.0040.01314.60
7.3.110.0050.00914.76
7.3.100.0080.00714.78
7.3.90.0030.01014.75
7.3.80.0070.00314.79
7.3.70.0040.00914.57
7.3.60.0100.00314.68
7.3.50.0030.01014.49
7.3.40.0030.01214.77
7.3.30.0080.00514.63
7.3.20.0050.00716.75
7.3.10.0080.00716.63
7.3.00.0060.01016.66
7.2.330.0070.01116.76
7.2.320.0100.01016.61
7.2.310.0150.00616.69
7.2.300.0170.00016.51
7.2.290.0040.01216.68
7.2.260.0070.01414.95
7.2.250.0110.00715.27
7.2.240.0080.00515.11
7.2.230.0070.01115.28
7.2.220.0030.01014.90
7.2.210.0050.00815.00
7.2.200.0040.01114.82
7.2.190.0120.00114.98
7.2.180.0070.00815.08
7.2.170.0050.01015.09
7.2.160.0050.00814.87
7.2.150.0020.01316.96
7.2.140.0060.01016.91
7.2.130.0080.00716.85
7.2.120.0050.00916.86
7.2.110.0030.01016.97
7.2.100.0050.00816.81
7.2.90.0020.01216.82
7.2.80.0060.00917.04
7.2.70.0050.01116.96
7.2.60.0070.00616.90
7.2.50.0100.00316.88
7.2.40.0050.01016.90
7.2.30.0090.00516.99
7.2.20.0030.01216.89
7.2.10.0050.01016.87
7.2.00.0070.00917.77
7.1.330.0080.00515.74
7.1.320.0080.00815.86
7.1.310.0070.00515.64
7.1.300.0040.01115.73
7.1.290.0030.01015.83
7.1.280.0030.00815.61
7.1.270.0040.00915.81
7.1.260.0070.00615.77
7.1.250.0080.00615.76
7.1.240.0030.01015.80
7.1.230.0030.00715.81
7.1.220.0000.01415.84
7.1.210.0040.01115.70
7.1.200.0030.00715.78
7.1.190.0120.00416.00
7.1.180.0030.00915.93
7.1.170.0000.00815.75
7.1.160.0030.00715.79
7.1.150.0090.00615.96
7.1.140.0090.00316.01
7.1.130.0000.01515.71
7.1.120.0000.01515.80
7.1.110.0080.00415.79
7.1.100.0040.00916.97
7.1.90.0060.00915.61
7.1.80.0070.00715.96
7.1.70.0080.00516.63
7.1.60.0050.01317.61
7.1.50.0030.01316.45
7.1.40.0090.00315.89
7.1.30.0070.01015.87
7.1.20.0130.00015.83
7.1.10.0030.00615.84
7.1.00.0030.04519.20
7.0.330.0060.01015.39
7.0.320.0100.00315.27
7.0.310.0030.00915.57
7.0.300.0030.00715.45
7.0.290.0090.00315.57
7.0.280.0040.00815.43
7.0.270.0110.00015.41
7.0.260.0000.01115.24
7.0.250.0040.01215.55
7.0.240.0050.00515.25
7.0.230.0040.01115.25
7.0.220.0110.00615.56
7.0.210.0070.01015.48
7.0.200.0080.00316.09
7.0.190.0040.00815.57
7.0.180.0030.00915.29
7.0.170.0110.00315.31
7.0.160.0040.01115.25
7.0.150.0040.01115.38
7.0.140.0050.04118.88
7.0.130.0030.01415.45
7.0.120.0070.01015.20
7.0.110.0030.01315.50
7.0.100.0100.00015.34
7.0.90.0060.00615.27
7.0.80.0070.00715.48
7.0.70.0090.04118.66
7.0.60.0050.04718.65
7.0.50.0120.04018.82
7.0.40.0050.04216.87
7.0.30.0080.04016.75
7.0.20.0130.04016.68
7.0.10.0140.04116.72
7.0.00.0030.05016.72
5.6.400.0120.00314.23
5.6.390.0050.00514.33
5.6.380.0040.00414.59
5.6.370.0030.00514.50
5.6.360.0000.01014.07
5.6.350.0030.01013.84
5.6.340.0030.00914.31
5.6.330.0150.00014.08
5.6.320.0110.00414.12
5.6.310.0070.00714.14
5.6.300.0100.00314.55
5.6.290.0070.00414.61
5.6.280.0070.03817.63
5.6.270.0040.01514.44
5.6.260.0040.01114.45
5.6.250.0040.01114.27
5.6.240.0040.01414.31
5.6.230.0060.00914.25
5.6.220.0090.04017.48
5.6.210.0100.03317.40
5.6.200.0050.04617.75
5.6.190.0070.04617.67
5.6.180.0110.03817.70
5.6.170.0030.04917.60
5.6.160.0100.04017.72
5.6.150.0090.03617.53
5.6.140.0020.04217.77
5.6.130.0050.04717.55
5.6.120.0020.04517.77
5.6.110.0080.04117.65
5.6.100.0060.02817.66
5.6.90.0080.04317.89
5.6.80.0080.04317.26
5.6.70.0050.04017.51
5.6.60.0070.03317.23
5.6.50.0070.04717.39
5.6.40.0130.02917.20
5.6.30.0060.04417.21
5.6.20.0070.04417.27
5.6.10.0050.03817.26
5.6.00.0050.02417.38
5.5.380.0080.00614.26
5.5.370.0100.00314.29
5.5.360.0040.04117.27
5.5.350.0080.02617.24
5.5.340.0060.02817.57
5.5.330.0100.03317.62
5.5.320.0070.04517.44
5.5.310.0080.02817.53
5.5.300.0010.04517.58
5.5.290.0030.04917.68
5.5.280.0090.03217.63
5.5.270.0060.03517.67
5.5.260.0050.02817.40
5.5.250.0050.04917.35
5.5.240.0050.04117.22
5.5.230.0040.04217.32
5.5.220.0070.04417.01
5.5.210.0020.04717.18
5.5.200.0070.04217.09
5.5.190.0030.04417.32
5.5.180.0050.04017.27
5.5.170.0060.00614.23
5.5.160.0060.04117.28
5.5.150.0120.02717.31
5.5.140.0050.04117.08
5.5.130.0060.04517.11
5.5.120.0020.04417.20
5.5.110.0000.04517.26
5.5.100.0100.04017.25
5.5.90.0070.04417.08
5.5.80.0030.04017.17
5.5.70.0080.04317.26
5.5.60.0110.03516.96
5.5.50.0090.03617.07
5.5.40.0060.04116.99
5.5.30.0070.03417.30
5.5.20.0080.04517.18
5.5.10.0110.04017.01
5.5.00.0070.03317.06
5.4.450.0060.04315.45
5.4.440.0050.03415.58
5.4.430.0050.02715.49
5.4.420.0050.03815.58
5.4.410.0030.04015.46
5.4.400.0050.04315.29
5.4.390.0100.03715.34
5.4.380.0060.04315.37
5.4.370.0000.04515.37
5.4.360.0080.04215.32
5.4.350.0040.02915.33
5.4.340.0020.04015.21
5.4.330.0080.00311.61
5.4.320.0070.04015.29
5.4.310.0020.04215.33
5.4.300.0080.03615.36
5.4.290.0080.04215.25
5.4.280.0070.03315.34
5.4.270.0050.04015.34
5.4.260.0080.04015.33
5.4.250.0030.04315.28
5.4.240.0050.04015.28
5.4.230.0090.03615.38
5.4.220.0030.02515.21
5.4.210.0040.02315.30
5.4.200.0070.04015.34
5.4.190.0000.04715.28
5.4.180.0060.04015.33
5.4.170.0030.03915.20
5.4.160.0030.04415.32
5.4.150.0060.04115.32
5.4.140.0070.03913.97
5.4.130.0070.03513.95
5.4.120.0030.03313.94
5.4.110.0090.02913.91
5.4.100.0050.04013.97
5.4.90.0050.04014.03
5.4.80.0030.04014.02
5.4.70.0050.03814.01
5.4.60.0050.03413.96
5.4.50.0070.03613.95
5.4.40.0050.03213.95
5.4.30.0070.04014.00
5.4.20.0050.04213.89
5.4.10.0050.04513.90
5.4.00.0050.03713.66
5.3.290.0030.04113.12
5.3.280.0030.04313.09
5.3.270.0020.04413.04
5.3.260.0030.02613.04
5.3.250.0110.03513.07
5.3.240.0030.03813.04
5.3.230.0110.03713.08
5.3.220.0060.03313.07
5.3.210.0120.03413.08
5.3.200.0100.03813.00
5.3.190.0030.04013.01
5.3.180.0070.04213.00
5.3.170.0120.03313.08
5.3.160.0050.04213.02
5.3.150.0050.02613.08
5.3.140.0070.04013.08
5.3.130.0020.02613.03
5.3.120.0050.03513.08
5.3.110.0050.03013.03
5.3.100.0080.03912.75
5.3.90.0070.03712.73
5.3.80.0090.03512.81
5.3.70.0100.03512.82
5.3.60.0050.04212.80
5.3.50.0020.04212.77
5.3.40.0050.03712.70
5.3.30.0050.03812.73
5.3.20.0030.03012.63
5.3.10.0060.03312.56
5.3.00.0020.04312.58
5.2.170.0030.06712.25
5.2.160.0030.06012.25
5.2.150.0030.06312.25
5.2.140.0030.06712.25
5.2.130.0000.06012.25
5.2.120.0070.04712.25
5.2.110.0030.05312.25
5.2.100.0030.05012.25
5.2.90.0000.04712.25
5.2.80.0070.04712.25
5.2.70.0030.06312.25
5.2.60.0030.06012.25
5.2.50.0070.06312.25
5.2.40.0030.06312.25
5.2.30.0000.05312.25
5.2.20.0000.05712.25
5.2.10.0000.05712.25
5.2.00.0130.04312.25
5.1.60.0000.05312.25
5.1.50.0030.05712.25
5.1.40.0030.04012.25
5.1.30.0100.05012.25
5.1.20.0000.04312.25
5.1.10.0070.04312.25
5.1.00.0000.03012.25
5.0.50.0070.03012.25
5.0.40.0030.02712.25
5.0.30.0000.03312.25
5.0.20.0030.04012.25
5.0.10.0000.04012.25
5.0.00.0030.05712.25
4.4.90.0000.03012.25
4.4.80.0000.03712.25
4.4.70.0000.02712.25
4.4.60.0000.02312.25
4.4.50.0030.03312.25
4.4.40.0000.03712.25
4.4.30.0030.03312.25
4.4.20.0070.03312.25
4.4.10.0000.03312.25
4.4.00.0000.04312.25
4.3.110.0000.03712.25
4.3.100.0170.01712.25
4.3.90.0030.03312.25
4.3.80.0030.05312.25
4.3.70.0030.03312.25
4.3.60.0000.03712.25
4.3.50.0030.02712.25
4.3.40.0030.05012.25
4.3.30.0030.03012.25
4.3.20.0030.03712.25
4.3.10.0000.03012.25
4.3.00.0030.03012.25

preferences:
51.29 ms | 401 KiB | 5 Q