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 = "recently"; $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.0030.01316.50
8.3.50.0090.00917.36
8.3.40.0090.00618.63
8.3.30.0140.00418.59
8.3.20.0110.00418.82
8.3.10.0000.00818.65
8.3.00.0040.00419.24
8.2.180.0120.00418.54
8.2.170.0090.00622.96
8.2.160.0040.01119.00
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0100.00326.16
8.2.120.0050.00321.00
8.2.110.0090.00022.29
8.2.100.0080.00417.78
8.2.90.0000.00817.75
8.2.80.0060.00318.72
8.2.70.0060.00317.48
8.2.60.0060.00317.50
8.2.50.0060.00317.80
8.2.40.0040.00419.48
8.2.30.0040.00417.61
8.2.20.0070.00417.54
8.2.10.0020.00517.68
8.2.00.0050.00317.66
8.1.280.0160.00025.92
8.1.270.0040.00423.99
8.1.260.0140.00426.35
8.1.250.0080.00028.09
8.1.240.0050.00519.57
8.1.230.0040.00820.66
8.1.220.0030.00518.56
8.1.210.0000.00918.77
8.1.200.0060.00317.35
8.1.190.0040.00417.35
8.1.180.0030.00618.10
8.1.170.0040.00417.62
8.1.160.0040.00419.07
8.1.150.0000.00718.58
8.1.140.0040.00417.51
8.1.130.0040.00419.14
8.1.120.0040.00417.48
8.1.110.0000.00717.36
8.1.100.0050.00317.46
8.1.90.0000.00717.50
8.1.80.0000.00717.45
8.1.70.0030.00317.43
8.1.60.0000.00817.59
8.1.50.0040.00417.48
8.1.40.0070.00317.49
8.1.30.0060.00317.65
8.1.20.0000.00817.71
8.1.10.0000.00817.57
8.1.00.0000.00717.30
8.0.300.0000.00718.77
8.0.290.0040.00416.93
8.0.280.0070.00018.49
8.0.270.0000.00817.28
8.0.260.0030.00316.75
8.0.250.0000.00716.89
8.0.240.0020.00516.95
8.0.230.0000.00716.85
8.0.220.0000.00716.85
8.0.210.0000.00816.88
8.0.200.0000.00616.95
8.0.190.0000.00716.98
8.0.180.0000.00816.83
8.0.170.0080.00016.68
8.0.160.0070.00016.79
8.0.150.0040.00416.74
8.0.140.0000.00716.84
8.0.130.0030.00313.31
8.0.120.0030.00616.89
8.0.110.0030.00516.96
8.0.100.0000.00816.80
8.0.90.0000.00716.85
8.0.80.0040.01216.87
8.0.70.0040.00416.96
8.0.60.0080.00016.78
8.0.50.0000.00816.92
8.0.30.0030.01317.38
8.0.20.0080.01217.11
8.0.10.0070.00016.92
8.0.00.0110.00716.71
7.4.330.0000.00612.99
7.4.320.0060.00016.62
7.4.300.0000.00616.48
7.4.290.0030.00616.50
7.4.280.0030.00616.64
7.4.270.0030.00316.57
7.4.260.0000.00513.27
7.4.250.0000.00816.40
7.4.240.0070.00016.65
7.4.230.0000.00816.32
7.4.220.0060.01216.41
7.4.210.0040.01116.37
7.4.200.0000.00716.36
7.4.190.0000.00716.55
7.4.160.0130.00416.41
7.4.150.0300.02016.29
7.4.140.0070.01516.43
7.4.130.0080.00816.51
7.4.120.0150.00316.43
7.4.110.0060.01216.55
7.4.100.0060.01016.54
7.4.90.0070.01416.40
7.4.80.0100.00619.39
7.4.70.0100.00616.45
7.4.60.0060.01016.40
7.4.50.0030.00316.23
7.4.40.0100.00316.21
7.4.30.0110.00716.49
7.4.00.0030.01414.76
7.3.330.0040.00313.11
7.3.320.0060.00013.09
7.3.310.0030.00316.36
7.3.300.0060.00316.22
7.3.290.0070.00716.18
7.3.280.0100.00916.24
7.3.270.0030.01316.32
7.3.260.0070.01316.30
7.3.250.0150.00616.37
7.3.240.0100.00716.41
7.3.230.0120.00916.21
7.3.210.0080.01016.35
7.3.200.0090.00816.23
7.3.190.0090.01216.50
7.3.180.0080.00716.25
7.3.170.0030.01316.38
7.3.160.0080.00916.38
7.3.120.0090.00614.65
7.3.10.0070.00716.68
7.3.00.0080.00416.69
7.2.330.0150.00316.80
7.2.320.0150.00616.70
7.2.310.0100.01316.39
7.2.300.0100.01316.60
7.2.290.0030.01516.58
7.2.130.0110.00416.74
7.2.120.0060.00916.89
7.2.110.0100.00317.04
7.2.100.0060.00916.99
7.2.90.0080.00416.80
7.2.80.0100.00616.76
7.2.70.0000.00916.69
7.2.60.0040.01216.87
7.2.50.0090.00616.82
7.2.40.0100.00616.84
7.2.30.0060.00616.76
7.2.20.0060.00317.03
7.2.10.0060.00916.88
7.2.00.0000.01118.25
7.1.250.0070.00415.84
7.1.200.0060.00915.82
7.1.100.0050.00318.12
7.1.70.0050.00217.38
7.1.60.0130.01019.30
7.1.50.0070.01117.08
7.1.00.0030.07022.34
7.0.200.0000.00816.66
7.0.140.0100.03721.95
7.0.120.0000.04322.06
7.0.60.0130.07020.05
7.0.50.0130.06717.78
7.0.40.0100.03720.09
7.0.30.0330.04320.17
7.0.20.0270.07720.30
7.0.10.0030.05720.30
7.0.00.0070.05020.00
5.6.280.0070.06721.09
5.6.210.0130.05720.69
5.6.200.0030.06318.18
5.6.190.0030.04320.34
5.6.180.0470.07320.63
5.6.170.0470.06020.33
5.6.160.0170.07320.48
5.6.150.0070.07318.18
5.6.140.0030.05318.19
5.6.130.0030.04318.06
5.6.120.0200.07320.89
5.6.110.0030.05020.96
5.6.100.0230.06721.10
5.6.90.0030.05321.07
5.6.80.0030.04020.38
5.5.350.0330.07320.46
5.5.340.0030.08018.00
5.5.330.0100.08720.21
5.5.320.0400.05320.19
5.5.310.0100.05320.26
5.5.300.0030.08318.02
5.5.290.0100.07717.91
5.5.280.0030.05720.87
5.5.270.0070.07320.94
5.5.260.0070.08020.84
5.5.250.0070.05320.59
5.5.240.0070.07320.27
5.4.450.0700.03719.25
5.4.440.0500.04319.43
5.4.430.0700.03319.27
5.4.420.0770.03719.39
5.4.410.0200.04319.33
5.4.400.0630.03719.11
5.4.390.0730.04319.18
5.4.380.0500.05319.11
5.4.370.0370.04019.15
5.4.360.0630.04318.83
5.4.350.0300.04718.99
5.4.340.0370.04718.87
5.4.320.0330.04319.09
5.4.310.0500.03019.04
5.4.300.0570.03719.17
5.4.290.0470.05018.94
5.4.280.0570.02719.04
5.4.270.0630.03318.92
5.4.260.0470.04319.10
5.4.250.0370.04018.86
5.4.240.0670.03318.93
5.4.230.0370.04019.13
5.4.220.0200.04718.82
5.4.210.0600.03018.91
5.4.200.0570.04719.09
5.4.190.0630.03018.70
5.4.180.0400.04019.12
5.4.170.0670.04018.93
5.4.160.0670.02718.72
5.4.150.0770.03718.79
5.4.140.0700.04016.31
5.4.130.0630.03716.25
5.4.120.0570.04316.37
5.4.110.0530.04316.41
5.4.100.0670.03016.37
5.4.90.0470.03016.48
5.4.80.0830.02716.36
5.4.70.0370.03016.41
5.4.60.0470.03316.27
5.4.50.0730.03316.40
5.4.40.0430.03316.03
5.4.30.0430.04016.25
5.4.20.0500.04716.44
5.4.10.1000.03016.43
5.4.00.0670.04315.72
5.3.290.0330.04014.60
5.3.280.0430.03014.54
5.3.270.0430.04314.45
5.3.260.0730.03014.61
5.3.250.0700.04014.70
5.3.240.0730.03314.70
5.3.230.0470.05314.45
5.3.220.0200.04714.60
5.3.210.0430.03714.41
5.3.200.0370.04014.41
5.3.190.0300.03714.55
5.3.180.0770.03014.40
5.3.170.0670.03714.58
5.3.160.0400.02714.39
5.3.150.0530.03714.61
5.3.140.0570.03314.43
5.3.130.0530.04014.50
5.3.120.0600.05714.39
5.3.110.0500.04714.42
5.3.100.0800.05014.08
5.3.90.0770.03713.96
5.3.80.0330.03013.97
5.3.70.0570.02713.87
5.3.60.0730.05713.84
5.3.50.0700.04313.85
5.3.40.0670.04013.79
5.3.30.0570.03713.73
5.3.20.0800.03013.73
5.3.10.0670.06013.50
5.3.00.0770.03713.41
5.2.170.0370.03311.06
5.2.160.0430.02311.20
5.2.150.0830.03010.99
5.2.140.0500.04711.00
5.2.130.0730.04011.04
5.2.120.0600.03311.06
5.2.110.0500.03011.11
5.2.100.0670.02010.95
5.2.90.0400.03010.93
5.2.80.0670.03710.98
5.2.70.0870.02710.95
5.2.60.0330.04311.10
5.2.50.0530.03011.04
5.2.40.0200.02311.00
5.2.30.0170.04010.98
5.2.20.0600.02011.11
5.2.10.0600.03310.82
5.2.00.0600.02710.62
5.1.60.0470.02010.00
5.1.50.0630.0409.89
5.1.40.0770.0209.96
5.1.30.0530.03310.24
5.1.20.0370.04310.43
5.1.10.0470.02310.00
5.1.00.0300.02010.18
5.0.50.0100.0208.47
5.0.40.0000.0178.38
5.0.30.0100.0278.38
5.0.20.0330.0108.32
5.0.10.0230.0138.29
5.0.00.0170.0308.28
4.4.90.0330.0139.60
4.4.80.0430.0109.59
4.4.70.0000.0179.58
4.4.60.0030.0279.58
4.4.50.0300.0109.58
4.4.40.0100.0338.57
4.4.30.0330.0178.45
4.4.20.0100.0138.40
4.4.10.0100.0378.39
4.4.00.0100.0338.39
4.3.110.0100.0208.38
4.3.100.0170.0178.32
4.3.90.0200.0108.32
4.3.80.0330.0238.28
4.3.70.0270.0108.28
4.3.60.0130.0138.27
4.3.50.0330.0038.27
4.3.40.0170.0208.27
4.3.30.0070.0178.27
4.3.20.0030.0138.21
4.3.10.0000.0238.20
4.3.00.0000.0138.20

preferences:
48.85 ms | 401 KiB | 5 Q