3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=Array ( 0 => Array ( "Title" => "La science des rĂªves", "Year" => "2006", "Director" => Array ( "Name" => "Michel Gondry", "BirthYear" => "1963", "BirthPlace" => "Versailles, Yvelines, France" ) ), 1 => Array ( "Title" => "Arizona Dream", "Year" => "1992", "Director" => Array ( "Name" => "Emir Kusturica", "BirthYear" => "1954", "BirthPlace" => "Sarajevo, Bosnia and Herzegovina, Yugoslavia" ) ) ); $ck=Array ( 0 => "Title", 1 => "Director.Name", 2 => "Director.BirthYear" ); $newarray=array(); $s=sizeof($arr); $ss=0; foreach($ck as $ck2) { while($ss<$s) { $k = explode(".",$ck2); if(sizeof($k) >1) array_push($newarray,$arr[$ss][$k[0]][$k[1]]); else array_push($newarray,$arr[$ss][$k[0]]); echo sizeof($k); $ss++; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 40
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 40
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 9
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 9
Branch analysis from position: 39
Branch analysis from position: 9
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 9
Branch analysis from position: 39
Branch analysis from position: 9
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/nMtEF
function name:  (null)
number of ops:  42
compiled vars:  !0 = $arr, !1 = $ck, !2 = $newarray, !3 = $s, !4 = $ss, !5 = $ck2, !6 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   33     1        ASSIGN                                                   !1, <array>
   41     2        ASSIGN                                                   !2, <array>
   42     3        COUNT                                            ~10     !0
          4        ASSIGN                                                   !3, ~10
   43     5        ASSIGN                                                   !4, 0
   44     6      > FE_RESET_R                                       $13     !1, ->40
          7    > > FE_FETCH_R                                               $13, !5, ->40
   46     8    > > JMP                                                      ->37
   48     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '.'
         11        SEND_VAR                                                 !5
         12        DO_ICALL                                         $14     
         13        ASSIGN                                                   !6, $14
   49    14        COUNT                                            ~16     !6
         15        IS_SMALLER                                               1, ~16
         16      > JMPZ                                                     ~17, ->27
   50    17    >   INIT_FCALL                                               'array_push'
         18        SEND_REF                                                 !2
         19        FETCH_DIM_R                                      ~19     !6, 0
         20        FETCH_DIM_R                                      ~21     !6, 1
         21        FETCH_DIM_R                                      ~18     !0, !4
         22        FETCH_DIM_R                                      ~20     ~18, ~19
         23        FETCH_DIM_R                                      ~22     ~20, ~21
         24        SEND_VAL                                                 ~22
         25        DO_ICALL                                                 
         26      > JMP                                                      ->34
   52    27    >   INIT_FCALL                                               'array_push'
         28        SEND_REF                                                 !2
         29        FETCH_DIM_R                                      ~25     !6, 0
         30        FETCH_DIM_R                                      ~24     !0, !4
         31        FETCH_DIM_R                                      ~26     ~24, ~25
         32        SEND_VAL                                                 ~26
         33        DO_ICALL                                                 
   53    34    >   COUNT                                            ~28     !6
         35        ECHO                                                     ~28
   54    36        PRE_INC                                                  !4
   46    37    >   IS_SMALLER                                               !4, !3
         38      > JMPNZ                                                    ~30, ->9
   44    39    > > JMP                                                      ->7
         40    >   FE_FREE                                                  $13
   56    41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.37 ms | 1400 KiB | 17 Q