3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(firstWordPosition('Will company any do any job, (are there any)?', 'any')); function firstWordPosition($str, $word) { // There are others, maybe also pass this in or array_merge() for more control. $nonchars = ['.',',','!','?','(',')','^','$','#','\n','\r\n','\t',]; // You could also do a strpos() with an if and another argument passed in. return stripos(str_replace($nonchars, ' ', " $str "), " $word "); }

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.0090.00616.25
8.3.50.0110.00416.23
8.3.40.0030.01418.76
8.3.30.0120.00318.68
8.3.20.0070.00021.76
8.3.10.0090.00021.90
8.3.00.0050.00319.66
8.2.180.0070.00716.50
8.2.170.0120.00322.96
8.2.160.0100.00720.38
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00020.52
8.2.120.0040.00426.35
8.2.110.0070.00322.20
8.2.100.0040.00817.78
8.2.90.0000.00817.84
8.2.80.0080.00017.97
8.2.70.0040.00417.38
8.2.60.0000.00817.80
8.2.50.0030.00518.10
8.2.40.0090.00020.23
8.2.30.0050.00219.12
8.2.20.0040.00418.03
8.2.10.0070.00018.15
8.2.00.0070.00018.07
8.1.280.0100.01025.92
8.1.270.0000.00820.48
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0040.00422.13
8.1.230.0060.00620.85
8.1.220.0060.00317.74
8.1.210.0050.00318.89
8.1.200.0070.01317.13
8.1.190.0030.00516.99
8.1.180.0000.00718.10
8.1.170.0080.00018.53
8.1.160.0070.00019.03
8.1.150.0050.00318.88
8.1.140.0070.00019.43
8.1.130.0000.00718.84
8.1.120.0070.00017.31
8.1.110.0040.00417.30
8.1.100.0030.00417.31
8.1.90.0070.00017.41
8.1.80.0040.00417.32
8.1.70.0030.00517.38
8.1.60.0050.00317.61
8.1.50.0050.00217.43
8.1.40.0040.00417.55
8.1.30.0030.00517.69
8.1.20.0040.00417.49
8.1.10.0040.00417.43
8.1.00.0040.00417.48
8.0.300.0000.00920.03
8.0.290.0050.00316.63
8.0.280.0000.00718.41
8.0.270.0000.00717.27
8.0.260.0000.00618.85
8.0.250.0030.00316.96
8.0.240.0040.00416.79
8.0.230.0000.00716.95
8.0.220.0070.00016.92
8.0.210.0030.00316.79
8.0.200.0000.00816.95
8.0.190.0050.00416.86
8.0.180.0040.00416.93
8.0.170.0080.00016.85
8.0.160.0000.00716.79
8.0.150.0040.00416.93
8.0.140.0040.00416.76
8.0.130.0060.00013.27
8.0.120.0040.00416.88
8.0.110.0040.00416.80
8.0.100.0040.00416.95
8.0.90.0070.00016.97
8.0.80.0090.00616.92
8.0.70.0020.00516.79
8.0.60.0000.00716.69
8.0.50.0040.00416.73
8.0.30.0080.01017.10
8.0.20.0090.01117.41
8.0.10.0000.00817.00
8.0.00.0080.01117.00
7.4.330.0000.00515.55
7.4.320.0060.00016.43
7.4.300.0070.00016.61
7.4.290.0030.00316.51
7.4.280.0030.00616.55
7.4.270.0070.00016.51
7.4.260.0000.00716.53
7.4.250.0040.00416.58
7.4.240.0040.00416.54
7.4.230.0070.00016.42
7.4.220.0000.02116.55
7.4.210.0110.00316.48
7.4.200.0040.00416.52
7.4.160.0130.00916.44
7.4.150.0110.00617.40
7.4.140.0080.01217.86
7.4.130.0120.01216.62
7.4.120.0130.01016.48
7.4.110.0200.00316.51
7.4.100.0120.00916.46
7.4.90.0100.00716.51
7.4.80.0030.01319.39
7.4.70.0060.01216.60
7.4.60.0070.01016.56
7.4.50.0030.01316.65
7.4.40.0100.00716.63
7.4.30.0130.00316.41
7.4.10.0030.01315.05
7.4.00.0110.00715.09
7.3.330.0000.00513.33
7.3.320.0000.00513.17
7.3.310.0030.00316.18
7.3.300.0000.00716.20
7.3.290.0060.00916.31
7.3.280.0070.00916.30
7.3.270.0080.01517.40
7.3.260.0130.01016.25
7.3.250.0100.01016.43
7.3.240.0090.01016.46
7.3.230.0140.00616.62
7.3.210.0130.00316.32
7.3.200.0060.01516.56
7.3.190.0230.01316.33
7.3.180.0130.00316.28
7.3.170.0060.01216.54
7.3.160.0100.00716.69
7.3.130.0030.01614.98
7.3.120.0040.01514.48
7.3.110.0070.01114.49
7.3.100.0030.01115.09
7.3.90.0040.01114.70
7.3.80.0040.01114.78
7.3.70.0030.01014.69
7.3.60.0000.01414.75
7.3.50.0040.00414.77
7.3.40.0070.00714.73
7.3.30.0070.00314.82
7.3.20.0070.00716.64
7.3.10.0060.00516.63
7.3.00.0040.00816.50
7.2.330.0100.00716.59
7.2.320.0140.00316.41
7.2.310.0100.00716.60
7.2.300.0090.00916.32
7.2.290.0050.01116.31
7.2.260.0060.01315.05
7.2.250.0000.01915.16
7.2.240.0070.00715.08
7.2.230.0040.00814.85
7.2.220.0070.00414.91
7.2.210.0030.00615.26
7.2.200.0090.00615.03
7.2.190.0070.01014.89
7.2.180.0070.00714.78
7.2.170.0050.00514.69
7.2.160.0080.00414.94
7.2.150.0060.00616.63
7.2.140.0080.00316.91
7.2.130.0080.00516.70
7.2.120.0070.00616.67
7.2.110.0080.00616.79
7.2.100.0050.00816.66
7.2.90.0050.00916.71
7.2.80.0060.00516.77
7.2.70.0070.00716.49
7.2.60.0040.00716.82
7.2.50.0070.01116.83
7.2.40.0070.00516.72
7.2.30.0060.00716.64
7.2.20.0070.00916.69
7.2.10.0070.00816.76
7.2.00.0100.00516.76
7.1.330.0060.00815.75
7.1.320.0000.01115.93
7.1.310.0030.01015.98
7.1.300.0000.01515.87
7.1.290.0030.00715.76
7.1.280.0080.00415.68
7.1.270.0070.00315.60
7.1.260.0060.00615.96
7.1.250.0090.00615.64
7.1.240.0090.00315.90
7.1.230.0140.00015.57
7.1.220.0070.00715.91
7.1.210.0110.00415.79
7.1.200.0070.00615.63
7.1.190.0030.01315.70
7.1.180.0130.00715.82
7.1.170.0000.01515.95
7.1.160.0090.00615.54
7.1.150.0090.00615.86
7.1.140.0000.01615.93
7.1.130.0060.00615.72
7.1.120.0030.00615.63
7.1.110.0060.00615.90
7.1.100.0120.00315.86
7.1.90.0070.00415.84
7.1.80.0000.01015.52
7.1.70.0050.00516.42
7.1.60.0740.01424.56
7.1.50.0480.01524.26
7.1.40.0520.01324.15
7.1.30.0390.01424.33
7.1.20.0600.01424.21
7.1.10.0500.00915.43
7.1.00.0400.01115.29
7.0.330.0060.00615.43
7.0.320.0040.01115.48
7.0.310.0040.00415.40
7.0.300.0060.00615.42
7.0.290.0030.01015.35
7.0.280.0060.00315.16
7.0.270.0030.01315.49
7.0.260.0030.00915.41
7.0.250.0040.00815.10
7.0.240.0090.00015.11
7.0.230.0040.00815.52
7.0.220.0060.00615.37
7.0.210.0100.00515.32
7.0.200.0500.00715.07
7.0.190.0400.01315.18
7.0.180.0550.01014.91
7.0.170.0480.01314.84
7.0.160.0700.00614.83
7.0.150.0470.00814.93
7.0.140.0590.00715.00
7.0.130.0480.01215.05
7.0.120.0520.00715.02
7.0.110.0360.00914.93
7.0.100.0320.01214.79
7.0.90.0530.00714.88
7.0.80.0470.00714.96
7.0.70.0400.01214.98
7.0.60.0420.01414.81
7.0.50.0290.01015.09
7.0.40.0330.00814.04
7.0.30.0440.00814.09
7.0.20.0330.01014.15
7.0.10.0300.00714.09
7.0.00.0310.00813.92
5.6.400.0000.01414.13
5.6.390.0090.00614.45
5.6.380.0090.00614.38
5.6.370.0030.00914.38
5.6.360.0000.01114.55
5.6.350.0070.00714.14
5.6.340.0080.00614.44
5.6.330.0090.00614.41
5.6.320.0060.00914.07
5.6.310.0030.00614.49
5.6.300.0080.00314.20
5.6.290.0090.00314.51
5.6.280.0030.01314.29
5.6.270.0080.00814.50
5.6.260.0040.01114.21
5.6.250.0070.00714.41
5.6.240.0090.00614.52
5.6.230.0120.00014.20
5.6.220.0000.01314.23
5.6.210.0060.01014.05
5.6.200.0060.00614.20
5.6.190.0030.01014.32
5.6.180.0040.00914.32
5.6.170.0030.00714.35
5.6.160.0090.00614.20
5.6.150.0030.01014.31
5.6.140.0070.01014.18
5.6.130.0080.01114.23
5.6.120.0110.00714.31
5.6.110.0040.00814.12
5.6.100.0030.01014.30
5.6.90.0050.00514.30
5.6.80.0030.00714.02
5.6.70.0000.01314.16
5.6.60.0030.01314.30
5.6.50.0060.00914.37
5.6.40.0060.00614.49
5.6.30.0030.01414.00
5.6.20.0120.00614.05
5.6.10.0090.00614.02
5.6.00.0070.00714.07

preferences:
41.04 ms | 400 KiB | 5 Q