3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { function __construct() { $this->a = "hello"; $this->b = "hi"; $this->val = "howdy"; $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"}; } } $foo = new foo();
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/UdeTq
function name:  (null)
number of ops:  5
compiled vars:  !0 = $foo
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
  26     1        NEW                                              $2      :-5
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $2
         4      > RETURN                                                   1

Class foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/UdeTq
function name:  __construct
number of ops:  20
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'
   9     6        ASSIGN                                                   !0, 'a'
  10     7        FETCH_OBJ_R                                      $5      !0
         8        ECHO                                                     $5
  12     9        ECHO                                                     '%0A'
  14    10        ASSIGN                                                   !0, 'b'
  15    11        FETCH_OBJ_R                                      $7      !0
        12        ECHO                                                     $7
  17    13        ECHO                                                     '%0A'
  18    14        FETCH_OBJ_R                                      $8      'val'
        15        ECHO                                                     $8
  20    16        ECHO                                                     '%0A'
  21    17        FETCH_OBJ_R                                      $9      'val'
        18        ECHO                                                     $9
  22    19      > RETURN                                                   null

End of function __construct

End of class foo.

Generated using Vulcan Logic Dumper, using php 7.1.0