3v4l.org

run code in 300+ PHP versions simultaneously
<?php function changeNames($people) { foreach ($people as $key => $person) { $people[$key]['name'] = strtoupper($person['name']); } return $people; } $myPeople = [ ['name' => 'foo'], ['name' => 'bar'] ]; $myPeople = changeNames($myPeople); var_dump($myPeople);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ff6rn
function name:  (null)
number of ops:  9
compiled vars:  !0 = $myPeople
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'changenames'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !0, $2
   15     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function changenames:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/ff6rn
function name:  changeNames
number of ops:  15
compiled vars:  !0 = $people, !1 = $person, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > FE_RESET_R                                       $3      !0, ->12
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->12
          3    >   ASSIGN                                                   !2, ~4
    5     4        INIT_FCALL                                               'strtoupper'
          5        FETCH_DIM_R                                      ~8      !1, 'name'
          6        SEND_VAL                                                 ~8
          7        DO_ICALL                                         $9      
          8        FETCH_DIM_W                                      $6      !0, !2
          9        ASSIGN_DIM                                               $6, 'name'
         10        OP_DATA                                                  $9
    4    11      > JMP                                                      ->2
         12    >   FE_FREE                                                  $3
    7    13      > RETURN                                                   !0
    8    14*     > RETURN                                                   null

End of function changenames

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.83 ms | 1399 KiB | 18 Q