3v4l.org

run code in 300+ PHP versions simultaneously
<?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;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
Branch analysis from position: 6
filename:       /in/YpA0s
function name:  (null)
number of ops:  21
compiled vars:  !0 = $start, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 1
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
   20     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->10
   21     6    >   INIT_STATIC_METHOD_CALL                                  'Chat', 'linkifyMessage'
          7        SEND_VAL                                                 'Guckt+mal+das+Update%3A+http%3A%2F%2Fforum.freewar.de%2Fviewtopic.php%3Ff%3D8%26t%3D52663'
          8        DO_FCALL                                      0          
   20     9        PRE_INC                                                  !1
         10    >   IS_SMALLER                                               !1, 10
         11      > JMPNZ                                                    ~7, ->6
   24    12    >   ECHO                                                     !1
   25    13        ECHO                                                     '%0A'
   26    14        INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $8      
         17        SUB                                              ~9      $8, !0
         18        DIV                                              ~10     ~9, !1
         19        ECHO                                                     ~10
         20      > RETURN                                                   1

Class Chat:
Function linkifymessage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 31
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 31
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/YpA0s
function name:  linkifyMessage
number of ops:  34
compiled vars:  !0 = $message, !1 = $threadUrl, !2 = $threadPattern, !3 = $matches, !4 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, 'http%3A%2F%2Fforum.freewar.de%2Fviewtopic.php%3F'
    6     2        INIT_FCALL                                               'preg_quote'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $6      
          5        CONCAT                                           ~7      '%40', $6
          6        CONCAT                                           ~8      ~7, 'f%3D%28%5Cd%2B%29%26t%3D%28%5Cd%2B%29%28%28%26p%3D%28%5Cd%2B%29%28%23p%28%5Cd%2B%29%29%3F%29%7C%26view%3Dunread%28%23unread%29%3F%29%3F%40i'
          7        ASSIGN                                                   !2, ~8
    8     8        INIT_FCALL                                               'preg_match_all'
          9        SEND_VAR                                                 !2
         10        SEND_VAR                                                 !0
         11        SEND_REF                                                 !3
         12        SEND_VAL                                                 2
         13        DO_ICALL                                                 
   10    14      > FE_RESET_R                                       $11     !3, ->31
         15    > > FE_FETCH_R                                               $11, !4, ->31
   11    16    >   INIT_FCALL                                               'str_replace'
         17        FETCH_DIM_R                                      ~12     !4, 0
         18        SEND_VAL                                                 ~12
         19        ROPE_INIT                                     5  ~16     '%3Ca+href%3D%27'
         20        FETCH_DIM_R                                      ~13     !4, 0
         21        ROPE_ADD                                      1  ~16     ~16, ~13
         22        ROPE_ADD                                      2  ~16     ~16, '%27+target%3D%27_blank%27%3E'
         23        FETCH_DIM_R                                      ~14     !4, 0
         24        ROPE_ADD                                      3  ~16     ~16, ~14
         25        ROPE_END                                      4  ~15     ~16, '%3C%2Fa%3E'
         26        SEND_VAL                                                 ~15
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $19     
         29        ASSIGN                                                   !0, $19
   10    30      > JMP                                                      ->15
         31    >   FE_FREE                                                  $11
   14    32      > RETURN                                                   !0
   15    33*     > RETURN                                                   null

End of function linkifymessage

End of class Chat.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.65 ms | 1400 KiB | 21 Q