3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1,2); $query = 'found {{$_the.test}}'; $_the['test'] = 'var'; preg_match('/({{\$(.*)}})/',$query,$matches); var_dump($matches[2]); $parts = explode('.',$matches[2]); var_dump(${"$parts[0]"}[${$parts[1]}]); $new = preg_replace('/({{\$(.*)}})/',${$matches[2]},$query); echo $new;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JEO94
function name:  (null)
number of ops:  38
compiled vars:  !0 = $a, !1 = $query, !2 = $_the, !3 = $matches, !4 = $parts, !5 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 'found+%7B%7B%24_the.test%7D%7D'
    4     2        ASSIGN_DIM                                               !2, 'test'
          3        OP_DATA                                                  'var'
    6     4        INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%2F%28%7B%7B%5C%24%28.%2A%29%7D%7D%29%2F'
          6        SEND_VAR                                                 !1
          7        SEND_REF                                                 !3
          8        DO_ICALL                                                 
    7     9        INIT_FCALL                                               'var_dump'
         10        FETCH_DIM_R                                      ~10     !3, 2
         11        SEND_VAL                                                 ~10
         12        DO_ICALL                                                 
    8    13        INIT_FCALL                                               'explode'
         14        SEND_VAL                                                 '.'
         15        FETCH_DIM_R                                      ~12     !3, 2
         16        SEND_VAL                                                 ~12
         17        DO_ICALL                                         $13     
         18        ASSIGN                                                   !4, $13
    9    19        INIT_FCALL                                               'var_dump'
         20        FETCH_DIM_R                                      ~15     !4, 0
         21        CAST                                          6  ~16     ~15
         22        FETCH_DIM_R                                      ~18     !4, 1
         23        FETCH_R                      local               ~19     ~18
         24        FETCH_R                      local               ~17     ~16
         25        FETCH_DIM_R                                      ~20     ~17, ~19
         26        SEND_VAL                                                 ~20
         27        DO_ICALL                                                 
   10    28        INIT_FCALL                                               'preg_replace'
         29        SEND_VAL                                                 '%2F%28%7B%7B%5C%24%28.%2A%29%7D%7D%29%2F'
         30        FETCH_DIM_R                                      ~22     !3, 2
         31        FETCH_R                      local               ~23     ~22
         32        SEND_VAL                                                 ~23
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                         $24     
         35        ASSIGN                                                   !5, $24
   11    36        ECHO                                                     !5
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.68 ms | 1396 KiB | 21 Q