3v4l.org

run code in 300+ PHP versions simultaneously
<?php $temp = array ( 0 => array( 0 => "a" ), 1 => array( 0 => "b", 1 => "c" ), "a" => array( "b" => "d" ) ); echo "<pre>"; print_r($arr); $new_arr = array(); foreach ($temp as $key => $value) { if(count($value)>1) $new_arr[$key] = $value; else { $new_arr[$key] = $value[0]; } } print_r($new_arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/3EfEN
function name:  (null)
number of ops:  24
compiled vars:  !0 = $temp, !1 = $arr, !2 = $new_arr, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ECHO                                                     '%3Cpre%3E'
          2        INIT_FCALL                                               'print_r'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                                 
   16     5        ASSIGN                                                   !2, <array>
   18     6      > FE_RESET_R                                       $8      !0, ->19
          7    > > FE_FETCH_R                                       ~9      $8, !3, ->19
          8    >   ASSIGN                                                   !4, ~9
   19     9        COUNT                                            ~11     !3
         10        IS_SMALLER                                               1, ~11
         11      > JMPZ                                                     ~12, ->15
   20    12    >   ASSIGN_DIM                                               !2, !4
         13        OP_DATA                                                  !3
         14      > JMP                                                      ->18
   23    15    >   FETCH_DIM_R                                      ~15     !3, 0
         16        ASSIGN_DIM                                               !2, !4
         17        OP_DATA                                                  ~15
   18    18    > > JMP                                                      ->7
         19    >   FE_FREE                                                  $8
   26    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.05 ms | 1400 KiB | 15 Q