3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dtArray = array(); $dtArray[] = new DateTime(); $dtArray[] = new DateTime(); foreach($dtArray as $value) { $value = null; } echo "object NOT reference: \n"; var_dump($dtArray); $dtArrayRef = array(); $dtArrayRef[] = new DateTime(); $dtArrayRef[] = new DateTime(); foreach($dtArrayRef as &$value) { $value = null; } echo "object REFERENCE: \n"; var_dump($dtArrayRef); $string = array(); $string[] = 'new DateTime();'; $string[] = 'new DateTime();'; foreach($string as $value) { $value = null; } echo "string NOT reference: \n"; var_dump($string);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 13
2 jumps found. (Code = 125) Position 1 = 28, Position 2 = 31
Branch analysis from position: 28
2 jumps found. (Code = 126) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 31
2 jumps found. (Code = 77) Position 1 = 42, Position 2 = 45
Branch analysis from position: 42
2 jumps found. (Code = 78) Position 1 = 43, Position 2 = 45
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
Branch analysis from position: 31
Branch analysis from position: 13
filename:       /in/OATWs
function name:  (null)
number of ops:  51
compiled vars:  !0 = $dtArray, !1 = $value, !2 = $dtArrayRef, !3 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        NEW                                              $6      'DateTime'
          2        DO_FCALL                                      0          
          3        ASSIGN_DIM                                               !0
          4        OP_DATA                                                  $6
    5     5        NEW                                              $9      'DateTime'
          6        DO_FCALL                                      0          
          7        ASSIGN_DIM                                               !0
          8        OP_DATA                                                  $9
   12     9      > FE_RESET_R                                       $11     !0, ->13
         10    > > FE_FETCH_R                                               $11, !1, ->13
   14    11    >   ASSIGN                                                   !1, null
   12    12      > JMP                                                      ->10
         13    >   FE_FREE                                                  $11
   17    14        ECHO                                                     'object+NOT+reference%3A+%0A'
   18    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
   20    18        ASSIGN                                                   !2, <array>
   21    19        NEW                                              $16     'DateTime'
         20        DO_FCALL                                      0          
         21        ASSIGN_DIM                                               !2
         22        OP_DATA                                                  $16
   22    23        NEW                                              $19     'DateTime'
         24        DO_FCALL                                      0          
         25        ASSIGN_DIM                                               !2
         26        OP_DATA                                                  $19
   29    27      > FE_RESET_RW                                      $21     !2, ->31
         28    > > FE_FETCH_RW                                              $21, !1, ->31
   31    29    >   ASSIGN                                                   !1, null
   29    30      > JMP                                                      ->28
         31    >   FE_FREE                                                  $21
   34    32        ECHO                                                     'object+REFERENCE%3A+%0A'
   35    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !2
         35        DO_ICALL                                                 
   38    36        ASSIGN                                                   !3, <array>
   39    37        ASSIGN_DIM                                               !3
         38        OP_DATA                                                  'new+DateTime%28%29%3B'
   40    39        ASSIGN_DIM                                               !3
         40        OP_DATA                                                  'new+DateTime%28%29%3B'
   43    41      > FE_RESET_R                                       $27     !3, ->45
         42    > > FE_FETCH_R                                               $27, !1, ->45
   45    43    >   ASSIGN                                                   !1, null
   43    44      > JMP                                                      ->42
         45    >   FE_FREE                                                  $27
   48    46        ECHO                                                     'string+NOT+reference%3A+%0A'
   49    47        INIT_FCALL                                               'var_dump'
         48        SEND_VAR                                                 !3
         49        DO_ICALL                                                 
         50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.66 ms | 1404 KiB | 15 Q