3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 元データを用意する $a[2]=10; $a[10]=2; $a[3]=30; $a[22]=20; $a[9]=4; $a[53]=29; //確認 echo ($a); //キーを保持してソート asort($a); //確認 print_r($a); //最初から 3 個を $b[] に代入 $i = 0; $b = array(); foreach ($a as $k=>$d){ $b[] = $k; if (3 <= ++$i){ break;} } //確認 print_r($b); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 31
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 31
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 30
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 31
Branch analysis from position: 31
filename:       /in/11pqS
function name:  (null)
number of ops:  36
compiled vars:  !0 = $a, !1 = $i, !2 = $b, !3 = $d, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0, 2
          1        OP_DATA                                                  10
    4     2        ASSIGN_DIM                                               !0, 10
          3        OP_DATA                                                  2
    5     4        ASSIGN_DIM                                               !0, 3
          5        OP_DATA                                                  30
    6     6        ASSIGN_DIM                                               !0, 22
          7        OP_DATA                                                  20
    7     8        ASSIGN_DIM                                               !0, 9
          9        OP_DATA                                                  4
    8    10        ASSIGN_DIM                                               !0, 53
         11        OP_DATA                                                  29
   10    12        ECHO                                                     !0
   12    13        INIT_FCALL                                               'asort'
         14        SEND_REF                                                 !0
         15        DO_ICALL                                                 
   14    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
   16    19        ASSIGN                                                   !1, 0
   17    20        ASSIGN                                                   !2, <array>
   18    21      > FE_RESET_R                                       $15     !0, ->31
         22    > > FE_FETCH_R                                       ~16     $15, !3, ->31
         23    >   ASSIGN                                                   !4, ~16
   19    24        ASSIGN_DIM                                               !2
         25        OP_DATA                                                  !4
   20    26        PRE_INC                                          ~19     !1
         27        IS_SMALLER_OR_EQUAL                                      3, ~19
         28      > JMPZ                                                     ~20, ->30
         29    > > JMP                                                      ->31
   18    30    > > JMP                                                      ->22
         31    >   FE_FREE                                                  $15
   23    32        INIT_FCALL                                               'print_r'
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                                 
   24    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.58 ms | 1396 KiB | 17 Q