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 < 2; $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 5.4.26, 7.1.0
2 4.6014785766602E-5
Output for 5.2.9, 7.0.3, 7.0.14
2 7.2479248046875E-5
Output for 7.0.6
2 7.0929527282715E-5
Output for 5.4.3, 7.0.5
2 5.5074691772461E-5
Output for 5.2.11, 5.3.9, 5.4.22, 5.4.35, 7.0.4
2 5.4001808166504E-5
Output for 7.0.2
2 6.6399574279785E-5
Output for 7.0.1
2 6.7591667175293E-5
Output for 7.0.0
2 4.9591064453125E-5
Output for hhvm-3.12.0
2 7.4505805969238E-5
Output for hhvm-3.10.0
2 7.6532363891602E-5
Output for 5.6.21
2 2.2053718566895E-5
Output for 5.5.34, 5.6.13, 5.6.15, 5.6.20
2 3.6478042602539E-5
Output for 5.6.19
2 2.896785736084E-5
Output for 5.5.28, 5.6.18
2 2.4557113647461E-5
Output for 5.6.17
2 3.504753112793E-5
Output for 5.6.16
2 2.3007392883301E-5
Output for 5.6.14
2 3.1948089599609E-5
Output for 5.6.12
2 3.1590461730957E-5
Output for 5.6.11
2 2.9563903808594E-5
Output for 5.6.10
2 3.7550926208496E-5
Output for 5.5.30, 5.6.8 - 5.6.9
2 2.8014183044434E-5
Output for 5.6.7
2 3.0517578125E-5
Output for 5.5.35
2 3.7074089050293E-5
Output for 5.5.33
2 3.8027763366699E-5
Output for 5.5.32
2 2.5510787963867E-5
Output for 5.5.31
2 2.6941299438477E-5
Output for 5.5.29
2 3.4093856811523E-5
Output for 5.5.27
2 3.6954879760742E-5
Output for 5.5.26
2 3.7908554077148E-5
Output for 5.5.25
2 3.4928321838379E-5
Output for 5.4.31, 5.5.24
2 3.3974647521973E-5
Output for 5.3.4, 5.4.6, 5.4.45
2 6.1511993408203E-5
Output for 5.4.44
2 9.8586082458496E-5
Output for 5.4.43
2 9.453296661377E-5
Output for 5.4.42
2 7.2956085205078E-5
Output for 5.4.41
2 6.5445899963379E-5
Output for 5.4.40
2 0.00010442733764648
Output for 5.4.39
2 9.9062919616699E-5
Output for 5.4.38
2 8.4042549133301E-5
Output for 5.4.37
2 7.0452690124512E-5
Output for 5.2.4, 5.4.36
2 5.2571296691895E-5
Output for 5.4.34
2 6.3061714172363E-5
Output for 5.4.32
2 5.0544738769531E-5
Output for 5.4.30
2 4.8518180847168E-5
Output for 5.3.1, 5.3.27, 5.4.4, 5.4.14, 5.4.29
2 5.650520324707E-5
Output for 5.4.28
2 4.0054321289062E-5
Output for 5.4.27
2 4.3988227844238E-5
Output for 5.2.6, 5.4.19, 5.4.25
2 4.8995018005371E-5
Output for 5.4.24
2 6.9975852966309E-5
Output for 5.4.2, 5.4.21, 5.4.23
2 5.7458877563477E-5
Output for 5.4.5, 5.4.20
2 5.2928924560547E-5
Output for 5.2.3, 5.4.18
2 5.1975250244141E-5
Output for 5.3.26, 5.4.17
2 5.793571472168E-5
Output for 5.2.16, 5.4.16
2 5.6028366088867E-5
Output for 5.2.8, 5.3.8, 5.3.16, 5.4.15
2 5.9008598327637E-5
Output for 5.4.13
2 7.3432922363281E-5
Output for 5.3.0, 5.4.12
2 6.2942504882812E-5
Output for 5.4.11
2 6.3896179199219E-5
Output for 5.4.10
2 5.3048133850098E-5
Output for 5.2.12, 5.3.28, 5.4.9
2 6.2465667724609E-5
Output for 5.4.8
2 5.4478645324707E-5
Output for 5.2.10, 5.4.7
2 5.1498413085938E-5
Output for 5.4.1
2 6.6995620727539E-5
Output for 5.3.24, 5.4.0
2 5.5551528930664E-5
Output for 5.3.29
2 4.9471855163574E-5
Output for 5.2.17, 5.3.2, 5.3.25
2 5.8531761169434E-5
Output for 5.3.11, 5.3.23
2 6.8068504333496E-5
Output for 5.3.22
2 6.7472457885742E-5
Output for 5.3.21
2 6.1988830566406E-5
Output for 5.3.20
2 9.5605850219727E-5
Output for 5.3.19
2 7.3075294494629E-5
Output for 5.3.18
2 6.0439109802246E-5
Output for 5.3.17
2 6.5088272094727E-5
Output for 5.3.15
2 7.7486038208008E-5
Output for 5.3.14
2 5.805492401123E-5
Output for 5.3.13
2 6.103515625E-5
Output for 5.3.12
2 5.495548248291E-5
Output for 5.3.10
2 5.3524971008301E-5
Output for 5.3.7
2 5.948543548584E-5
Output for 5.3.6
2 5.6982040405273E-5
Output for 5.3.5
2 5.340576171875E-5
Output for 5.3.3
2 5.8412551879883E-5
Output for 5.2.15
2 6.401538848877E-5
Output for 5.2.14
2 5.7578086853027E-5
Output for 5.2.13
2 5.2452087402344E-5
Output for 5.2.7
2 4.9948692321777E-5
Output for 5.2.5
2 7.7962875366211E-5
Output for 5.2.2
2 9.2983245849609E-5
Output for 5.0.0, 5.2.1
2 5.2571296691895E-05
Output for 5.2.0
2 6.401538848877E-05
Output for 5.1.6
2 5.4597854614258E-05
Output for 5.1.5
2 5.8412551879883E-05
Output for 5.1.4
2 5.340576171875E-05
Output for 5.1.3
2 6.0081481933594E-05
Output for 5.1.2
2 5.5074691772461E-05
Output for 5.1.1
2 5.6982040405273E-05
Output for 5.1.0
2 6.3538551330566E-05
Output for 5.0.5
2 5.5909156799316E-05
Output for 5.0.4
2 5.1498413085938E-05
Output for 5.0.1, 5.0.3
2 5.3524971008301E-05
Output for 5.0.2
2 5.9008598327637E-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/KGbci 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/KGbci 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/KGbci on line 4
Process exited with code 255.