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; //確認 print_r($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 = 24, Position 2 = 33
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 33
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 33
Branch analysis from position: 33
filename:       /in/JroHh
function name:  (null)
number of ops:  38
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        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
   12    15        INIT_FCALL                                               'asort'
         16        SEND_REF                                                 !0
         17        DO_ICALL                                                 
   14    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
   16    21        ASSIGN                                                   !1, 0
   17    22        ASSIGN                                                   !2, <array>
   18    23      > FE_RESET_R                                       $16     !0, ->33
         24    > > FE_FETCH_R                                       ~17     $16, !3, ->33
         25    >   ASSIGN                                                   !4, ~17
   19    26        ASSIGN_DIM                                               !2
         27        OP_DATA                                                  !4
   20    28        PRE_INC                                          ~20     !1
         29        IS_SMALLER_OR_EQUAL                                      3, ~20
         30      > JMPZ                                                     ~21, ->32
         31    > > JMP                                                      ->33
   18    32    > > JMP                                                      ->24
         33    >   FE_FREE                                                  $16
   23    34        INIT_FCALL                                               'print_r'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                                 
   24    37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.62 ms | 1396 KiB | 17 Q