3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a= & $_POST; $a=array(); function isRef($var) { $info = getZvalRefCountInfo($var); return (boolean) $info['is_ref']; } function getZvalRefCountInfo($var) { ob_start(); xdebug_debug_zval($var); $info = ob_get_clean(); preg_match('(: \(refcount=(\d+), is_ref=(\d+)\))', $info, $match); return array('refcount' => $match[1], 'is_ref' => $match[2]); } var_dump(isRef($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Em4S
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $1      '_POST'
          1        ASSIGN_REF                                               !0, $1
    4     2        ASSIGN                                                   !0, <array>
   19     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'isref'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function isref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Em4S
function name:  isRef
number of ops:  9
compiled vars:  !0 = $var, !1 = $info
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL_BY_NAME                                       'getZvalRefCountInfo'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !1, $2
    8     5        FETCH_DIM_R                                      ~4      !1, 'is_ref'
          6        BOOL                                             ~5      ~4
          7      > RETURN                                                   ~5
    9     8*     > RETURN                                                   null

End of function isref

Function getzvalrefcountinfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Em4S
function name:  getZvalRefCountInfo
number of ops:  20
compiled vars:  !0 = $var, !1 = $info, !2 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'ob_start'
          2        DO_ICALL                                                 
   13     3        INIT_FCALL_BY_NAME                                       'xdebug_debug_zval'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
   14     6        INIT_FCALL                                               'ob_get_clean'
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
   15     9        INIT_FCALL                                               'preg_match'
         10        SEND_VAL                                                 '%28%3A+%5C%28refcount%3D%28%5Cd%2B%29%2C+is_ref%3D%28%5Cd%2B%29%5C%29%29'
         11        SEND_VAR                                                 !1
         12        SEND_REF                                                 !2
         13        DO_ICALL                                                 
   16    14        FETCH_DIM_R                                      ~8      !2, 1
         15        INIT_ARRAY                                       ~9      ~8, 'refcount'
         16        FETCH_DIM_R                                      ~10     !2, 2
         17        ADD_ARRAY_ELEMENT                                ~9      ~10, 'is_ref'
         18      > RETURN                                                   ~9
   17    19*     > RETURN                                                   null

End of function getzvalrefcountinfo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.5 ms | 1403 KiB | 22 Q