3v4l.org

run code in 300+ PHP versions simultaneously
<?php $selfTable = 'songs'; $tables = array( 'types' => 'layout_template_types' ); $string = '$content AS content, CONCAT_WS( ".", $types.alias, layout_templates.custom_item_id ), id'; echo preg_replace_callback('#\$([\w]+)\.([\w]+)#', function($match) { return '`' . $tables[$match[1]] . '`.`' . $match[2] . '`'; }, $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/csf16
function name:  (null)
number of ops:  11
compiled vars:  !0 = $selfTable, !1 = $tables, !2 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'songs'
    3     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN                                                   !2, '%24content+AS+content%2C%0A+++++++++++CONCAT_WS%28%0A%09%09+++++++%22.%22%2C%0A+++++++++++++++%24types.alias%2C%0A+++++++++++++++layout_templates.custom_item_id%0A++++++++++++%29%2C%0A%09%09%09id'
   16     3        INIT_FCALL                                               'preg_replace_callback'
          4        SEND_VAL                                                 '%23%5C%24%28%5B%5Cw%5D%2B%29%5C.%28%5B%5Cw%5D%2B%29%23'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fcsf16%3A16%240'
   18     6        SEND_VAL                                                 ~6
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $7      
          9        ECHO                                                     $7
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fcsf16%3A16%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/csf16
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $match, !1 = $tables
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        FETCH_DIM_R                                      ~2      !0, 1
          2        FETCH_DIM_R                                      ~3      !1, ~2
          3        CONCAT                                           ~4      '%60', ~3
          4        CONCAT                                           ~5      ~4, '%60.%60'
          5        FETCH_DIM_R                                      ~6      !0, 2
          6        CONCAT                                           ~7      ~5, ~6
          7        CONCAT                                           ~8      ~7, '%60'
          8      > RETURN                                                   ~8
   18     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fcsf16%3A16%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.62 ms | 1387 KiB | 15 Q