3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [[4, 3, 2, 1], [5, 6, 7, 8], [12, 11, 10, 9], [13, 14, 15, 16]]; function f($a){foreach($a as$i=>$y){foreach($y as$x=>$w){$r[]=$i&1?$w:array_reverse($y)[$x];}}return $r;} print_r(f($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DgDi8
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    6     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'f'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 21
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/DgDi8
function name:  f
number of ops:  24
compiled vars:  !0 = $a, !1 = $y, !2 = $i, !3 = $w, !4 = $x, !5 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1      > FE_RESET_R                                       $6      !0, ->21
          2    > > FE_FETCH_R                                       ~7      $6, !1, ->21
          3    >   ASSIGN                                                   !2, ~7
          4      > FE_RESET_R                                       $9      !1, ->19
          5    > > FE_FETCH_R                                       ~10     $9, !3, ->19
          6    >   ASSIGN                                                   !4, ~10
          7        BW_AND                                           ~13     !2, 1
          8      > JMPZ                                                     ~13, ->11
          9    >   QM_ASSIGN                                        ~14     !3
         10      > JMP                                                      ->16
         11    >   INIT_FCALL                                               'array_reverse'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $15     
         14        FETCH_DIM_R                                      ~16     $15, !4
         15        QM_ASSIGN                                        ~14     ~16
         16    >   ASSIGN_DIM                                               !5
         17        OP_DATA                                                  ~14
         18      > JMP                                                      ->5
         19    >   FE_FREE                                                  $9
         20      > JMP                                                      ->2
         21    >   FE_FREE                                                  $6
         22      > RETURN                                                   !5
         23*     > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.74 ms | 1403 KiB | 18 Q