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) use ($tables) { return '`' . $tables[$match[1]] . '`.`' . $match[2] . '`'; }, $string); echo preg_replace_callback('#\$([\w]+)#', function($match) use ($selfTable) { return '`' . $selfTable . '`.`' . $match[1] . '`'; }, $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u3AkP
function name:  (null)
number of ops:  20
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%2Fu3AkP%3A16%240'
          6        BIND_LEXICAL                                             ~6, !1
   18     7        SEND_VAL                                                 ~6
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $7      
         10        ECHO                                                     $7
   19    11        INIT_FCALL                                               'preg_replace_callback'
         12        SEND_VAL                                                 '%23%5C%24%28%5B%5Cw%5D%2B%29%23'
         13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fu3AkP%3A19%241'
         14        BIND_LEXICAL                                             ~8, !0
   21    15        SEND_VAL                                                 ~8
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $9      
         18        ECHO                                                     $9
         19      > RETURN                                                   1

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

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

Function %00%7Bclosure%7D%2Fin%2Fu3AkP%3A19%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u3AkP
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $match, !1 = $selfTable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   20     2        CONCAT                                           ~2      '%60', !1
          3        CONCAT                                           ~3      ~2, '%60.%60'
          4        FETCH_DIM_R                                      ~4      !0, 1
          5        CONCAT                                           ~5      ~3, ~4
          6        CONCAT                                           ~6      ~5, '%60'
          7      > RETURN                                                   ~6
   21     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fu3AkP%3A19%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
228.38 ms | 1400 KiB | 15 Q