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 < 100; $i++) { Chat::linkifyMessage('Guckt mal das Update: http://forum.freewar.de/viewtopic.php?f=8&t=52663'); } echo (microtime(1) - $start) / $i;
Output for 7.1.0
1.8000602722168E-6
Output for 5.3.23, 7.0.14
3.2496452331543E-6
Output for 7.0.6
2.5796890258789E-6
Output for 7.0.5
2.9492378234863E-6
Output for 7.0.4
2.3007392883301E-6
Output for 7.0.3
1.7786026000977E-6
Output for 7.0.2
2.601146697998E-6
Output for 7.0.1
2.5606155395508E-6
Output for 7.0.0
2.7918815612793E-6
Output for 5.6.28
5.2690505981445E-6
Output for 5.6.21
3.1900405883789E-6
Output for 5.6.20
3.4809112548828E-6
Output for 5.6.19
2.751350402832E-6
Output for 5.6.18
2.2411346435547E-6
Output for 5.4.0, 5.6.17
3.4284591674805E-6
Output for 5.6.16
2.6512145996094E-6
Output for 5.6.15
4.2510032653809E-6
Output for 5.6.14
3.7097930908203E-6
Output for 5.6.13
3.7693977355957E-6
Output for 5.6.12
3.8790702819824E-6
Output for 5.6.11
3.9005279541016E-6
Output for 5.6.10
3.201961517334E-6
Output for 5.6.9
3.8003921508789E-6
Output for 5.6.8
4.2200088500977E-6
Output for 5.3.2, 5.3.10, 5.6.7
3.6096572875977E-6
Output for 5.5.35
4.1580200195313E-6
Output for 5.4.1, 5.5.33 - 5.5.34
3.4499168395996E-6
Output for 5.5.32
4.8494338989258E-6
Output for 5.5.31
3.6311149597168E-6
Output for 5.5.30
4.0102005004883E-6
Output for 5.5.29
3.5691261291504E-6
Output for 5.5.28
2.5010108947754E-6
Output for 5.5.27
3.8886070251465E-6
Output for 5.5.26
5.6600570678711E-6
Output for 5.5.25
4.0388107299805E-6
Output for 5.3.4, 5.4.10, 5.5.24
3.5595893859863E-6
Output for 5.4.5, 5.4.45
2.3794174194336E-6
Output for 5.4.44
2.3102760314941E-6
Output for 5.4.43
3.2687187194824E-6
Output for 5.4.42
3.3187866210937E-6
Output for 5.4.41
5.7005882263184E-6
Output for 5.4.40
3.209114074707E-6
Output for 5.2.6, 5.4.39
3.5285949707031E-6
Output for 5.4.38
2.8705596923828E-6
Output for 5.4.37
5.2404403686523E-6
Output for 5.4.36
2.4795532226563E-6
Output for 5.4.3, 5.4.35
4.1794776916504E-6
Output for 5.4.29, 5.4.34
3.0303001403809E-6
Output for 5.4.32
3.3998489379883E-6
Output for 5.4.31
2.2602081298828E-6
Output for 5.4.30
2.7894973754883E-6
Output for 5.4.28
2.3508071899414E-6
Output for 5.4.27
3.4689903259277E-6
Output for 5.4.26
2.9587745666504E-6
Output for 5.4.25
2.8896331787109E-6
Output for 5.4.24
3.4022331237793E-6
Output for 5.4.23
3.7598609924316E-6
Output for 5.4.22
3.0899047851563E-6
Output for 5.4.21
2.8085708618164E-6
Output for 5.4.20
3.049373626709E-6
Output for 5.4.19
2.2792816162109E-6
Output for 5.3.28, 5.4.18
3.359317779541E-6
Output for 5.4.17
2.3388862609863E-6
Output for 5.4.16
3.2997131347656E-6
Output for 5.4.15
2.4509429931641E-6
Output for 5.4.14
2.2697448730469E-6
Output for 5.4.13
2.4199485778809E-6
Output for 5.4.12
3.0708312988281E-6
Output for 5.4.11
3.3402442932129E-6
Output for 5.4.9
3.509521484375E-6
Output for 5.4.8
3.6191940307617E-6
Output for 5.4.7
3.1590461730957E-6
Output for 5.4.6
2.5081634521484E-6
Output for 5.4.4
3.5810470581055E-6
Output for 5.4.2
2.3603439331055E-6
Output for 5.3.29
2.3913383483887E-6
Output for 5.3.12, 5.3.27
2.5105476379395E-6
Output for 5.3.26
3.361701965332E-6
Output for 5.3.25
2.6082992553711E-6
Output for 5.3.24
3.1685829162598E-6
Output for 5.3.22
3.7908554077148E-6
Output for 5.3.21
2.5582313537598E-6
Output for 5.3.20
3.5905838012695E-6
Output for 5.3.19
4.7206878662109E-6
Output for 5.3.18
4.6086311340332E-6
Output for 5.3.17
3.8409233093262E-6
Output for 5.3.16
3.2305717468262E-6
Output for 5.3.15
4.3988227844238E-6
Output for 5.3.14
3.3688545227051E-6
Output for 5.3.13
2.9897689819336E-6
Output for 5.3.11
2.4604797363281E-6
Output for 5.3.9
3.4379959106445E-6
Output for 5.3.8
2.8109550476074E-6
Output for 5.3.7
2.439022064209E-6
Output for 5.3.6
3.4904479980469E-6
Output for 5.3.5
3.6406517028809E-6
Output for 5.3.3
2.5510787963867E-6
Output for 5.3.1
2.5296211242676E-6
Output for 5.3.0
3.8504600524902E-6
Output for 5.2.17
4.3892860412598E-6
Output for 5.2.16
4.279613494873E-6
Output for 5.2.15
4.2986869812012E-6
Output for 5.2.14
3.659725189209E-6
Output for 5.2.13
4.3797492980957E-6
Output for 5.2.12
2.6702880859375E-6
Output for 5.2.11
4.4608116149902E-6
Output for 5.2.10
2.7585029602051E-6
Output for 5.2.9
4.3296813964844E-6
Output for 5.2.8
2.7608871459961E-6
Output for 5.2.7
5.0091743469238E-6
Output for 5.2.5
4.1890144348145E-6
Output for 5.2.4
5.0210952758789E-6
Output for 5.2.3
4.730224609375E-6
Output for 5.2.2
4.8303604125977E-6
Output for 5.2.1
4.7421455383301E-06
Output for 5.2.0
4.4989585876465E-06
Output for 5.1.6
4.9495697021484E-06
Output for 5.1.5
3.7813186645508E-06
Output for 5.1.4
3.8313865661621E-06
Output for 5.1.3
5.500316619873E-06
Output for 5.1.2
3.9815902709961E-06
Output for 5.1.1
5.5408477783203E-06
Output for 5.1.0
6.561279296875E-06
Output for 5.0.5
8.8214874267578E-06
Output for 5.0.4
5.800724029541E-06
Output for 5.0.3
6.1702728271484E-06
Output for 5.0.2
7.4195861816406E-06
Output for 5.0.1
6.5517425537109E-06
Output for 5.0.0
8.6593627929688E-06
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/VLGHu 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/VLGHu 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/VLGHu on line 4
Process exited with code 255.