3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 元データを用意する $a = array(); $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 = 21, Position 2 = 30
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 30
Branch analysis from position: 30
filename:       /in/9G0bU
function name:  (null)
number of ops:  33
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                                                   !0, <array>
    4     1        ASSIGN_DIM                                               !0, 2
          2        OP_DATA                                                  10
    5     3        ASSIGN_DIM                                               !0, 10
          4        OP_DATA                                                  2
    6     5        ASSIGN_DIM                                               !0, 3
          6        OP_DATA                                                  30
    7     7        ASSIGN_DIM                                               !0, 22
          8        OP_DATA                                                  20
    8     9        ASSIGN_DIM                                               !0, 9
         10        OP_DATA                                                  4
    9    11        ASSIGN_DIM                                               !0, 53
         12        OP_DATA                                                  29
   11    13        ECHO                                                     !0
   13    14        INIT_FCALL                                               'asort'
         15        SEND_REF                                                 !0
         16        DO_ICALL                                                 
   15    17        ECHO                                                     !0
   17    18        ASSIGN                                                   !1, 0
   18    19        ASSIGN                                                   !2, <array>
   19    20      > FE_RESET_R                                       $15     !0, ->30
         21    > > FE_FETCH_R                                       ~16     $15, !3, ->30
         22    >   ASSIGN                                                   !4, ~16
   20    23        ASSIGN_DIM                                               !2
         24        OP_DATA                                                  !4
   21    25        PRE_INC                                          ~19     !1
         26        IS_SMALLER_OR_EQUAL                                      3, ~19
         27      > JMPZ                                                     ~20, ->29
         28    > > JMP                                                      ->30
   19    29    > > JMP                                                      ->21
         30    >   FE_FREE                                                  $15
   24    31        ECHO                                                     !2
   25    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.88 ms | 1396 KiB | 15 Q