3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ (object) ['pagerank' => 3], (object) ['pagerank' => 1], (object) ['pagerank' => 'R'], (object) ['pagerank' => 2], (object) ['pagerank' => 7] ]; foreach ($array as $i => $obj) { if ($obj->pagerank === 'R') { array_push($array, array_splice($array, $i, 1)[0]); break; } } var_export($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 29
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 29
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 28
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 29
Branch analysis from position: 29
filename:       /in/EMULG
function name:  (null)
number of ops:  34
compiled vars:  !0 = $array, !1 = $obj, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   CAST                                          8  ~3      <array>
          1        INIT_ARRAY                                       ~4      ~3
    5     2        CAST                                          8  ~5      <array>
          3        ADD_ARRAY_ELEMENT                                ~4      ~5
    6     4        CAST                                          8  ~6      <array>
          5        ADD_ARRAY_ELEMENT                                ~4      ~6
    7     6        CAST                                          8  ~7      <array>
          7        ADD_ARRAY_ELEMENT                                ~4      ~7
    8     8        CAST                                          8  ~8      <array>
          9        ADD_ARRAY_ELEMENT                                ~4      ~8
    3    10        ASSIGN                                                   !0, ~4
   11    11      > FE_RESET_R                                       $10     !0, ->29
         12    > > FE_FETCH_R                                       ~11     $10, !1, ->29
         13    >   ASSIGN                                                   !2, ~11
   12    14        FETCH_OBJ_R                                      ~13     !1, 'pagerank'
         15        IS_IDENTICAL                                             ~13, 'R'
         16      > JMPZ                                                     ~14, ->28
   13    17    >   INIT_FCALL                                               'array_push'
         18        SEND_REF                                                 !0
         19        INIT_FCALL                                               'array_splice'
         20        SEND_REF                                                 !0
         21        SEND_VAR                                                 !2
         22        SEND_VAL                                                 1
         23        DO_ICALL                                         $15     
         24        FETCH_DIM_R                                      ~16     $15, 0
         25        SEND_VAL                                                 ~16
         26        DO_ICALL                                                 
   14    27      > JMP                                                      ->29
   11    28    > > JMP                                                      ->12
         29    >   FE_FREE                                                  $10
   17    30        INIT_FCALL                                               'var_export'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
232.82 ms | 1013 KiB | 16 Q