3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Chat { public static function linkifyMessage($message) { $threadUrl = "http://forum.freewar.de/viewtopic.php?"; $threadPattern = "@".preg_quote($threadUrl)."f=(\d+)&t=(\d+)((&p=(\d+)(#p(\d+))?)|&view=unread(#unread)?)?@i"; preg_match_all($threadPattern, $message, $matches, PREG_SET_ORDER); foreach($matches as $match) { $message = str_replace($match[0], "<a href='{$match[0]}' target='_blank'>{$match[0]}</a>", $message); } return $message; } } $start = microtime(1); for($i = 0; $i < 10; $i++) { Chat::linkifyMessage('Guckt mal das Update: http://forum.freewar.de/viewtopic.php?f=8&t=52663'); } echo $i; echo "\n"; echo (microtime(1) - $start) / $i;
Output for 7.1.0
10 9.9897384643555E-6
Output for 7.0.14
10 1.6093254089355E-5
Output for 7.0.6
10 1.3899803161621E-5
Output for 7.0.5
10 1.6999244689941E-5
Output for 5.3.12, 7.0.4
10 1.4114379882813E-5
Output for 5.3.11, 7.0.3
10 1.3303756713867E-5
Output for 7.0.2
10 1.2016296386719E-5
Output for 5.4.7, 7.0.1
10 1.3589859008789E-5
Output for 7.0.0
10 1.5807151794434E-5
Output for hhvm-3.12.0
10 1.5997886657715E-5
Output for 5.2.2, 5.3.21, hhvm-3.10.0
10 1.5592575073242E-5
Output for 5.4.3, 5.6.11, 5.6.28
10 1.1110305786133E-5
Output for 5.6.21
10 8.1062316894531E-6
Output for 5.5.35, 5.6.20
10 8.2015991210937E-6
Output for 5.6.19
10 7.7962875366211E-6
Output for 5.6.18
10 8.4877014160156E-6
Output for 5.6.17
10 6.8902969360352E-6
Output for 5.6.16
10 1.0418891906738E-5
Output for 5.6.15
10 7.8916549682617E-6
Output for 5.6.14
10 1.0204315185547E-5
Output for 5.6.13
10 9.7990036010742E-6
Output for 5.6.12
10 1.0085105895996E-5
Output for 5.5.29, 5.6.10
10 1.0108947753906E-5
Output for 5.6.9
10 6.5088272094727E-6
Output for 5.6.8
10 1.1396408081055E-5
Output for 5.5.34
10 1.060962677002E-5
Output for 5.5.33
10 9.1075897216797E-6
Output for 5.5.32
10 9.2983245849609E-6
Output for 5.5.31
10 8.4161758422852E-6
Output for 5.5.30
10 1.0490417480469E-5
Output for 5.5.28
10 1.0180473327637E-5
Output for 5.5.27
10 7.5101852416992E-6
Output for 5.5.26
10 1.0395050048828E-5
Output for 5.5.25
10 9.5844268798828E-6
Output for 5.5.24
10 8.7976455688477E-6
Output for 5.4.45
10 2.8705596923828E-5
Output for 5.4.44
10 0.00027101039886475
Output for 5.4.43
10 2.2006034851074E-5
Output for 5.4.12, 5.4.42
10 1.5020370483398E-5
Output for 5.4.41
10 1.8215179443359E-5
Output for 5.4.40
10 3.058910369873E-5
Output for 5.4.39
10 2.2983551025391E-5
Output for 5.4.38
10 1.9383430480957E-5
Output for 5.2.17, 5.3.25, 5.4.37
10 1.7213821411133E-5
Output for 5.3.13, 5.4.36
10 1.8596649169922E-5
Output for 5.4.35
10 1.2588500976562E-5
Output for 5.3.16, 5.4.34
10 1.4305114746094E-5
Output for 5.3.22, 5.4.32
10 1.4519691467285E-5
Output for 5.4.9, 5.4.31
10 1.3089179992676E-5
Output for 5.4.30
10 1.1801719665527E-5
Output for 5.4.29
10 1.218318939209E-5
Output for 5.4.28
10 1.7786026000977E-5
Output for 5.4.1, 5.4.27
10 1.3113021850586E-5
Output for 5.4.26
10 1.2516975402832E-5
Output for 5.4.25
10 9.0837478637695E-6
Output for 5.2.13, 5.4.24
10 1.368522644043E-5
Output for 5.4.23
10 1.3995170593262E-5
Output for 5.3.8, 5.4.22
10 1.4209747314453E-5
Output for 5.4.21
10 1.680850982666E-5
Output for 5.4.6, 5.4.20
10 1.4901161193848E-5
Output for 5.4.19
10 1.2922286987305E-5
Output for 5.3.29, 5.4.18
10 1.2898445129395E-5
Output for 5.4.17
10 1.5711784362793E-5
Output for 5.4.10, 5.4.16
10 1.4400482177734E-5
Output for 5.4.0, 5.4.15
10 1.7714500427246E-5
Output for 5.4.14
10 1.4805793762207E-5
Output for 5.4.13
10 1.671314239502E-5
Output for 5.2.12, 5.4.11
10 1.4686584472656E-5
Output for 5.4.8
10 1.8119812011719E-5
Output for 5.4.5
10 1.2707710266113E-5
Output for 5.4.4
10 1.3208389282227E-5
Output for 5.4.2
10 1.2779235839844E-5
Output for 5.3.28
10 1.2993812561035E-5
Output for 5.3.27
10 1.3518333435059E-5
Output for 5.3.26
10 1.9001960754395E-5
Output for 5.3.24
10 1.5091896057129E-5
Output for 5.3.23
10 1.4185905456543E-5
Output for 5.3.17, 5.3.20
10 1.6403198242187E-5
Output for 5.3.19
10 1.7094612121582E-5
Output for 5.3.18
10 1.4495849609375E-5
Output for 5.3.15
10 1.3613700866699E-5
Output for 5.3.14
10 1.6903877258301E-5
Output for 5.3.10
10 1.4996528625488E-5
Output for 5.2.8, 5.3.9
10 1.370906829834E-5
Output for 5.3.7
10 2.0098686218262E-5
Output for 5.3.6
10 1.8310546875E-5
Output for 5.3.5
10 2.1100044250488E-5
Output for 5.3.4
10 1.7690658569336E-5
Output for 5.3.3
10 1.4019012451172E-5
Output for 5.2.3, 5.3.2
10 1.380443572998E-5
Output for 5.3.1
10 1.9478797912598E-5
Output for 5.3.0
10 1.978874206543E-5
Output for 5.2.16
10 2.3007392883301E-5
Output for 5.2.15
10 2.288818359375E-5
Output for 5.2.14
10 1.530647277832E-5
Output for 5.2.11
10 1.9097328186035E-5
Output for 5.2.10
10 1.3494491577148E-5
Output for 5.2.9
10 1.5115737915039E-5
Output for 5.2.7
10 1.6689300537109E-5
Output for 5.2.6
10 1.9717216491699E-5
Output for 5.2.5
10 1.4615058898926E-5
Output for 5.2.4
10 1.7404556274414E-5
Output for 5.2.1
10 1.521110534668E-05
Output for 5.2.0
10 1.680850982666E-05
Output for 5.1.6
10 1.678466796875E-05
Output for 5.1.5
10 1.4781951904297E-05
Output for 5.1.4
10 1.6307830810547E-05
Output for 5.1.3
10 1.4710426330566E-05
Output for 5.1.2
10 1.7380714416504E-05
Output for 5.1.1
10 1.5497207641602E-05
Output for 5.1.0
10 1.4305114746094E-05
Output for 5.0.5
10 1.6117095947266E-05
Output for 5.0.4
10 1.6617774963379E-05
Output for 5.0.1, 5.0.3
10 1.4281272888184E-05
Output for 5.0.2
10 1.4185905456543E-05
Output for 5.0.0
10 1.4209747314453E-05
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/YpA0s on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/YpA0s on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/YpA0s on line 4
Process exited with code 255.