3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array[]=array('id'=>'a', 'content'=>'lemon'); $array[]=array('id'=>'b', 'content'=>'apple'); $array[]=array('id'=>'c', 'content'=>'banana'); $array[]=array('id'=>'d', 'content'=>'cherry'); $first = 'apple'; $k = array_search($first, array_column($array, 'content')); $array = array_merge(array_slice($array, $k), array_slice($array, 0, $k)); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TmF82
function name:  (null)
number of ops:  36
compiled vars:  !0 = $array, !1 = $first, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0
          1        OP_DATA                                                  <array>
    4     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  <array>
    5     4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  <array>
    6     6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  <array>
    8     8        ASSIGN                                                   !1, 'apple'
    9     9        INIT_FCALL                                               'array_search'
         10        SEND_VAR                                                 !1
         11        INIT_FCALL                                               'array_column'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 'content'
         14        DO_ICALL                                         $8      
         15        SEND_VAR                                                 $8
         16        DO_ICALL                                         $9      
         17        ASSIGN                                                   !2, $9
   10    18        INIT_FCALL                                               'array_merge'
         19        INIT_FCALL                                               'array_slice'
         20        SEND_VAR                                                 !0
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $11     
         23        SEND_VAR                                                 $11
         24        INIT_FCALL                                               'array_slice'
         25        SEND_VAR                                                 !0
         26        SEND_VAL                                                 0
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                         $12     
         29        SEND_VAR                                                 $12
         30        DO_ICALL                                         $13     
         31        ASSIGN                                                   !0, $13
   11    32        INIT_FCALL                                               'print_r'
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.53 ms | 1007 KiB | 18 Q