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.0040.01116.63
8.3.50.0090.00622.82
8.3.40.0150.00018.70
8.3.30.0100.00319.04
8.3.20.0070.00020.16
8.3.10.0000.00823.61
8.3.00.0080.00019.26
8.2.180.0040.01116.48
8.2.170.0110.00422.96
8.2.160.0040.00920.28
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00020.98
8.2.110.0030.00620.96
8.2.100.0060.00617.72
8.2.90.0050.00319.15
8.2.80.0060.00317.97
8.2.70.0060.00617.63
8.2.60.0000.00918.05
8.2.50.0000.00818.10
8.2.40.0030.00618.03
8.2.30.0070.00017.99
8.2.20.0030.00517.61
8.2.10.0040.00417.89
8.2.00.0040.00417.69
8.1.280.0100.01025.92
8.1.270.0000.00823.82
8.1.260.0030.00326.35
8.1.250.0040.00428.09
8.1.240.0070.01122.23
8.1.230.0080.00417.76
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0000.00917.23
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0000.00818.50
8.1.160.0020.00522.00
8.1.150.0070.00018.77
8.1.140.0050.00317.38
8.1.130.0030.00317.82
8.1.120.0070.00017.36
8.1.110.0040.00417.48
8.1.100.0040.00417.41
8.1.90.0040.00417.48
8.1.80.0040.00417.48
8.1.70.0030.00317.41
8.1.60.0040.00417.48
8.1.50.0050.00317.47
8.1.40.0030.00517.44
8.1.30.0040.00417.48
8.1.20.0000.00717.65
8.1.10.0040.00417.50
8.1.00.0040.00417.46
8.0.300.0070.00018.77
8.0.290.0050.00316.63
8.0.280.0030.00318.34
8.0.270.0000.00717.25
8.0.260.0060.00017.27
8.0.250.0070.00016.87
8.0.240.0030.00316.95
8.0.230.0030.00317.01
8.0.220.0030.00316.86
8.0.210.0040.00416.92
8.0.200.0000.00616.92
8.0.190.0000.00716.99
8.0.180.0040.00416.91
8.0.170.0040.00416.94
8.0.160.0030.00516.83
8.0.150.0060.00316.89
8.0.140.0050.00516.84
8.0.130.0000.00613.34
8.0.120.0000.00816.79
8.0.110.0080.00016.88
8.0.100.0000.00816.91
8.0.90.0050.00216.69
8.0.80.0040.01416.87
8.0.70.0050.00316.95
8.0.60.0030.00516.77
8.0.50.0080.00016.74
8.0.30.0080.01417.14
8.0.20.0130.00617.40
8.0.10.0050.00217.04
8.0.00.0070.01416.89
7.4.330.0050.00015.07
7.4.320.0060.00016.56
7.4.300.0030.00316.51
7.4.290.0030.00316.46
7.4.280.0040.00416.49
7.4.270.0030.00316.37
7.4.260.0030.00316.61
7.4.250.0040.00416.50
7.4.240.0000.00716.44
7.4.230.0030.00316.71
7.4.220.0060.01216.69
7.4.210.0110.00816.45
7.4.200.0000.00716.42
7.4.160.0100.01316.58
7.4.150.0080.01217.40
7.4.140.0050.01217.86
7.4.130.0080.00916.42
7.4.120.0060.01116.57
7.4.110.0100.00716.41
7.4.100.0140.00716.51
7.4.90.0140.00316.56
7.4.80.0030.01319.39
7.4.70.0130.00316.34
7.4.60.0100.00716.33
7.4.50.0030.00516.60
7.4.40.0040.01416.32
7.4.30.0130.00316.52
7.4.00.0030.01015.13
7.3.330.0060.00013.06
7.3.320.0000.00613.11
7.3.310.0070.00016.07
7.3.300.0060.00016.07
7.3.290.0110.00416.23
7.3.280.0070.01216.21
7.3.270.0120.00617.40
7.3.260.0070.01016.27
7.3.250.0120.00716.26
7.3.240.0060.00916.57
7.3.230.0210.00016.39
7.3.210.0090.00916.29
7.3.200.0180.00019.39
7.3.190.0110.01116.45
7.3.180.0160.00516.27
7.3.170.0080.00916.37
7.3.160.0060.00916.48
7.2.330.0080.00816.70
7.2.320.0100.00716.46
7.2.310.0110.00716.72
7.2.300.0100.00716.36
7.2.290.0070.01016.63
7.2.00.0050.00919.49
7.1.100.0030.01017.89
7.1.70.0000.00717.18
7.1.60.0150.00919.46
7.1.50.0090.01216.63
7.1.00.0000.08022.44
7.0.200.0000.01316.73
7.0.140.0030.07322.00
7.0.60.0000.04319.89
7.0.50.0070.05017.87
7.0.40.0070.07019.96
7.0.30.0570.07020.35
7.0.20.0470.07320.12
7.0.10.0100.05020.10
7.0.00.0030.04720.19
5.6.280.0070.06720.93
5.6.210.0100.06020.47
5.6.200.0030.05018.18
5.6.190.0100.05320.57
5.6.180.0300.05320.63
5.6.170.0470.04320.52
5.6.160.0100.04320.57
5.6.150.0030.05018.23
5.6.140.0070.07318.28
5.6.130.0130.07318.11
5.6.120.0070.08720.97
5.6.110.0070.09021.03
5.6.100.0170.04021.01
5.6.90.0030.04320.95
5.6.80.0070.05020.39
5.6.70.3730.03720.40
5.5.350.0270.05020.38
5.5.340.0030.03718.02
5.5.330.0100.04320.59
5.5.320.0430.04320.27
5.5.310.0270.09020.34
5.5.300.0070.07317.99
5.5.290.0030.08318.08
5.5.280.0030.04320.65
5.5.270.0030.05320.76
5.5.260.0100.07320.98
5.5.250.0070.03720.71
5.5.240.4070.04020.15
5.4.450.0270.03019.43
5.4.440.0670.05019.53
5.4.430.0370.03719.27
5.4.420.0230.03719.30
5.4.410.0130.04719.50
5.4.400.0400.03319.32
5.4.390.0270.03718.95
5.4.380.0270.06018.83
5.4.370.0300.06018.72
5.4.360.0270.05018.71
5.4.350.0270.06018.80
5.4.340.0500.03318.71
5.4.320.0050.04412.50
5.4.310.0090.03612.50
5.4.300.0050.03812.50
5.4.290.0080.03512.50
5.4.280.0060.03512.40
5.4.270.0070.03412.40
5.4.260.0030.04012.40
5.4.250.0040.03912.40
5.4.240.0070.03412.40
5.4.230.0090.05212.39
5.4.220.0040.03912.39
5.4.210.0060.03512.39
5.4.200.0070.03712.39
5.4.190.0030.04012.39
5.4.180.0070.03512.39
5.4.170.0050.03612.39
5.4.160.0040.03812.39
5.4.150.0030.03912.39
5.4.140.0040.03912.07
5.4.130.0040.03712.05
5.4.120.0080.03312.02
5.4.110.0040.03812.02
5.4.100.0050.03612.02
5.4.90.0030.04012.01
5.4.80.0090.03412.01
5.4.70.0070.04012.01
5.4.60.0080.03312.01
5.4.50.0040.04112.00
5.4.40.0050.03412.00
5.4.30.0040.03712.00
5.4.20.0050.03512.00
5.4.10.0120.03111.99
5.4.00.0040.04211.48
5.3.290.0080.03712.80
5.3.280.0070.03612.71
5.3.270.0010.04412.72
5.3.260.0070.04112.72
5.3.250.0070.03712.72
5.3.240.0060.05112.72
5.3.230.0040.04112.71
5.3.220.0070.03812.68
5.3.210.0070.03812.68
5.3.200.0030.04012.68
5.3.190.0070.03712.68
5.3.180.0060.03612.68
5.3.170.0070.03512.67
5.3.160.0050.04012.68
5.3.150.0080.05112.68
5.3.140.0110.04712.66
5.3.130.0050.03912.66
5.3.120.0070.03712.66
5.3.110.0060.04012.66
5.3.100.0060.03712.12
5.3.90.0070.03712.10
5.3.80.0050.03912.09
5.3.70.0070.03712.10
5.3.60.0070.03612.08
5.3.50.0040.03712.03
5.3.40.0080.03412.03
5.3.30.0030.03811.98
5.3.20.0050.03511.77
5.3.10.0070.03411.73
5.3.00.0060.03611.72
5.2.170.0070.0299.23
5.2.160.0040.0309.22
5.2.150.0050.0309.22
5.2.140.0070.0309.22
5.2.130.0020.0319.18
5.2.120.0020.0329.18
5.2.110.0060.0359.18
5.2.100.0040.0309.18
5.2.90.0060.0279.18
5.2.80.0040.0339.18
5.2.70.0070.0299.17
5.2.60.0050.0329.13
5.2.50.0050.0299.10
5.2.40.0080.0309.08
5.2.30.0060.0299.05
5.2.20.0030.0369.04
5.2.10.0060.0288.94
5.2.00.0060.0308.81
5.1.60.0050.0228.09
5.1.50.0020.0298.09
5.1.40.0050.0278.07
5.1.30.0050.0298.42
5.1.20.0050.0258.44
5.1.10.0040.0258.16
5.1.00.0040.0258.17
5.0.50.0050.0216.65
5.0.40.0030.0196.50
5.0.30.0030.0306.32
5.0.20.0040.0206.28
5.0.10.0060.0166.26
5.0.00.0030.0366.25
4.4.90.0050.0164.77
4.4.80.0050.0194.76
4.4.70.0030.0144.75
4.4.60.0040.0144.75
4.4.50.0020.0164.77
4.4.40.0030.0244.71
4.4.30.0040.0144.76
4.4.20.0030.0154.84
4.4.10.0000.0184.85
4.4.00.0020.0254.76
4.3.110.0030.0154.67
4.3.100.0020.0154.67
4.3.90.0020.0154.64
4.3.80.0030.0244.58
4.3.70.0040.0134.63
4.3.60.0010.0194.63
4.3.50.0040.0164.63
4.3.40.0030.0244.54
4.3.30.0070.0113.30
4.3.20.0040.0153.29
4.3.10.0020.0163.25
4.3.00.0030.01718.23

preferences:
46.35 ms | 401 KiB | 5 Q