3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function f1(){ self::$f2 = static::f2(); } protected static function f2() { var_dump(static::class); // returns B on the local machine and on the remote server $f3 = function () { var_dump(static::class); // returns B on the local machine and returns A on the remote server $data = static::f4(); }; } } class B extends A{} self::$B = B::instance();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWEdP
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'instance'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN_STATIC_PROP                                       'B'
          3        OP_DATA                                                  $1
          4      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FGWEdP%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWEdP
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_CLASS_NAME                                 ~1      
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   18     4        INIT_STATIC_METHOD_CALL                                  'f4'
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !0, $3
   20     7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FGWEdP%3A15%240

Class A:
Function f1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWEdP
function name:  f1
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_STATIC_METHOD_CALL                                  'f2'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN_STATIC_PROP                                       'f2'
          3        OP_DATA                                                  $1
    9     4      > RETURN                                                   null

End of function f1

Function f2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWEdP
function name:  f2
number of ops:  7
compiled vars:  !0 = $f3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_CLASS_NAME                                 ~1      
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   15     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGWEdP%3A15%240'
          5        ASSIGN                                                   !0, ~3
   22     6      > RETURN                                                   null

End of function f2

End of class A.

Class B:
Function f1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWEdP
function name:  f1
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_STATIC_METHOD_CALL                                  'f2'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN_STATIC_PROP                                       'f2'
          3        OP_DATA                                                  $1
    9     4      > RETURN                                                   null

End of function f1

Function f2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWEdP
function name:  f2
number of ops:  7
compiled vars:  !0 = $f3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_CLASS_NAME                                 ~1      
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   15     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGWEdP%3A15%240'
          5        ASSIGN                                                   !0, ~3
   22     6      > RETURN                                                   null

End of function f2

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.58 ms | 1400 KiB | 15 Q