3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'say hello to @elise and @john'; function replace_at_symbol($matches){ return "".$matches[0].""; } $output = preg_replace_callback("/([@][a-zA-Z-0-9]+)/", "replace_at_symbol", $text); echo $output; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Dp6U3
function name:  (null)
number of ops:  9
compiled vars:  !0 = $text, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'say+hello+to+%40elise+and+%40john'
    9     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%28%5B%40%5D%5Ba-zA-Z-0-9%5D%2B%29%2F'
          3        SEND_VAL                                                 'replace_at_symbol'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
   10     7        ECHO                                                     !1
   12     8      > RETURN                                                   1

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

End of function replace_at_symbol

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.54 ms | 1395 KiB | 15 Q