3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const A = 1; public function bar() { return function() { return function() { var_dump(static::A, self::A); }; }; } } class Herp extends Foo { const A=2; } $f = (new Herp())->bar(); $f = $f(); $f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9nPXB
function name:  (null)
number of ops:  11
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Herp'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'bar'
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
   19     5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !0, $5
   20     8        INIT_DYNAMIC_CALL                                        !0
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F9nPXB%3A6%240

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

End of function %00%7Bclosure%7D%2Fin%2F9nPXB%3A7%241

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9nPXB
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F9nPXB%3A6%240'
   10     1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function bar

End of class Foo.

Class Herp:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9nPXB
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F9nPXB%3A6%240'
   10     1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function bar

End of class Herp.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.35 ms | 1400 KiB | 15 Q