3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '[a-z\d+#.-]+'; // Borrowed from @Hamza. $tags =<<<TAGS gg!!gd hfhfghg;hfhdfh fgjfgjgf;hfhdfh;hfhdfh fgjgfj;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh TAGS; $prevChar = ';'; $count = 0; $len = strlen($tags); $allowedChars = ';abcdefghijklmnopqrstuvwxyz0123456789#.-'; for ($i = 0; $i < $len; $i++) { $current = $tags[$i]; if ($current === ';' && $current !== $prevChar) { $count++; } else { $count = 0; break; } if (strpos($allowedChars, $current) === false) } $count = 0; break; } } var_dump($count); if (preg_match('/'.$pattern.'/', $tags)) { var_dump(substr_count($tags, ';')); }

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)
5.4.250.0100.04718.99
5.4.240.0170.04318.73
5.4.230.0100.06018.77
5.4.220.0100.05319.02
5.4.210.0100.05019.09
5.4.200.0070.05718.78
5.4.190.0130.05018.99
5.4.180.0170.06318.98
5.4.170.0070.05018.80
5.4.160.0030.06718.95
5.4.150.0130.07018.92
5.4.140.0130.06316.33
5.4.130.0000.05716.48
5.4.120.0100.06716.42
5.4.110.0100.05016.63
5.4.100.0200.05716.32
5.4.90.0070.04716.61
5.4.80.0100.05316.57
5.4.70.0100.05316.47
5.4.60.0200.06016.50
5.4.50.0030.05316.52
5.4.40.0100.06316.39
5.4.30.0130.04316.59
5.4.20.0070.05016.25
5.4.10.0100.05016.38
5.4.00.0130.04015.74
5.3.280.0030.05314.43
5.3.270.0130.04314.62
5.3.260.0130.07314.61
5.3.250.0070.05014.63
5.3.240.0100.06314.45
5.3.230.0130.04314.60
5.3.220.0000.06014.44
5.3.210.0070.05314.59
5.3.200.0230.03314.58
5.3.190.0100.05014.66
5.3.180.0170.06014.44
5.3.170.0070.05314.72
5.3.160.0130.04314.61
5.3.150.0030.05714.57
5.3.140.0070.05014.58
5.3.130.0070.05014.57
5.3.120.0030.06014.47
5.3.110.0100.05014.32
5.3.100.0030.07713.90
5.3.90.0030.05013.90
5.3.80.0070.05013.94
5.3.70.0030.05313.89
5.3.60.0030.05314.12
5.3.50.0030.05013.95
5.3.40.0070.05014.04
5.3.30.0030.05013.92
5.3.20.0070.05713.71
5.3.10.0030.05013.66
5.3.00.0100.05013.73

preferences:
140.74 ms | 1394 KiB | 7 Q