3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.43 ms | 1392 KiB | 13 Q