3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [1,2,3,4]; foreach($a as &$num) {} echo implode(',',$a).PHP_EOL; // 1,2,3 var_dump($a); foreach($a as $num) {echo $num;} var_dump($num); var_dump($a); echo implode(',',$a).PHP_EOL; // 1,2,2
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
Branch analysis from position: 4
filename:       /in/2fvRJ
function name:  (null)
number of ops:  32
compiled vars:  !0 = $a, !1 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_RW                                      $3      !0, ->4
          2    > > FE_FETCH_RW                                              $3, !1, ->4
          3    > > JMP                                                      ->2
          4    >   FE_FREE                                                  $3
    6     5        INIT_FCALL                                               'implode'
          6        SEND_VAL                                                 '%2C'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        CONCAT                                           ~5      $4, '%0A'
         10        ECHO                                                     ~5
    8    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
    9    14      > FE_RESET_R                                       $7      !0, ->18
         15    > > FE_FETCH_R                                               $7, !1, ->18
         16    >   ECHO                                                     !1
         17      > JMP                                                      ->15
         18    >   FE_FREE                                                  $7
   10    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
   11    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
   12    25        INIT_FCALL                                               'implode'
         26        SEND_VAL                                                 '%2C'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $10     
         29        CONCAT                                           ~11     $10, '%0A'
         30        ECHO                                                     ~11
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.67 ms | 1401 KiB | 17 Q