3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function foo() { $f = function() { echo get_called_class()."\n"; echo static::class."\n"; }; $f(); } } class B extends A {} B::foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZXanl
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'foo'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FZXanl%3A4%240

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

End of function foo

End of class A.

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

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.91 ms | 1386 KiB | 13 Q