3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { function y() { function z(){ echo 'Hello world'; } } } $x = new x; var_dump(function_exists('z')); $x-y(); var_dump(function_exists('z'), z());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kPAjP
function name:  (null)
number of ops:  23
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'x'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'function_exists'
          5        SEND_VAL                                                 'z'
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   13     9        INIT_FCALL_BY_NAME                                       'y'
         10        DO_FCALL                                      0  $6      
         11        SUB                                              ~7      !0, $6
         12        FREE                                                     ~7
   14    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'function_exists'
         15        SEND_VAL                                                 'z'
         16        DO_ICALL                                         $8      
         17        SEND_VAR                                                 $8
         18        INIT_FCALL_BY_NAME                                       'z'
         19        DO_FCALL                                      0  $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

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

End of function %00z%2Fin%2FkPAjP%3A7%240

Class x:
Function y:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kPAjP
function name:  y
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   DECLARE_FUNCTION                                         'z'
    8     1      > RETURN                                                   null

End of function y

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.33 ms | 1396 KiB | 17 Q