3v4l.org

run code in 300+ PHP versions simultaneously
<?php function highlight($text, $words) { preg_match_all ( '~[\w\'\"]+~', $words, $m ); if (! $m) return $text; $re = '~\\b(' . implode ( '|', $m [0] ) . ')\\b~i'; return preg_replace ( $re, '<em>$0</em>', $text ); } $text = "this is Mechanic's test"; $word = "Mechanic's"; echo highlight($text,$word); $text = 'this is Mechanic"s test'; $word = 'Mechanic"s'; echo "\n".highlight($text,$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.70.0050.01018.39
8.3.60.0100.01016.63
8.3.50.0120.00916.56
8.3.40.0110.00318.97
8.3.30.0120.00318.75
8.3.20.0080.00020.20
8.3.10.0040.00423.48
8.3.00.0060.00319.36
8.2.190.0110.00716.75
8.2.180.0090.00616.88
8.2.170.0070.00722.96
8.2.160.0070.00720.43
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00821.07
8.2.120.0080.00026.35
8.2.110.0030.00621.30
8.2.100.0060.00618.03
8.2.90.0040.00419.40
8.2.80.0030.00518.05
8.2.70.0080.00017.75
8.2.60.0050.00318.05
8.2.50.0050.00318.10
8.2.40.0060.00320.43
8.2.30.0050.00321.00
8.2.20.0070.00018.07
8.2.10.0040.00418.20
8.2.00.0040.00418.02
8.1.280.0090.00625.92
8.1.270.0000.00722.07
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.92
8.1.230.0040.00719.00
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0070.00317.48
8.1.190.0060.00317.22
8.1.180.0000.00818.10
8.1.170.0060.00318.54
8.1.160.0040.00419.00
8.1.150.0000.00720.70
8.1.140.0000.00719.54
8.1.130.0030.00318.98
8.1.120.0050.00317.50
8.1.110.0050.00317.55
8.1.100.0000.00717.57
8.1.90.0000.01017.59
8.1.80.0040.00417.60
8.1.70.0070.00017.55
8.1.60.0040.00417.75
8.1.50.0070.00017.63
8.1.40.0000.00817.68
8.1.30.0040.00417.77
8.1.20.0090.00017.77
8.1.10.0000.00917.70
8.1.00.0080.00017.55
8.0.300.0040.00418.77
8.0.290.0050.00216.75
8.0.280.0030.00318.46
8.0.270.0050.00217.16
8.0.260.0060.00316.97
8.0.250.0000.00717.07
8.0.240.0080.00017.00
8.0.230.0080.00016.98
8.0.220.0030.00516.91
8.0.210.0030.00317.04
8.0.200.0080.00017.03
8.0.190.0000.00816.98
8.0.180.0080.00017.13
8.0.170.0040.00417.04
8.0.160.0000.00816.94
8.0.150.0050.00216.87
8.0.140.0040.00417.01
8.0.130.0040.00413.41
8.0.120.0000.00917.12
8.0.110.0030.00516.84
8.0.100.0000.00817.00
8.0.90.0040.00416.93
8.0.80.0210.00317.00
8.0.70.0000.00716.86
8.0.60.0050.00217.04
8.0.50.0050.00217.12
8.0.30.0120.00317.25
8.0.20.0120.01017.54
8.0.10.0000.00717.20
8.0.00.0120.00616.88
7.4.330.0050.00015.55
7.4.320.0030.00316.85
7.4.300.0000.00616.71
7.4.290.0070.00416.81
7.4.280.0000.00916.89
7.4.270.0070.00016.81
7.4.260.0060.00013.55
7.4.250.0050.00316.76
7.4.240.0030.00316.86
7.4.230.0030.00316.90
7.4.220.0120.01216.84
7.4.210.0070.00716.89
7.4.200.0000.00716.57
7.4.160.0060.01116.59
7.4.150.0150.00617.40
7.4.140.0070.01117.86
7.4.130.0170.00316.61
7.4.120.0090.01316.69
7.4.110.0090.00916.66
7.4.100.0070.01016.68
7.4.90.0120.00916.73
7.4.80.0170.00419.39
7.4.70.0030.01316.67
7.4.60.0150.00316.86
7.4.50.0080.00816.46
7.4.40.0030.01316.82
7.4.30.0150.00616.75
7.4.00.0070.01015.32
7.3.330.0000.00513.19
7.3.320.0000.00513.32
7.3.310.0000.00716.52
7.3.300.0040.00216.33
7.3.290.0100.00416.47
7.3.280.0080.00816.45
7.3.270.0230.00317.40
7.3.260.0120.00616.48
7.3.250.0100.00616.48
7.3.240.0120.00516.66
7.3.230.0090.01216.47
7.3.210.0100.00616.49
7.3.200.0120.00616.48
7.3.190.0090.00916.75
7.3.180.0040.01516.67
7.3.170.0060.00916.70
7.3.160.0040.01316.93
7.2.330.0090.01516.72
7.2.320.0120.00916.93
7.2.310.0030.01516.89
7.2.300.0120.00316.73
7.2.290.0080.00816.75
7.2.60.0090.00316.88
7.2.00.0040.00819.76
7.1.200.0050.00315.93
7.1.100.0120.00318.36
7.1.70.0000.00717.65
7.1.60.0060.00317.65
7.1.50.0070.00317.65
7.1.40.0000.01317.65
7.1.30.0040.00717.65
7.1.20.0040.00717.65
7.1.10.0030.00517.65
7.1.00.0000.00717.65
7.0.200.0000.00717.65
7.0.190.0030.00517.65
7.0.180.0040.00417.65
7.0.170.0000.00817.65
7.0.160.0040.00417.65
7.0.150.0030.01017.65
7.0.140.0000.00717.65
7.0.130.0050.00317.65
7.0.120.0000.00717.65
7.0.110.0070.00017.65
7.0.100.0000.00917.65
7.0.90.0040.00417.65
7.0.80.0000.00917.65
7.0.70.0000.00817.65
7.0.60.0000.00917.65
7.0.50.0040.00417.65
7.0.40.0000.00817.65
7.0.30.0030.01017.65
7.0.20.0000.00917.65
7.0.10.0060.00617.65
7.0.00.0030.00617.65

preferences:
61.5 ms | 401 KiB | 5 Q