3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits = [ 'apple', 'banana' , 'cherry' ]; foreach ( $fruits as $fruit ) { // The $fruit just gets overwritten each time, so the array of $fruits never changes. $fruit = str_rot13( $fruit ); } print_r( $fruits ); foreach ( $fruits as $key => $fruit ) { // Now we're assigning the rotated string back to the original array. $fruits[ $key ] = str_rot13( $fruit ); } print_r( $fruits );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 8
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 21
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 8
filename:       /in/QMZl6
function name:  (null)
number of ops:  26
compiled vars:  !0 = $fruits, !1 = $fruit, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $4      !0, ->8
          2    > > FE_FETCH_R                                               $4, !1, ->8
    7     3    >   INIT_FCALL                                               'str_rot13'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
    5     7      > JMP                                                      ->2
          8    >   FE_FREE                                                  $4
    9     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   14    12      > FE_RESET_R                                       $8      !0, ->21
         13    > > FE_FETCH_R                                       ~9      $8, !1, ->21
         14    >   ASSIGN                                                   !2, ~9
   16    15        INIT_FCALL                                               'str_rot13'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $12     
         18        ASSIGN_DIM                                               !0, !2
         19        OP_DATA                                                  $12
   14    20      > JMP                                                      ->13
         21    >   FE_FREE                                                  $8
   18    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.42 ms | 1015 KiB | 15 Q