3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class B { protected static $b = 6; } class A { protected static $a = 5; public static function foo() { $f = function() { var_dump(__CLASS__); var_dump(@get_called_class()); var_dump($this); var_dump(parent::$b); }; $f(); } } A::bar(); $a = new A; A::foo();
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/qKEoM
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
   5     1        NOP                                                      
  18     2        INIT_STATIC_METHOD_CALL                                  'A', 'bar'
         3        DO_FCALL                                      0          
  20     4        NEW                                              $4      :-2
         5        DO_FCALL                                      0          
         6        ASSIGN                                                   !0, $4
  21     7        INIT_STATIC_METHOD_CALL                                  'A', 'foo'
         8        DO_FCALL                                      0          
         9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FqKEoM0x7fcde6ca4126:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/qKEoM
function name:  {closure}
number of ops:  19
compiled vars:  !0 = $this
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   9     0  E >   INIT_FCALL                                               'var_dump'
         1        SEND_VAL                                                 'A'
         2        DO_ICALL                                                 
  10     3        INIT_FCALL                                               'var_dump'
         4        BEGIN_SILENCE                                    ~2      
         5        INIT_FCALL                                               'get_called_class'
         6        DO_ICALL                                         $3      
         7        END_SILENCE                                              ~2
         8        SEND_VAR                                                 $3
         9        DO_ICALL                                                 
  11    10        INIT_FCALL                                               'var_dump'
        11        SEND_VAR                                                 !0
        12        DO_ICALL                                                 
  12    13        INIT_FCALL                                               'var_dump'
        14        FETCH_CLASS                                 514  :6      
        15        FETCH_R                      static member       $7      'b'
        16        SEND_VAR                                                 $7
        17        DO_ICALL                                                 
  13    18      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FqKEoM0x7fcde6ca4126

Class B: [no user functions]
Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/qKEoM
function name:  foo
number of ops:  5
compiled vars:  !0 = $f
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   8     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqKEoM0x7fcde6ca4126'
  13     1        ASSIGN                                                   !0, ~1
  15     2        INIT_DYNAMIC_CALL                                        !0
         3        DO_FCALL                                      0          
  16     4      > RETURN                                                   null

End of function foo

End of class A.

Generated using Vulcan Logic Dumper, using php 7.2.0