3v4l.org

run code in 500+ PHP versions simultaneously
<?php error_reporting(E_ALL); class Foo { static function test() { var_dump(static::getValue()); $x = function () { var_dump(static::getValue()); }; $x(); } static function getValue() { return 'Foo'; } } class Bar extends Foo { static function getValue() { return 'Bar'; } } Foo::test(); Bar::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWVhT
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    1     0  E >   INIT_FCALL                                                   'error_reporting'
          1        SEND_VAL                                                     30719
          2        DO_ICALL                                                     
   33     3        INIT_STATIC_METHOD_CALL                                      'Foo', 'test'
          4        DO_FCALL                                          0          
   34     5        INIT_STATIC_METHOD_CALL                                      'Bar', 'test'
          6        DO_FCALL                                          0          
          7      > RETURN                                                       1

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWVhT
function name:  test
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_STATIC_METHOD_CALL                                      'getValue'
          2        DO_FCALL                                          0  $1      
          3        SEND_VAR                                                     $1
          4        DO_ICALL                                                     
   10     5        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
          6        ASSIGN                                                       !0, ~3
   13     7        INIT_DYNAMIC_CALL                                            !0
          8        DO_FCALL                                          0          
   14     9      > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWVhT
function name:  {closure:Foo::test():10}
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_STATIC_METHOD_CALL                                      'getValue'
          2        DO_FCALL                                          0  $0      
          3        SEND_VAR                                                     $0
          4        DO_ICALL                                                     
   12     5      > RETURN                                                       null

End of Dynamic Function 0

End of function test

Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWVhT
function name:  getValue
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                       'Foo'
   19     1*     > RETURN                                                       null

End of function getvalue

End of class Foo.

Class Bar:
Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWVhT
function name:  getValue
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   28     0  E > > RETURN                                                       'Bar'
   29     1*     > RETURN                                                       null

End of function getvalue

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWVhT
function name:  test
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_STATIC_METHOD_CALL                                      'getValue'
          2        DO_FCALL                                          0  $1      
          3        SEND_VAR                                                     $1
          4        DO_ICALL                                                     
   10     5        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
          6        ASSIGN                                                       !0, ~3
   13     7        INIT_DYNAMIC_CALL                                            !0
          8        DO_FCALL                                          0          
   14     9      > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWVhT
function name:  {closure:Foo::test():10}
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_STATIC_METHOD_CALL                                      'getValue'
          2        DO_FCALL                                          0  $0      
          3        SEND_VAR                                                     $0
          4        DO_ICALL                                                     
   12     5      > RETURN                                                       null

End of Dynamic Function 0

End of function test

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
210.6 ms | 2874 KiB | 15 Q