3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NestedFunctions { public function fn1() { function nested_fn() { echo 'yay' . "\n"; } nested_fn(); } public function fn2() { function nested_fn() { echo 'yay' . "\n"; } nested_fn(); } } $nested = new NestedFunctions(); $nested->fn1(); $nested->fn2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WABfQ
function name:  (null)
number of ops:  8
compiled vars:  !0 = $nested
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'NestedFunctions'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_METHOD_CALL                                         !0, 'fn1'
          4        DO_FCALL                                      0          
   20     5        INIT_METHOD_CALL                                         !0, 'fn2'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function %00nested_fn%2Fin%2FWABfQ%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WABfQ
function name:  nested_fn
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'yay%0A'
          1      > RETURN                                                   null

End of function %00nested_fn%2Fin%2FWABfQ%3A7%240

Function %00nested_fn%2Fin%2FWABfQ%3A13%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WABfQ
function name:  nested_fn
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'yay%0A'
          1      > RETURN                                                   null

End of function %00nested_fn%2Fin%2FWABfQ%3A13%241

Class NestedFunctions:
Function fn1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WABfQ
function name:  fn1
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_FUNCTION                                         'nested_fn'
    8     1        INIT_FCALL_BY_NAME                                       'nested_fn'
          2        DO_FCALL                                      0          
    9     3      > RETURN                                                   null

End of function fn1

Function fn2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WABfQ
function name:  fn2
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_FUNCTION                                         'nested_fn'
   14     1        INIT_FCALL_BY_NAME                                       'nested_fn'
          2        DO_FCALL                                      0          
   15     3      > RETURN                                                   null

End of function fn2

End of class NestedFunctions.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.2 ms | 1395 KiB | 13 Q