3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'My nAmE ïs Tom.'; // case-sensitive matching, including partial matching $array = ['foo', 'nAmE']; $regex[] = '#' . implode('|', array_map('preg_quote', $array)) . '#'; // case-insensitive matching, including partial matching $array = ['foo', 'om']; $regex[] = '#' . implode('|', array_map('preg_quote', $array)) . '#i'; // case-insensitive matching, full word matching only $array = ['foo', 'tom']; $regex[] = '#\b(?:' . implode('|', array_map('preg_quote', $array)) . ')\b#i'; // case-insensitive matching, full word matching only, multibyte aware $array = ['foo', 'ïs']; $regex[] = '#\b(?:' . implode('|', array_map('preg_quote', $array)) . ')\b#iu'; foreach ($regex as $r) { if (preg_match($r, $string, $m)) { echo "found '$m[0]' using $r on $string\n"; } else { echo "no match using $r on $string\n"; } }

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.5.70.0110.00717.18
8.5.60.0130.00417.14
8.5.50.0060.00116.80
8.5.30.0100.00919.53
8.5.20.0050.00317.96
8.5.10.0120.00616.89
8.5.00.0130.00920.30
8.4.220.0050.00520.17
8.4.210.0150.00720.05
8.4.180.0150.01022.14
8.4.170.0120.01023.90
8.4.160.0100.01123.90
8.4.150.0070.00517.06
8.4.140.0170.00518.13
8.4.130.0140.00617.88
8.4.120.0120.00820.67
8.4.110.0130.00918.75
8.4.100.0110.00919.09
8.4.90.0110.00918.82
8.4.80.0110.00818.96
8.4.70.0110.00918.21
8.4.60.0160.00619.02
8.4.50.0160.00418.71
8.4.40.0140.00718.05
8.4.30.0120.00918.75
8.4.20.0100.01019.91
8.4.10.0030.00619.50
8.3.310.0050.00518.56
8.3.300.0140.00620.88
8.3.290.0150.00618.73
8.3.280.0120.00918.77
8.3.270.0110.00816.87
8.3.260.0110.00917.01
8.3.250.0140.00719.08
8.3.240.0090.00716.88
8.3.230.0120.00816.88
8.3.220.0100.00817.10
8.3.210.0110.00718.51
8.3.200.0070.00216.87
8.3.190.0070.00317.39
8.3.180.0100.00517.00
8.3.170.0130.00618.92
8.3.160.0130.00316.94
8.3.150.0120.00817.55
8.3.140.0080.00317.00
8.3.130.0090.00018.57
8.3.120.0130.00718.72
8.3.110.0040.00416.91
8.3.100.0030.00624.06
8.3.90.0050.00326.77
8.3.80.0050.00517.97
8.3.70.0150.00616.73
8.3.60.0150.00617.00
8.3.50.0120.00618.65
8.3.40.0120.00320.22
8.3.30.0110.00321.70
8.3.20.0030.00624.18
8.3.10.0030.00524.66
8.3.00.0040.00426.16
8.2.310.0120.00718.32
8.2.300.0100.00918.25
8.2.290.0130.00520.60
8.2.280.0030.00520.23
8.2.270.0000.00817.42
8.2.260.0060.00318.30
8.2.250.0000.00817.09
8.2.240.0130.00319.34
8.2.230.0030.00520.94
8.2.220.0000.00937.54
8.2.210.0090.00926.77
8.2.200.0060.00316.75
8.2.190.0100.01017.00
8.2.180.0140.00718.54
8.2.170.0000.01518.95
8.2.160.0140.00022.96
8.2.150.0060.00325.66
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0040.00421.02
8.2.110.0120.00922.34
8.2.100.0180.00621.24
8.2.90.0270.00419.20
8.2.80.0150.00020.93
8.2.70.0080.00818.96
8.2.60.0120.00418.97
8.2.50.0130.01020.15
8.2.40.0200.01019.05
8.2.30.0160.00618.86
8.2.20.0150.00019.05
8.2.10.0150.00619.08
8.2.00.0240.00319.05
8.1.340.0110.00918.45
8.1.330.0090.01121.91
8.1.320.0140.00516.36
8.1.310.0110.00416.55
8.1.300.0030.00618.61
8.1.290.0070.00330.84
8.1.280.0180.00325.92
8.1.270.0130.00724.66
8.1.260.0000.00826.35
8.1.250.0120.00328.09
8.1.240.0130.00018.79
8.1.230.0240.00718.70
8.1.220.0150.01118.82
8.1.210.0290.00420.00
8.1.200.0180.00718.92
8.1.190.0170.00720.18
8.1.180.0200.00018.66
8.1.170.0170.01318.69
8.1.160.0250.00418.97
8.1.150.0120.01220.69
8.1.140.0090.00418.63
8.1.130.0070.00718.85
8.1.120.0000.01218.93
8.1.110.0090.00319.92
8.1.100.0110.00418.78
8.1.90.0120.00318.51
8.1.80.0110.00418.66
8.1.70.0000.01318.88
8.1.60.0100.00718.95
8.1.50.0140.00318.66
8.1.40.0000.01418.60
8.1.30.0140.00019.09
8.1.20.0170.00018.77
8.1.10.0070.00719.10
8.1.00.0120.00218.70
8.0.300.0160.00017.92
8.0.290.0120.00418.02
8.0.280.0070.00717.95
8.0.270.0150.00018.08
8.0.260.0000.01118.53
8.0.250.0150.00017.97
8.0.240.0110.00318.09
8.0.230.0100.00318.38
8.0.220.0060.00918.27
8.0.210.0140.00018.11
8.0.200.0060.00918.34
8.0.190.0100.00318.21
8.0.180.0140.00018.16
8.0.170.0110.00418.26
8.0.160.0150.00017.98
8.0.150.0140.00018.38
8.0.140.0110.00418.08
8.0.130.0070.00718.10
8.0.120.0120.00317.95
8.0.110.0050.00518.49
8.0.100.0120.00318.00
8.0.90.0120.00318.29
8.0.80.0240.00018.11
8.0.70.0090.00618.25
8.0.60.0210.00418.26
8.0.50.0120.01518.16
8.0.30.0090.00518.38
8.0.20.0080.00818.11
8.0.10.0130.00318.37

preferences:
48 ms | 1159 KiB | 5 Q