3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var; echo 'before: '; var_dump($var); useRefs($var); echo 'after: '; var_dump($var); useRefs($var); echo 'last: '; var_dump($var); function useRefs(&$var) { if ($var === null) { $var = 'test'; } else { $var = null; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8etck
function name:  (null)
number of ops:  19
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'before%3A+'
          1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    5     4        INIT_FCALL_BY_NAME                                       'useRefs'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    6     7        ECHO                                                     'after%3A+'
          8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
    7    11        INIT_FCALL_BY_NAME                                       'useRefs'
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0          
    8    14        ECHO                                                     'last%3A+'
         15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
   17    18      > RETURN                                                   1

Function userefs:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8etck
function name:  useRefs
number of ops:  7
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->5
   13     3    >   ASSIGN                                                   !0, 'test'
          4      > JMP                                                      ->6
   15     5    >   ASSIGN                                                   !0, null
   17     6    > > RETURN                                                   null

End of function userefs

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162 ms | 1396 KiB | 15 Q