3v4l.org

run code in 500+ PHP versions simultaneously
<?php function cmp(& $reference, & $value) { $tmp = & $reference; $reference = uniqid(mt_rand()); $isReference = ($value === $reference); $reference = & $tmp; return $isReference; } $value = uniqid(); $reference = & $value; var_dump(cmp($reference, $value)); $value = new \exception(); var_dump(cmp($reference, $value)); var_dump(cmp($reference, $value = new \exception()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UrMbA
function name:  (null)
number of ops:  32
compiled vars:  !0 = $value, !1 = $reference
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                                   'uniqid'
          1        DO_ICALL                                             $2      
          2        ASSIGN                                                       !0, $2
   13     3        ASSIGN_REF                                                   !1, !0
   14     4        INIT_FCALL                                                   'var_dump'
          5        INIT_FCALL                                                   'cmp'
          6        SEND_REF                                                     !1
          7        SEND_REF                                                     !0
          8        DO_FCALL                                          0  $5      
          9        SEND_VAR                                                     $5
         10        DO_ICALL                                                     
   16    11        NEW                                                  $7      'exception'
         12        DO_FCALL                                          0          
         13        ASSIGN                                                       !0, $7
   17    14        INIT_FCALL                                                   'var_dump'
         15        INIT_FCALL                                                   'cmp'
         16        SEND_REF                                                     !1
         17        SEND_REF                                                     !0
         18        DO_FCALL                                          0  $10     
         19        SEND_VAR                                                     $10
         20        DO_ICALL                                                     
   19    21        INIT_FCALL                                                   'var_dump'
         22        INIT_FCALL                                                   'cmp'
         23        SEND_REF                                                     !1
         24        NEW                                                  $12     'exception'
         25        DO_FCALL                                          0          
         26        ASSIGN                                               ~14     !0, $12
         27        SEND_VAL_EX                                                  ~14
         28        DO_FCALL                                          0  $15     
         29        SEND_VAR                                                     $15
         30        DO_ICALL                                                     
         31      > RETURN                                                       1

Function cmp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UrMbA
function name:  cmp
number of ops:  14
compiled vars:  !0 = $reference, !1 = $value, !2 = $tmp, !3 = $isReference
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    4     2        ASSIGN_REF                                                   !2, !0
    5     3        INIT_FCALL                                                   'uniqid'
          4        INIT_FCALL                                                   'mt_rand'
          5        DO_ICALL                                             $5      
          6        SEND_VAR                                                     $5
          7        DO_ICALL                                             $6      
          8        ASSIGN                                                       !0, $6
    6     9        IS_IDENTICAL                                         ~8      !1, !0
         10        ASSIGN                                                       !3, ~8
    7    11        ASSIGN_REF                                                   !0, !2
    9    12      > RETURN                                                       !3
   10    13*     > RETURN                                                       null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.58 ms | 2191 KiB | 19 Q