3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function a() { $f = static function() { return static::class; }; echo static::class, " vs ", $f(), PHP_EOL; } } class B extends A {} $b = new B; $b->a();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b6eqZ
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_METHOD_CALL                                         !0, 'a'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fb6eqZ%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b6eqZ
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_CLASS_NAME                                 ~0      
          1      > RETURN                                                   ~0
    7     2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fb6eqZ%3A5%240

Class A:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b6eqZ
function name:  a
number of ops:  10
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fb6eqZ%3A5%240'
          1        ASSIGN                                                   !0, ~1
    8     2        FETCH_CLASS_NAME                                 ~3      
          3        ECHO                                                     ~3
          4        ECHO                                                     '+vs+'
          5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
          8        ECHO                                                     '%0A'
    9     9      > RETURN                                                   null

End of function a

End of class A.

Class B:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b6eqZ
function name:  a
number of ops:  10
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fb6eqZ%3A5%240'
          1        ASSIGN                                                   !0, ~1
    8     2        FETCH_CLASS_NAME                                 ~3      
          3        ECHO                                                     ~3
          4        ECHO                                                     '+vs+'
          5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
          8        ECHO                                                     '%0A'
    9     9      > RETURN                                                   null

End of function a

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.32 ms | 1386 KiB | 13 Q