3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array1 = array('id_0' => '2975', 'title_0' => 'first_title', 'amount_0' => '1', 'price_0' => 55, 'id_1' => '2975', 'title_1' => 'first_title', 'amount_1' => '1', 'price_1' => 55, 'id_2' => '2973', 'title_2' => 'second_title', 'amount_2' => '1', 'price_2' => 95, ); $res =array(); While(count($array1)){ $res[] = array_splice($array1, 0,4); } Var_dump($res);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
Branch analysis from position: 3
filename:       /in/7Gt5k
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array1, !1 = $res
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1        ASSIGN                                                       !1, <array>
    6     2      > JMP                                                          ->10
    7     3    >   INIT_FCALL                                                   'array_splice'
          4        SEND_REF                                                     !0
          5        SEND_VAL                                                     0
          6        SEND_VAL                                                     4
          7        DO_ICALL                                             $5      
          8        ASSIGN_DIM                                                   !1
          9        OP_DATA                                                      $5
    6    10    >   COUNT                                                ~6      !0
         11      > JMPNZ                                                        ~6, ->3
    9    12    >   INIT_FCALL                                                   'var_dump'
         13        SEND_VAR                                                     !1
         14        DO_ICALL                                                     
         15      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.27 ms | 2751 KiB | 14 Q