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]); var_dump(${$matches[2]}); $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/h2L12
function name:  (null)
number of ops:  28
compiled vars:  !0 = $a, !1 = $query, !2 = $_the, !3 = $matches, !4 = $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%5B%27test%27%5D%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                                      ~9      !3, 2
         11        SEND_VAL                                                 ~9
         12        DO_ICALL                                                 
    8    13        INIT_FCALL                                               'var_dump'
         14        FETCH_DIM_R                                      ~11     !3, 2
         15        FETCH_R                      local               ~12     ~11
         16        SEND_VAL                                                 ~12
         17        DO_ICALL                                                 
    9    18        INIT_FCALL                                               'preg_replace'
         19        SEND_VAL                                                 '%2F%28%7B%7B%5C%24%28.%2A%29%7D%7D%29%2F'
         20        FETCH_DIM_R                                      ~14     !3, 2
         21        FETCH_R                      local               ~15     ~14
         22        SEND_VAL                                                 ~15
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $16     
         25        ASSIGN                                                   !4, $16
   10    26        ECHO                                                     !4
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.42 ms | 1395 KiB | 19 Q