3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { public $username = 'user'; public $test; } class Test { public $here = 'here'; } $user = new User; $test = new Test; $user->test = $test; $string = 'username'; var_dump($user->$string); echo '<br>'; $string = 'test'; var_dump($user->test); echo '<br>'; $string = 'test->here'; echo $user[$string];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TRKpr
function name:  (null)
number of ops:  24
compiled vars:  !0 = $user, !1 = $test, !2 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $3      'User'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   13     3        NEW                                              $6      'Test'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   15     6        ASSIGN_OBJ                                               !0, 'test'
          7        OP_DATA                                                  !1
   17     8        ASSIGN                                                   !2, 'username'
   18     9        INIT_FCALL                                               'var_dump'
         10        FETCH_OBJ_R                                      ~11     !0, !2
         11        SEND_VAL                                                 ~11
         12        DO_ICALL                                                 
   19    13        ECHO                                                     '%3Cbr%3E'
   21    14        ASSIGN                                                   !2, 'test'
   22    15        INIT_FCALL                                               'var_dump'
         16        FETCH_OBJ_R                                      ~14     !0, 'test'
         17        SEND_VAL                                                 ~14
         18        DO_ICALL                                                 
   23    19        ECHO                                                     '%3Cbr%3E'
   25    20        ASSIGN                                                   !2, 'test-%3Ehere'
   26    21        FETCH_DIM_R                                      ~17     !0, !2
         22        ECHO                                                     ~17
         23      > RETURN                                                   1

Class User: [no user functions]
Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.78 ms | 1395 KiB | 15 Q