3v4l.org

run code in 300+ PHP versions simultaneously
<?php function strpose($haystack, $needle, $index = 0) { do { $pos = strpos($haystack, $needle, $index); if ($pos !== false) { if (!@trim($haystack[$pos-1])) { if (!@trim($haystack[($pos+strlen($needle))])) { return $pos; } else $index = $pos+1; } else $index = $pos+1; } } while ($pos !== false && $pos < strlen($haystack)); return $pos; } var_dump(strpose("Hello World", "ll")); var_dump(strpose("Hello World", "Hello")); var_dump(strpose("Hello Worlds", "World")); ?>

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.0070.01416.63
8.3.50.0230.00717.14
8.3.40.0070.01118.82
8.3.30.0180.00318.80
8.3.20.0040.00418.63
8.3.10.0000.00920.53
8.3.00.0060.00319.25
8.2.180.0100.01316.63
8.2.170.0140.00022.96
8.2.160.0100.00721.07
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00319.78
8.2.110.0070.00321.13
8.2.100.0080.00317.79
8.2.90.0060.00319.33
8.2.80.0030.00619.46
8.2.70.0060.00317.75
8.2.60.0030.00617.93
8.2.50.0080.00018.07
8.2.40.0000.00818.29
8.2.30.0000.00718.05
8.2.20.0000.00919.38
8.2.10.0040.00417.73
8.2.00.0030.00617.77
8.1.280.0110.01125.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0000.00922.66
8.1.230.0100.00320.90
8.1.220.0000.00817.74
8.1.210.0000.00918.89
8.1.200.0030.00617.35
8.1.190.0080.00017.55
8.1.180.0080.00018.10
8.1.170.0080.00018.75
8.1.160.0000.00818.95
8.1.150.0000.00718.63
8.1.140.0030.00717.36
8.1.130.0030.00517.39
8.1.120.0000.00717.38
8.1.110.0040.00417.43
8.1.100.0020.00517.38
8.1.90.0050.00317.50
8.1.80.0000.00717.50
8.1.70.0040.00417.39
8.1.60.0040.00417.58
8.1.50.0000.00817.45
8.1.40.0090.00017.53
8.1.30.0030.00617.69
8.1.20.0080.00017.70
8.1.10.0060.00317.49
8.1.00.0050.00517.56
8.0.300.0040.00419.90
8.0.290.0040.00416.75
8.0.280.0070.00018.52
8.0.270.0040.00417.20
8.0.260.0000.00716.76
8.0.250.0000.00717.01
8.0.240.0090.00016.95
8.0.230.0040.00416.95
8.0.220.0000.00716.91
8.0.210.0040.00416.85
8.0.200.0030.00517.01
8.0.190.0040.00416.85
8.0.180.0040.00416.84
8.0.170.0040.00716.54
8.0.160.0000.00816.93
8.0.150.0000.00816.89
8.0.140.0000.00816.91
8.0.130.0030.00313.28
8.0.120.0080.00016.77
8.0.110.0080.00016.81
8.0.100.0050.00316.71
8.0.90.0050.00316.72
8.0.80.0080.00816.85
8.0.70.0080.00016.86
8.0.60.0000.00816.88
8.0.50.0030.00516.96
8.0.30.0030.01517.07
8.0.20.0080.01017.18
8.0.10.0030.00516.98
8.0.00.0110.00716.91
7.4.330.0030.00213.07
7.4.320.0030.00316.52
7.4.300.0050.00216.60
7.4.290.0080.00016.54
7.4.280.0040.00316.64
7.4.270.0040.00316.44
7.4.260.0030.00313.28
7.4.250.0000.00716.52
7.4.240.0020.00516.54
7.4.230.0000.00716.73
7.4.220.0090.00916.50
7.4.210.0080.00916.65
7.4.200.0000.00716.61
7.4.190.0040.00416.50
7.4.160.0120.00416.49
7.4.150.0090.00916.63
7.4.140.0100.00716.52
7.4.130.0080.00816.56
7.4.120.0080.00916.57
7.4.110.0140.00416.52
7.4.100.0030.01416.66
7.4.90.0140.00416.42
7.4.80.0030.01519.39
7.4.70.0100.00716.48
7.4.60.0060.01016.40
7.4.50.0000.00916.58
7.4.40.0070.00716.35
7.4.30.0140.00316.74
7.4.00.0000.01215.02
7.3.330.0000.00713.41
7.3.320.0040.00413.32
7.3.310.0000.00716.33
7.3.300.0070.00016.41
7.3.290.0060.01116.39
7.3.280.0120.00416.35
7.3.270.0130.00316.34
7.3.260.0110.00616.38
7.3.250.0140.00616.63
7.3.240.0070.01416.64
7.3.230.0130.00416.66
7.3.210.0140.00416.51
7.3.200.0090.00916.25
7.3.190.0090.00616.63
7.3.180.0090.00916.41
7.3.170.0080.00816.18
7.3.160.0070.01016.52
7.3.120.0030.01014.85
7.2.330.0150.00716.78
7.2.320.0180.00016.70
7.2.310.0040.01416.87
7.2.300.0110.00616.77
7.2.290.0030.01516.77
7.2.60.0030.01016.91
7.2.00.0040.00819.59
7.1.200.0040.00815.81
7.1.100.0000.01018.06
7.1.70.0040.00417.19
7.1.60.0100.01319.40
7.1.50.0070.01416.98
7.1.00.0030.04022.50
7.0.200.0040.00816.75
7.0.140.0070.06322.04
7.0.120.0000.07722.01
7.0.60.0130.07319.88
7.0.50.0200.06717.84
7.0.40.0070.06017.85
7.0.30.0130.08717.73
7.0.20.0100.08017.80
7.0.10.0130.04017.81
7.0.00.0100.07717.75
5.6.280.0070.06721.02
5.6.210.0030.04720.53
5.6.200.0030.08318.13
5.6.190.0130.08018.18
5.6.180.0100.04718.21
5.6.170.0070.08018.16
5.6.160.0130.07318.18
5.6.150.0070.06018.25
5.6.140.0030.04318.20
5.6.130.0100.08018.14
5.6.120.0070.06318.24
5.6.110.0070.07018.27
5.6.100.0200.05718.11
5.6.90.0130.07318.25
5.6.80.0130.06317.59
5.6.70.0200.06317.62
5.6.60.0100.07317.52
5.6.50.0070.07317.57
5.6.40.0070.05017.53
5.6.30.0100.04017.62
5.6.20.0100.03317.54
5.6.10.0030.04317.52
5.6.00.0100.05017.59
5.5.350.0330.06720.42
5.5.340.0100.07018.04
5.5.330.0130.06318.03
5.5.320.0030.06017.92
5.5.310.0030.05318.05
5.5.300.0070.04017.97
5.5.290.0230.06717.96
5.5.280.0130.05718.00
5.5.270.0130.04718.08
5.5.260.0070.08017.98
5.5.250.0070.07717.80
5.5.240.0100.07717.35
5.5.230.0070.07717.36
5.5.220.0070.06717.39
5.5.210.0070.06017.46
5.5.200.0130.06717.43
5.5.190.0070.06717.40
5.5.180.0030.08017.39
5.5.160.0030.04717.40
5.5.150.0070.06717.38
5.5.140.0030.05017.29
5.5.130.0000.04317.37
5.5.120.0000.04717.43
5.5.110.0070.03717.39
5.5.100.0030.03717.24
5.5.90.0000.04017.21
5.5.80.0070.03717.27
5.5.70.0000.04017.19
5.5.60.0000.04017.32
5.5.50.0030.03717.31
5.5.40.0070.03317.18
5.5.30.0070.03317.32
5.5.20.0030.03717.19
5.5.10.0030.03717.32
5.5.00.0030.03717.15
5.4.450.0100.06019.31
5.4.440.0130.06719.44
5.4.430.0030.08719.37
5.4.420.0000.08319.44
5.4.410.0030.05019.22
5.4.400.0070.06319.12
5.4.390.0130.06318.88
5.4.380.0100.05319.09
5.4.370.0100.06718.91
5.4.360.0000.07019.13
5.4.350.0030.05319.03
5.4.340.0070.04019.02
5.4.320.0230.03019.15
5.4.310.0070.04319.03
5.4.300.0100.07319.05
5.4.290.0100.06319.04
5.4.280.0030.05019.16
5.4.270.0100.03018.95
5.4.260.0000.04019.13
5.4.250.0070.03719.05
5.4.240.0070.03318.88
5.4.230.0000.04019.13
5.4.220.0030.04319.02
5.4.210.0000.04019.00
5.4.200.0030.03719.26
5.4.190.0030.03718.97
5.4.180.0030.04019.11
5.4.170.0070.03319.00
5.4.160.0070.04018.95
5.4.150.0030.04719.11
5.4.140.0030.03316.35
5.4.130.0030.03316.34
5.4.120.0030.03316.58
5.4.110.0030.03316.23
5.4.100.0030.04016.45
5.4.90.0070.03016.29
5.4.80.0070.03716.39
5.4.70.0100.02716.44
5.4.60.0000.04716.45
5.4.50.0000.03716.52
5.4.40.0000.03716.41
5.4.30.0030.03316.46
5.4.20.0100.03016.35
5.4.10.0030.03716.31
5.4.00.0000.03715.82
5.3.290.0030.08314.71
5.3.280.0030.04014.70
5.3.270.0070.03714.67
5.3.260.0030.04014.58
5.3.250.0000.04014.60
5.3.240.0070.03314.65
5.3.230.0000.04014.63
5.3.220.0100.03014.79
5.3.210.0070.04314.63
5.3.200.0030.03714.56
5.3.190.0030.03714.59
5.3.180.0030.04014.59
5.3.170.0030.03714.58
5.3.160.0030.03314.59
5.3.150.0030.03714.78
5.3.140.0070.03314.57
5.3.130.0070.03314.52
5.3.120.0070.03314.60
5.3.110.0000.04014.58
5.3.100.0030.03314.24
5.3.90.0030.03314.05
5.3.80.0070.05013.85
5.3.70.0070.04714.05
5.3.60.0030.07714.04
5.3.50.0000.05713.99
5.3.40.0070.06314.16
5.3.30.0070.07313.94
5.3.20.0070.07313.58
5.3.10.0030.04013.67
5.3.00.0070.04313.63
5.2.170.0130.05711.04
5.2.160.0100.04711.36
5.2.150.0100.04711.11
5.2.140.0000.03711.15
5.2.130.0000.06011.11
5.2.120.0100.04011.10
5.2.110.0070.06311.12
5.2.100.0000.07011.17
5.2.90.0000.06311.14
5.2.80.0100.06011.05
5.2.70.0030.06011.10
5.2.60.0000.06711.10
5.2.50.0030.04311.06
5.2.40.0070.03711.00
5.2.30.0070.06011.06
5.2.20.0100.05710.95
5.2.10.0030.05710.75
5.2.00.0030.04310.75
5.1.60.0030.0339.98
5.1.50.0000.0409.91
5.1.40.0030.05310.02
5.1.30.0030.06010.37
5.1.20.0100.04710.41
5.1.10.0030.03710.10
5.1.00.0070.05310.15
5.0.50.0030.0338.66
5.0.40.0170.0308.57
5.0.30.0030.0638.57
5.0.20.0030.0308.57
5.0.10.0070.0438.57
5.0.00.0000.0578.57
4.4.90.0030.0238.57
4.4.80.0030.0138.57
4.4.70.0000.0408.57
4.4.60.0030.0338.57
4.4.50.0030.0278.57
4.4.40.0030.0638.57
4.4.30.0100.0278.57
4.4.20.0070.0308.57
4.4.10.0030.0238.57
4.4.00.0030.0478.57
4.3.110.0030.0378.57
4.3.100.0000.0338.57
4.3.90.0030.0208.57
4.3.80.0000.0578.57
4.3.70.0000.0278.57
4.3.60.0070.0308.57
4.3.50.0000.0208.57
4.3.40.0000.0578.57
4.3.30.0030.0338.57
4.3.20.0000.0308.57
4.3.10.0000.0378.57
4.3.00.0000.0378.57

preferences:
61.82 ms | 400 KiB | 5 Q