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;*/ $a[0] = 0; //確認 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 = 11, Position 2 = 20
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 20
Branch analysis from position: 20
filename:       /in/bFJhb
function name:  (null)
number of ops:  23
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>
   10     1        ASSIGN_DIM                                               !0, 0
          2        OP_DATA                                                  0
   12     3        ECHO                                                     !0
   14     4        INIT_FCALL                                               'asort'
          5        SEND_REF                                                 !0
          6        DO_ICALL                                                 
   16     7        ECHO                                                     !0
   18     8        ASSIGN                                                   !1, 0
   19     9        ASSIGN                                                   !2, <array>
   20    10      > FE_RESET_R                                       $10     !0, ->20
         11    > > FE_FETCH_R                                       ~11     $10, !3, ->20
         12    >   ASSIGN                                                   !4, ~11
   21    13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  !4
   22    15        PRE_INC                                          ~14     !1
         16        IS_SMALLER_OR_EQUAL                                      3, ~14
         17      > JMPZ                                                     ~15, ->19
         18    > > JMP                                                      ->20
   20    19    > > JMP                                                      ->11
         20    >   FE_FREE                                                  $10
   25    21        ECHO                                                     !2
   26    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.24 ms | 1400 KiB | 15 Q