3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2Fl6MB1%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l6MB1
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_STATIC_METHOD_CALL                                  'lorem'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    9     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fl6MB1%3A7%240

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

End of function lorem

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

End of function ipsum

End of class Foo.

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

End of function lorem

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

End of function ipsum

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.51 ms | 1400 KiB | 15 Q