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); //確認 echo ($a); //最初から 3 個を $b[] に代入 $i = 0; $b = array(); foreach ($a as $k=>$d){ $b[] = $k; if (3 <= ++$i){ break;} } //確認 echo ($b); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 29
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 29
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
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 = 20
Branch analysis from position: 20
Branch analysis from position: 29
Branch analysis from position: 29
filename:       /in/9jQ1f
function name:  (null)
number of ops:  32
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        ECHO                                                     !0
   16    17        ASSIGN                                                   !1, 0
   17    18        ASSIGN                                                   !2, <array>
   18    19      > FE_RESET_R                                       $14     !0, ->29
         20    > > FE_FETCH_R                                       ~15     $14, !3, ->29
         21    >   ASSIGN                                                   !4, ~15
   19    22        ASSIGN_DIM                                               !2
         23        OP_DATA                                                  !4
   20    24        PRE_INC                                          ~18     !1
         25        IS_SMALLER_OR_EQUAL                                      3, ~18
         26      > JMPZ                                                     ~19, ->28
         27    > > JMP                                                      ->29
   18    28    > > JMP                                                      ->20
         29    >   FE_FREE                                                  $14
   23    30        ECHO                                                     !2
   24    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.07 ms | 1396 KiB | 15 Q