3v4l.org

run code in 300+ PHP versions simultaneously
<?php function embolden($needle, $haystack) { $needle = str_split($needle); foreach ($needle as &$l) { $l = preg_quote($l); } unset($l); $needle = implode('[^0-9]*', $needle); return preg_replace('(' . $needle . ')', '<b>$0</b>', $haystack); } echo embolden('1234', '(123) 456-7890');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dbnH2
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'embolden'
          1        SEND_VAL                                                 '1234'
          2        SEND_VAL                                                 '%28123%29+456-7890'
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function embolden:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
2 jumps found. (Code = 126) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/dbnH2
function name:  embolden
number of ops:  29
compiled vars:  !0 = $needle, !1 = $haystack, !2 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'str_split'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
    5     6      > FE_RESET_RW                                      $5      !0, ->13
          7    > > FE_FETCH_RW                                              $5, !2, ->13
    6     8    >   INIT_FCALL                                               'preg_quote'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !2, $6
    5    12      > JMP                                                      ->7
         13    >   FE_FREE                                                  $5
    8    14        UNSET_CV                                                 !2
    9    15        INIT_FCALL                                               'implode'
         16        SEND_VAL                                                 '%5B%5E0-9%5D%2A'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $8      
         19        ASSIGN                                                   !0, $8
   10    20        INIT_FCALL                                               'preg_replace'
         21        CONCAT                                           ~10     '%28', !0
         22        CONCAT                                           ~11     ~10, '%29'
         23        SEND_VAL                                                 ~11
         24        SEND_VAL                                                 '%3Cb%3E%240%3C%2Fb%3E'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                         $12     
         27      > RETURN                                                   $12
   11    28*     > RETURN                                                   null

End of function embolden

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.88 ms | 1399 KiB | 22 Q