3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'say hello to @elise and @john'; function replace_at_symbol($matches){ str_replace("@", "", $matches[0]); return '<a href="/profile/'.$matches[0].'">'.$matches[0].'</a>';} $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/AQEOa
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/AQEOa
function name:  replace_at_symbol
number of ops:  15
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '%40'
          3        SEND_VAL                                                 ''
          4        FETCH_DIM_R                                      ~1      !0, 0
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                                 
    7     7        FETCH_DIM_R                                      ~3      !0, 0
          8        CONCAT                                           ~4      '%3Ca+href%3D%22%2Fprofile%2F', ~3
          9        CONCAT                                           ~5      ~4, '%22%3E'
         10        FETCH_DIM_R                                      ~6      !0, 0
         11        CONCAT                                           ~7      ~5, ~6
         12        CONCAT                                           ~8      ~7, '%3C%2Fa%3E'
         13      > RETURN                                                   ~8
         14*     > RETURN                                                   null

End of function replace_at_symbol

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.75 ms | 1387 KiB | 17 Q