3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { public $a = " test a! "; static public $b = " test b! "; public function __toString() { return '[class a]'; } } $a = new a(); $b = "a"; $line = 0; echo $line++, $$b; echo $line++, $$b->a; echo $line++, $$b->b; // echo $line++, $$b::b; // ERROR
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/dUeoS
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $b, !2 = $line
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   NOP                                                      
  15     1        NEW                                              $4      :-6
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $4
  16     4        ASSIGN                                                   !1, 'a'
  18     5        ASSIGN                                                   !2, 0
  19     6        POST_INC                                         ~9      !2
         7        ECHO                                                     ~9
         8        FETCH_R                      local               $10     !1
         9        ECHO                                                     $10
  20    10        POST_INC                                         ~11     !2
        11        ECHO                                                     ~11
        12        FETCH_R                      local               $12     !1
        13        FETCH_OBJ_R                                      $13     $12, 'a'
        14        ECHO                                                     $13
  21    15        POST_INC                                         ~14     !2
        16        ECHO                                                     ~14
        17        FETCH_R                      local               $15     !1
        18        FETCH_OBJ_R                                      $16     $15, 'b'
        19        ECHO                                                     $16
        20      > RETURN                                                   1

Class a:
Function __tostring:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/dUeoS
function name:  __toString
number of ops:  2
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  11     0  E > > RETURN                                                   '%5Bclass+a%5D'
  12     1*     > RETURN                                                   null

End of function __tostring

End of class a.

Generated using Vulcan Logic Dumper, using php 7.2.0