3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const A = 1; public function bar() { return function() { var_dump(static::A); var_dump(self::A); }; } } class Herp extends Foo { const A=2; } $f = (new Herp())->bar(); $f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gdRDN
function name:  (null)
number of ops:  8
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          
          7      > RETURN                                                   1

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

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

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gdRDN
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%2FgdRDN%3A6%240'
    9     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/gdRDN
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%2FgdRDN%3A6%240'
    9     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:
149.94 ms | 1396 KiB | 15 Q