3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fileContent = '12em\n1.3 em'; echo preg_replace_callback('/([0-9,-\.]+)\s*(em)/', 'replace_em', $fileContent); function replace_em($value) { return $value[0] * 123 . 'em'; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LAHmC
function name:  (null)
number of ops:  8
compiled vars:  !0 = $fileContent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '12em%5Cn1.3+em'
    3     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%28%5B0-9%2C-%5C.%5D%2B%29%5Cs%2A%28em%29%2F'
          3        SEND_VAL                                                 'replace_em'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
    7     7      > RETURN                                                   1

Function replace_em:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LAHmC
function name:  replace_em
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_DIM_R                                      ~1      !0, 0
          2        MUL                                              ~2      ~1, 123
          3        CONCAT                                           ~3      ~2, 'em'
          4      > RETURN                                                   ~3
    7     5*     > RETURN                                                   null

End of function replace_em

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.05 ms | 1394 KiB | 15 Q