3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2Fg83R8%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g83R8
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%2Fg83R8%3A6%240

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

End of function bar

End of class Herp.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.36 ms | 1396 KiB | 15 Q