3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { function register() { if (!function_exists('test_init')) { function test_init() { echo 'Initializing library'.PHP_EOL; } } } } $test = new test; $test->register(); test_init(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wd1nD
function name:  (null)
number of ops:  8
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_METHOD_CALL                                         !0, 'register'
          4        DO_FCALL                                      0          
   14     5        INIT_FCALL_BY_NAME                                       'test_init'
          6        DO_FCALL                                      0          
   15     7      > RETURN                                                   1

Class test:
Function register:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/Wd1nD
function name:  register
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'test_init'
          2        DO_ICALL                                         $0      
          3        BOOL_NOT                                         ~1      $0
          4      > JMPZ                                                     ~1, ->6
    5     5    >   DECLARE_FUNCTION                                         'test_init'
    9     6    > > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wd1nD
function name:  test_init
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'Initializing+library%0A'
    7     1      > RETURN                                                   null

End of Dynamic Function 0

End of function register

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.93 ms | 1445 KiB | 14 Q