3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function __construct() { $this->a = "hello"; $this->b = "hi"; $this->val = "howdy"; $this->name = "Rob"; $val = "a"; echo $this->{$val}; // outputs "hello" echo "\n"; $val = "b"; echo $this->{$val}; // outputs "hi" echo "\n"; echo $this->val; //outputs "howdy" echo "\n"; echo $this->{"val"}; echo "\n"; echo $this->name; } } $foo = new foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e04As
function name:  (null)
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e04As
function name:  __construct
number of ops:  25
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN_OBJ                                               'a'
          1        OP_DATA                                                  'hello'
    6     2        ASSIGN_OBJ                                               'b'
          3        OP_DATA                                                  'hi'
    7     4        ASSIGN_OBJ                                               'val'
          5        OP_DATA                                                  'howdy'
    8     6        ASSIGN_OBJ                                               'name'
          7        OP_DATA                                                  'Rob'
   10     8        ASSIGN                                                   !0, 'a'
   11     9        FETCH_OBJ_R                                      ~6      !0
         10        ECHO                                                     ~6
   13    11        ECHO                                                     '%0A'
   15    12        ASSIGN                                                   !0, 'b'
   16    13        FETCH_OBJ_R                                      ~8      !0
         14        ECHO                                                     ~8
   18    15        ECHO                                                     '%0A'
   19    16        FETCH_OBJ_R                                      ~9      'val'
         17        ECHO                                                     ~9
   21    18        ECHO                                                     '%0A'
   22    19        FETCH_OBJ_R                                      ~10     'val'
         20        ECHO                                                     ~10
   24    21        ECHO                                                     '%0A'
   25    22        FETCH_OBJ_R                                      ~11     'name'
         23        ECHO                                                     ~11
   26    24      > RETURN                                                   null

End of function __construct

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.6 ms | 1395 KiB | 13 Q