3v4l.org

run code in 300+ PHP versions simultaneously
<pre><?php $var1 = 'ccc'; $var2 = 'ccc'; echo "separate variables\n"; debug_zval_dump($var1, $var2); echo "Copying variable just adds references to the same value\n"; $copy = $var1; debug_zval_dump($var1, $copy); echo "Using a reference adds references to the same value \n"; $reference =& $var2; debug_zval_dump($var2, $reference); echo "Using a copy and a reference of the same value actually creates a clone \n"; $reference2 =& $var1; debug_zval_dump($var1, $copy, $reference2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lR3Wp
function name:  (null)
number of ops:  28
compiled vars:  !0 = $var1, !1 = $var2, !2 = $copy, !3 = $reference, !4 = $reference2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Cpre%3E'
    2     1        ASSIGN                                                   !0, 'ccc'
    3     2        ASSIGN                                                   !1, 'ccc'
    5     3        ECHO                                                     'separate+variables%0A'
    6     4        INIT_FCALL                                               'debug_zval_dump'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    9     8        ECHO                                                     'Copying+variable+just+adds+references+to+the+same+value%0A'
   10     9        ASSIGN                                                   !2, !0
   11    10        INIT_FCALL                                               'debug_zval_dump'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
   13    14        ECHO                                                     'Using+a+reference+adds+references+to+the+same+value+%0A'
   14    15        ASSIGN_REF                                               !3, !1
   15    16        INIT_FCALL                                               'debug_zval_dump'
         17        SEND_VAR                                                 !1
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
   17    20        ECHO                                                     'Using+a+copy+and+a+reference+of+the+same+value+actually+creates+a+clone+%0A'
   18    21        ASSIGN_REF                                               !4, !0
   19    22        INIT_FCALL                                               'debug_zval_dump'
         23        SEND_VAR                                                 !0
         24        SEND_VAR                                                 !2
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.89 ms | 1395 KiB | 15 Q