3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mac = '00:11:22:33:44:55'; $input = '233'; $regex = '('. implode(':*', str_split($input)) .')'; $mac = preg_replace('/'. $regex .'/', '<b>$1</b>', $mac); var_dump($mac);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qlZhi
function name:  (null)
number of ops:  24
compiled vars:  !0 = $mac, !1 = $input, !2 = $regex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '00%3A11%3A22%3A33%3A44%3A55'
    3     1        ASSIGN                                                   !1, '233'
    4     2        INIT_FCALL                                               'implode'
          3        SEND_VAL                                                 '%3A%2A'
          4        INIT_FCALL                                               'str_split'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        CONCAT                                           ~7      '%28', $6
         10        CONCAT                                           ~8      ~7, '%29'
         11        ASSIGN                                                   !2, ~8
    5    12        INIT_FCALL                                               'preg_replace'
         13        CONCAT                                           ~10     '%2F', !2
         14        CONCAT                                           ~11     ~10, '%2F'
         15        SEND_VAL                                                 ~11
         16        SEND_VAL                                                 '%3Cb%3E%241%3C%2Fb%3E'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $12     
         19        ASSIGN                                                   !0, $12
    7    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.48 ms | 1386 KiB | 21 Q