3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 'x'; debug_zval_dump($a); b($a); function b($a){ debug_zval_dump($a); debug_zval_dump($a);//refcount=4 why not 3? }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gBUpU
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'x'
    3     1        INIT_FCALL                                               'debug_zval_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    4     4        INIT_FCALL_BY_NAME                                       'b'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    8     7      > RETURN                                                   1

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gBUpU
function name:  b
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'debug_zval_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    7     4        INIT_FCALL                                               'debug_zval_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
    8     7      > RETURN                                                   null

End of function b

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.25 ms | 1395 KiB | 15 Q