3v4l.org

run code in 300+ PHP versions simultaneously
<?php $variableName = 'location->city'; // Create new variable with the name defined in variable $variableName ${$variableName} = 'Chicago'; //Outputs: string(7) "MyValue" var_dump($location->city); //Outputs: string(7) "MyValue" var_dump(${'location->city'});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bFgUl
function name:  (null)
number of ops:  11
compiled vars:  !0 = $variableName, !1 = $location, !2 = $location->city
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'location-%3Ecity'
    4     1        FETCH_W                      local               $4      !0
          2        ASSIGN                                                   $4, 'Chicago'
    6     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~6      !1, 'city'
          5        SEND_VAL                                                 ~6
          6        DO_ICALL                                                 
    8     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.52 ms | 1394 KiB | 15 Q