3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestClass { public function baz() { echo "Worked!"; } } $foo = 'bam'; $bam = ['bar' => new TestClass()]; $output = $$foo; var_dump($$foo); // Correctly reads this var_dump(${$foo}['bar']); // Change $$foo to $output $$foo['bar']->baz(); // function getResult() { // return "string"; // } // echo getResult(){0};
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0C5up
function name:  (null)
number of ops:  21
compiled vars:  !0 = $foo, !1 = $bam, !2 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'bam'
    9     1        NEW                                              $4      'TestClass'
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~6      $4, 'bar'
          4        ASSIGN                                                   !1, ~6
   11     5        FETCH_R                      local               ~8      !0
          6        ASSIGN                                                   !2, ~8
   13     7        INIT_FCALL                                               'var_dump'
          8        FETCH_R                      local               ~10     !0
          9        SEND_VAL                                                 ~10
         10        DO_ICALL                                                 
   14    11        INIT_FCALL                                               'var_dump'
         12        FETCH_R                      local               ~12     !0
         13        FETCH_DIM_R                                      ~13     ~12, 'bar'
         14        SEND_VAL                                                 ~13
         15        DO_ICALL                                                 
   16    16        FETCH_R                      local               ~15     !0
         17        FETCH_DIM_R                                      ~16     ~15, 'bar'
         18        INIT_METHOD_CALL                                         ~16, 'baz'
         19        DO_FCALL                                      0          
   23    20      > RETURN                                                   1

Class TestClass:
Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0C5up
function name:  baz
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'Worked%21'
    5     1      > RETURN                                                   null

End of function baz

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.57 ms | 1395 KiB | 15 Q