3v4l.org

run code in 500+ PHP versions simultaneously
<?php $items = array( array( 'id' => 104, 'book_id' => 32, 'price' => 55 ), array( 'id' => 117, 'book_id' => 76, 'price' => 65 ), array( 'id' => 135, 'book_id' => 77, 'price' => 65 ), array( 'id' => 100, 'book_id' => 78, 'price' => 65 ), array( 'id' => 101, 'book_id' => 21, 'price' => 85 ), array( 'id' => 107, 'book_id' => 35, 'price' => 90 ), array( 'id' => 108, 'book_id' => 64, 'price' => 90 ), array( 'id' => 130, 'book_id' => 101, 'price' => 100 ), ); foreach($items as $sub){ $new[$sub["price"]][] = $sub; } $lowest3 = array_slice($new, 0, 3 , true); var_dump($lowest3);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 8
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/2hARj
function name:  (null)
number of ops:  20
compiled vars:  !0 = $items, !1 = $sub, !2 = $new, !3 = $lowest3
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   15     1      > FE_RESET_R                                           $5      !0, ->8
          2    > > FE_FETCH_R                                                   $5, !1, ->8
   16     3    >   FETCH_DIM_R                                          ~6      !1, 'price'
          4        FETCH_DIM_W                                          $7      !2, ~6
          5        ASSIGN_DIM                                                   $7
          6        OP_DATA                                                      !1
   15     7      > JMP                                                          ->2
          8    >   FE_FREE                                                      $5
   19     9        INIT_FCALL                                                   'array_slice'
         10        SEND_VAR                                                     !2
         11        SEND_VAL                                                     0
         12        SEND_VAL                                                     3
         13        SEND_VAL                                                     <true>
         14        DO_ICALL                                             $9      
         15        ASSIGN                                                       !3, $9
   21    16        INIT_FCALL                                                   'var_dump'
         17        SEND_VAR                                                     !3
         18        DO_ICALL                                                     
         19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
127.11 ms | 478 KiB | 9 Q