3v4l.org

run code in 300+ PHP versions simultaneously
<?php function highlightWords($content) { $arr=array("php", "and sql", "sql"); foreach ($arr as $key=>$value) { $content=preg_replace("/(?!<a href="#">)\b(".preg_quote($value).")\b/i", '<a href="#">\1</a>', $content, 1); } return $content; } echo highlightWords("This text will highlight PHP and SQL and sql but not PHPRO or MySQL or sqlite");

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)
7.0.20.0270.07020.05
7.0.10.0070.04720.12
7.0.00.0100.07320.11
5.6.170.0200.03720.47
5.6.160.0030.06320.56
5.6.150.0070.08018.23
5.6.140.0070.07718.21
5.6.130.0030.04318.14
5.6.120.0100.06720.97
5.6.110.0070.04020.98
5.6.100.0070.08320.96
5.6.90.0070.03721.04
5.6.80.0070.07020.54
5.5.310.0270.07720.41
5.5.300.0030.05318.10
5.5.290.0070.05718.09
5.5.280.0070.03720.65
5.5.270.0000.04320.80
5.5.260.0070.05320.97
5.5.250.0070.07720.68
5.5.240.0270.06320.19

preferences:
137.64 ms | 1398 KiB | 7 Q