3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($str, $substr) { echo strpos(substr($str,1), $substr); return strpos(substr($str,1), $substr) == 0; } function test2($str, $substr) { return strpos($str, $substr) > 0; } $str = 'hello'; $sub = 'he'; var_dump( test($str, $sub), test2($str, $sub) ); ?>

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.01016.75
8.3.50.0080.00822.99
8.3.40.0120.00318.89
8.3.30.0030.01019.04
8.3.20.0070.00020.42
8.3.10.0080.00023.63
8.3.00.0040.00419.13
8.2.180.0120.00616.63
8.2.170.0120.00322.96
8.2.160.0070.00720.17
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00021.04
8.2.110.0030.00621.05
8.2.100.0070.00417.84
8.2.90.0090.00019.09
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0000.00818.04
8.2.50.0050.00318.10
8.2.40.0000.00818.16
8.2.30.0070.00017.95
8.2.20.0080.00017.68
8.2.10.0040.00418.06
8.2.00.0000.00817.67
8.1.280.0170.00325.92
8.1.270.0040.00423.92
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00022.19
8.1.230.0070.00417.83
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0050.00317.10
8.1.180.0000.00818.10
8.1.170.0040.00418.43
8.1.160.0040.00421.94
8.1.150.0030.00518.86
8.1.140.0070.00017.45
8.1.130.0000.00717.79
8.1.120.0000.00717.41
8.1.110.0040.00417.36
8.1.100.0000.00717.32
8.1.90.0000.00717.48
8.1.80.0040.00417.50
8.1.70.0000.00717.33
8.1.60.0040.00417.45
8.1.50.0000.00817.52
8.1.40.0000.00817.57
8.1.30.0040.00417.61
8.1.20.0000.00717.65
8.1.10.0000.00717.54
8.1.00.0070.00017.39
8.0.300.0060.00318.77
8.0.290.0080.00016.63
8.0.280.0040.00418.50
8.0.270.0000.00717.29
8.0.260.0030.00317.17
8.0.250.0040.00316.86
8.0.240.0030.00316.96
8.0.230.0030.00316.82
8.0.220.0070.00016.91
8.0.210.0000.00716.88
8.0.200.0060.00016.95
8.0.190.0000.00716.91
8.0.180.0040.00416.98
8.0.170.0000.00816.90
8.0.160.0040.00416.90
8.0.150.0050.00416.75
8.0.140.0030.00716.84
8.0.130.0030.00313.29
8.0.120.0060.00316.79
8.0.110.0000.00716.88
8.0.100.0050.00216.83
8.0.90.0090.00016.83
8.0.80.0090.00916.84
8.0.70.0000.00816.94
8.0.60.0000.00716.79
8.0.50.0000.00716.80
8.0.30.0100.00817.30
8.0.20.0140.00617.40
8.0.10.0000.00817.04
8.0.00.0100.01116.89
7.4.330.0050.00015.21
7.4.320.0060.00016.60
7.4.300.0000.00716.52
7.4.290.0000.00716.57
7.4.280.0000.00716.62
7.4.270.0040.00416.61
7.4.260.0090.00016.61
7.4.250.0030.00516.54
7.4.240.0050.00216.60
7.4.230.0040.00416.35
7.4.220.0090.00916.45
7.4.210.0060.00916.62
7.4.200.0070.00016.42
7.4.160.0100.00616.31
7.4.150.0140.00617.40
7.4.140.0120.00717.86
7.4.130.0110.00716.60
7.4.120.0050.01216.49
7.4.110.0070.01016.58
7.4.100.0060.01116.63
7.4.90.0100.00716.61
7.4.80.0130.00319.39
7.4.70.0140.00316.54
7.4.60.0070.01016.44
7.4.50.0040.00016.24
7.4.40.0000.01616.57
7.4.30.0120.00616.41
7.4.00.0080.00815.19
7.3.330.0050.00013.17
7.3.320.0050.00013.13
7.3.310.0040.00416.14
7.3.300.0070.00016.23
7.3.290.0150.00416.32
7.3.280.0110.00416.27
7.3.270.0110.00817.40
7.3.260.0080.01016.35
7.3.250.0090.01016.44
7.3.240.0090.00616.35
7.3.230.0100.00616.51
7.3.210.0120.00816.17
7.3.200.0070.01619.39
7.3.190.0100.01016.27
7.3.180.0110.00416.37
7.3.170.0000.01716.48
7.3.160.0090.00616.45
7.2.330.0100.00716.66
7.2.320.0100.00716.46
7.2.310.0170.00716.44
7.2.300.0100.00716.38
7.2.290.0090.00916.63
7.2.00.0000.01319.30
7.1.100.0040.00718.09
7.1.70.0000.00917.21
7.1.60.0140.01119.46
7.1.50.0110.00716.79
7.1.00.0030.07722.48
7.0.200.0030.00316.71
7.0.140.0000.07722.05
7.0.60.0000.04320.01
7.0.50.0070.09017.86
7.0.40.0070.04020.10
7.0.30.0300.08020.21
7.0.20.0330.06720.10
7.0.10.0030.06020.18
7.0.00.0130.07720.20
5.6.280.0130.06321.15
5.6.210.0230.05020.55
5.6.200.0100.04718.19
5.6.190.0030.05720.54
5.6.180.0470.06720.48
5.6.170.0270.08020.48
5.6.160.0030.04320.51
5.6.150.0130.03718.29
5.6.140.0070.07018.15
5.6.130.0070.04318.26
5.6.120.0130.04020.81
5.6.110.0100.06721.15
5.6.100.0130.05320.89
5.6.90.0030.05321.01
5.6.80.0000.08020.36
5.5.350.0300.07320.48
5.5.340.0030.06718.04
5.5.330.0130.07720.28
5.5.320.0330.04020.27
5.5.310.0300.04720.36
5.5.300.0000.06018.03
5.5.290.0100.07717.99
5.5.280.0030.08320.87
5.5.270.0030.08720.86
5.5.260.0030.04320.89
5.5.250.0070.03720.75
5.5.240.0200.06020.23
5.4.450.0030.03719.48
5.4.440.0300.05019.42
5.4.430.0400.04719.20
5.4.420.0500.04319.54
5.4.410.0430.03719.38
5.4.400.0370.04018.88
5.4.390.0370.03318.95
5.4.380.0530.07718.89
5.4.370.0270.06018.69
5.4.360.0370.04318.56
5.4.350.0400.04318.63
5.4.340.0270.05018.59
5.4.320.0100.04912.50
5.4.310.0030.04212.50
5.4.300.0050.03912.51
5.4.290.0060.03812.50
5.4.280.0060.03512.40
5.4.270.0030.04012.40
5.4.260.0060.03812.40
5.4.250.0070.03712.40
5.4.240.0030.04212.40
5.4.230.0050.03912.39
5.4.220.0070.03612.39
5.4.210.0050.03612.39
5.4.200.0090.03312.39
5.4.190.0060.03612.38
5.4.180.0060.03612.38
5.4.170.0090.03712.39
5.4.160.0050.03612.39
5.4.150.0100.03912.38
5.4.140.0080.03512.07
5.4.130.0060.03512.06
5.4.120.0060.04012.02
5.4.110.0050.03712.01
5.4.100.0050.03512.02
5.4.90.0050.03712.02
5.4.80.0070.03512.01
5.4.70.0060.03412.01
5.4.60.0050.03912.01
5.4.50.0090.03212.01
5.4.40.0070.03412.00
5.4.30.0100.03211.99
5.4.20.0070.03512.00
5.4.10.0040.03712.00
5.4.00.0030.03811.48
5.3.290.0080.03812.80
5.3.280.0070.03612.71
5.3.270.0060.03812.72
5.3.260.0040.04012.72
5.3.250.0090.04212.72
5.3.240.0070.04012.72
5.3.230.0070.03712.71
5.3.220.0050.04512.68
5.3.210.0040.04012.68
5.3.200.0070.03612.68
5.3.190.0080.03512.68
5.3.180.0060.03612.67
5.3.170.0070.03712.66
5.3.160.0090.03512.67
5.3.150.0070.03612.68
5.3.140.0040.03712.66
5.3.130.0070.03712.66
5.3.120.0050.04112.66
5.3.110.0060.04612.66
5.3.100.0080.03512.12
5.3.90.0060.03612.11
5.3.80.0060.03712.10
5.3.70.0110.03212.10
5.3.60.0050.03712.08
5.3.50.0050.03712.03
5.3.40.0050.03712.03
5.3.30.0070.03511.98
5.3.20.0060.03511.77
5.3.10.0060.03411.73
5.3.00.0050.03611.72
5.2.170.0020.0329.22
5.2.160.0070.0269.23
5.2.150.0050.0299.23
5.2.140.0050.0299.22
5.2.130.0050.0289.18
5.2.120.0060.0279.18
5.2.110.0050.0289.18
5.2.100.0070.0329.18
5.2.90.0060.0399.18
5.2.80.0040.0379.17
5.2.70.0050.0309.17
5.2.60.0060.0379.13
5.2.50.0050.0339.10
5.2.40.0040.0299.08
5.2.30.0030.0319.05
5.2.20.0050.0289.04
5.2.10.0060.0268.95
5.2.00.0040.0298.80
5.1.60.0050.0228.09
5.1.50.0050.0238.09
5.1.40.0040.0248.07
5.1.30.0040.0268.42
5.1.20.0060.0258.44
5.1.10.0050.0258.17
5.1.00.0040.0298.17
5.0.50.0040.0196.65
5.0.40.0030.0196.50
5.0.30.0020.0326.32
5.0.20.0040.0186.28
5.0.10.0020.0216.26
5.0.00.0030.0316.25
4.4.90.0060.0154.78
4.4.80.0070.0214.75
4.4.70.0030.0224.75
4.4.60.0020.0224.75
4.4.50.0050.0134.77
4.4.40.0030.0244.70
4.4.30.0000.0194.75
4.4.20.0040.0144.85
4.4.10.0030.0154.85
4.4.00.0040.0234.76
4.3.110.0040.0164.67
4.3.100.0060.0184.67
4.3.90.0020.0214.63
4.3.80.0020.0294.59
4.3.70.0040.0154.63
4.3.60.0040.0174.63
4.3.50.0020.0164.63
4.3.40.0010.0254.53
4.3.30.0030.0153.31
4.3.20.0020.0153.28
4.3.10.0010.0163.25
4.3.00.0000.02018.23

preferences:
46.69 ms | 401 KiB | 5 Q