3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function blah() { var_dump(get_called_class()); $foo = function(){ var_dump(get_called_class()); }; $foo(); } } class Bar extends Foo { } Foo::blah(); Bar::blah();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CfGpX
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                  'Foo', 'blah'
          1        DO_FCALL                                      0          
   22     2        INIT_STATIC_METHOD_CALL                                  'Bar', 'blah'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FCfGpX%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CfGpX
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        GET_CALLED_CLASS                                 ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   10     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FCfGpX%3A8%240

Class Foo:
Function blah:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CfGpX
function name:  blah
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'var_dump'
          1        GET_CALLED_CLASS                                 ~1      
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
    8     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FCfGpX%3A8%240'
          5        ASSIGN                                                   !0, ~3
   12     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0          
   13     8      > RETURN                                                   null

End of function blah

End of class Foo.

Class Bar:
Function blah:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CfGpX
function name:  blah
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'var_dump'
          1        GET_CALLED_CLASS                                 ~1      
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
    8     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FCfGpX%3A8%240'
          5        ASSIGN                                                   !0, ~3
   12     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0          
   13     8      > RETURN                                                   null

End of function blah

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.3 ms | 1396 KiB | 15 Q