3v4l.org

run code in 300+ PHP versions simultaneously
<?php function write($str) { echo $str . '<br>'; } $arr = array(); for($i=0;$i<100000;$i++)$arr[$i]=rand(1, 6); // 1~6の乱数を生成 write('*数字の配列を操作'); function i11($arr) { write('比較演算子1-1'); $start = microtime(); for($i=0,$j=count($arr);$i<$j;++$i)$arr[$i]==6; $end = microtime(); $start = explode(' ', $start); $end = explode(' ', $end); write(((float)$end[0]+(float)$end[1]) - ((float)$start[0]+(float)$start[1])); } i11($arr); function i12($arr) { write('比較演算子1-2'); $start = microtime(); for($i=0,$j=count($arr);$i<$j;++$i)$arr[$i]===6; $end = microtime(); $start = explode(' ', $start); $end = explode(' ', $end); write(((float)$end[0]+(float)$end[1]) - ((float)$start[0]+(float)$start[1])); } i12($arr); function i21($arr) { write('比較演算子2-1'); $start = microtime(); for($i=0,$j=count($arr),$a=6;$i<$j;++$i)$arr[$i]==$a; $end = microtime(); $start = explode(' ', $start); $end = explode(' ', $end); write(((float)$end[0]+(float)$end[1]) - ((float)$start[0]+(float)$start[1])); } i21($arr); function i22($arr) { write('比較演算子2-2'); $start = microtime(); for($i=0,$j=count($arr),$a=6;$i<$j;++$i)$arr[$i]===$a; $end = microtime(); $start = explode(' ', $start); $end = explode(' ', $end); write(((float)$end[0]+(float)$end[1]) - ((float)$start[0]+(float)$start[1])); } i22($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
Branch analysis from position: 3
filename:       /in/qlk7E
function name:  (null)
number of ops:  28
compiled vars:  !0 = $arr, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->10
          3    >   INIT_FCALL                                               'rand'
          4        SEND_VAL                                                 1
          5        SEND_VAL                                                 6
          6        DO_ICALL                                         $5      
          7        ASSIGN_DIM                                               !0, !1
          8        OP_DATA                                                  $5
          9        PRE_INC                                                  !1
         10    >   IS_SMALLER                                               !1, 100000
         11      > JMPNZ                                                    ~7, ->3
   10    12    >   INIT_FCALL                                               'write'
         13        SEND_VAL                                                 '%2A%E6%95%B0%E5%AD%97%E3%81%AE%E9%85%8D%E5%88%97%E3%82%92%E6%93%8D%E4%BD%9C'
         14        DO_FCALL                                      0          
   20    15        INIT_FCALL                                               'i11'
         16        SEND_VAR                                                 !0
         17        DO_FCALL                                      0          
   30    18        INIT_FCALL                                               'i12'
         19        SEND_VAR                                                 !0
         20        DO_FCALL                                      0          
   40    21        INIT_FCALL                                               'i21'
         22        SEND_VAR                                                 !0
         23        DO_FCALL                                      0          
   50    24        INIT_FCALL                                               'i22'
         25        SEND_VAR                                                 !0
         26        DO_FCALL                                      0          
         27      > RETURN                                                   1

Function write:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qlk7E
function name:  write
number of ops:  4
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        CONCAT                                           ~1      !0, '%3Cbr%3E'
          2        ECHO                                                     ~1
    5     3      > RETURN                                                   null

End of function write

Function i11:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 11
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 11
Branch analysis from position: 17
Branch analysis from position: 11
filename:       /in/qlk7E
function name:  i11
number of ops:  45
compiled vars:  !0 = $arr, !1 = $start, !2 = $i, !3 = $j, !4 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'write'
          2        SEND_VAL                                                 '%E6%AF%94%E8%BC%83%E6%BC%94%E7%AE%97%E5%AD%901-1'
          3        DO_FCALL                                      0          
   13     4        INIT_FCALL                                               'microtime'
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !1, $6
   14     7        ASSIGN                                                   !2, 0
          8        COUNT                                            ~9      !0
          9        ASSIGN                                                   !3, ~9
         10      > JMP                                                      ->15
         11    >   FETCH_DIM_R                                      ~11     !0, !2
         12        IS_EQUAL                                         ~12     ~11, 6
         13        FREE                                                     ~12
         14        PRE_INC                                                  !2
         15    >   IS_SMALLER                                               !2, !3
         16      > JMPNZ                                                    ~14, ->11
   15    17    >   INIT_FCALL                                               'microtime'
         18        DO_ICALL                                         $15     
         19        ASSIGN                                                   !4, $15
   16    20        INIT_FCALL                                               'explode'
         21        SEND_VAL                                                 '+'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $17     
         24        ASSIGN                                                   !1, $17
   17    25        INIT_FCALL                                               'explode'
         26        SEND_VAL                                                 '+'
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                         $19     
         29        ASSIGN                                                   !4, $19
   18    30        INIT_FCALL                                               'write'
         31        FETCH_DIM_R                                      ~21     !4, 0
         32        CAST                                          5  ~22     ~21
         33        FETCH_DIM_R                                      ~23     !4, 1
         34        CAST                                          5  ~24     ~23
         35        ADD                                              ~25     ~22, ~24
         36        FETCH_DIM_R                                      ~26     !1, 0
         37        CAST                                          5  ~27     ~26
         38        FETCH_DIM_R                                      ~28     !1, 1
         39        CAST                                          5  ~29     ~28
         40        ADD                                              ~30     ~27, ~29
         41        SUB                                              ~31     ~25, ~30
         42        SEND_VAL                                                 ~31
         43        DO_FCALL                                      0          
   19    44      > RETURN                                                   null

End of function i11

Function i12:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 11
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 11
Branch analysis from position: 17
Branch analysis from position: 11
filename:       /in/qlk7E
function name:  i12
number of ops:  45
compiled vars:  !0 = $arr, !1 = $start, !2 = $i, !3 = $j, !4 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   22     1        INIT_FCALL                                               'write'
          2        SEND_VAL                                                 '%E6%AF%94%E8%BC%83%E6%BC%94%E7%AE%97%E5%AD%901-2'
          3        DO_FCALL                                      0          
   23     4        INIT_FCALL                                               'microtime'
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !1, $6
   24     7        ASSIGN                                                   !2, 0
          8        COUNT                                            ~9      !0
          9        ASSIGN                                                   !3, ~9
         10      > JMP                                                      ->15
         11    >   FETCH_DIM_R                                      ~11     !0, !2
         12        IS_IDENTICAL                                     ~12     ~11, 6
         13        FREE                                                     ~12
         14        PRE_INC                                                  !2
         15    >   IS_SMALLER                                               !2, !3
         16      > JMPNZ                                                    ~14, ->11
   25    17    >   INIT_FCALL                                               'microtime'
         18        DO_ICALL                                         $15     
         19        ASSIGN                                                   !4, $15
   26    20        INIT_FCALL                                               'explode'
         21        SEND_VAL                                                 '+'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $17     
         24        ASSIGN                                                   !1, $17
   27    25        INIT_FCALL                                               'explode'
         26        SEND_VAL                                                 '+'
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                         $19     
         29        ASSIGN                                                   !4, $19
   28    30        INIT_FCALL                                               'write'
         31        FETCH_DIM_R                                      ~21     !4, 0
         32        CAST                                          5  ~22     ~21
         33        FETCH_DIM_R                                      ~23     !4, 1
         34        CAST                                          5  ~24     ~23
         35        ADD                                              ~25     ~22, ~24
         36        FETCH_DIM_R                                      ~26     !1, 0
         37        CAST                                          5  ~27     ~26
         38        FETCH_DIM_R                                      ~28     !1, 1
         39        CAST                                          5  ~29     ~28
         40        ADD                                              ~30     ~27, ~29
         41        SUB                                              ~31     ~25, ~30
         42        SEND_VAL                                                 ~31
         43        DO_FCALL                                      0          
   29    44      > RETURN                                                   null

End of function i12

Function i21:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 12
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 12
Branch analysis from position: 18
Branch analysis from position: 12
filename:       /in/qlk7E
function name:  i21
number of ops:  46
compiled vars:  !0 = $arr, !1 = $start, !2 = $i, !3 = $j, !4 = $a, !5 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
   32     1        INIT_FCALL                                               'write'
          2        SEND_VAL                                                 '%E6%AF%94%E8%BC%83%E6%BC%94%E7%AE%97%E5%AD%902-1'
          3        DO_FCALL                                      0          
   33     4        INIT_FCALL                                               'microtime'
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !1, $7
   34     7        ASSIGN                                                   !2, 0
          8        COUNT                                            ~10     !0
          9        ASSIGN                                                   !3, ~10
         10        ASSIGN                                                   !4, 6
         11      > JMP                                                      ->16
         12    >   FETCH_DIM_R                                      ~13     !0, !2
         13        IS_EQUAL                                         ~14     !4, ~13
         14        FREE                                                     ~14
         15        PRE_INC                                                  !2
         16    >   IS_SMALLER                                               !2, !3
         17      > JMPNZ                                                    ~16, ->12
   35    18    >   INIT_FCALL                                               'microtime'
         19        DO_ICALL                                         $17     
         20        ASSIGN                                                   !5, $17
   36    21        INIT_FCALL                                               'explode'
         22        SEND_VAL                                                 '+'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $19     
         25        ASSIGN                                                   !1, $19
   37    26        INIT_FCALL                                               'explode'
         27        SEND_VAL                                                 '+'
         28        SEND_VAR                                                 !5
         29        DO_ICALL                                         $21     
         30        ASSIGN                                                   !5, $21
   38    31        INIT_FCALL                                               'write'
         32        FETCH_DIM_R                                      ~23     !5, 0
         33        CAST                                          5  ~24     ~23
         34        FETCH_DIM_R                                      ~25     !5, 1
         35        CAST                                          5  ~26     ~25
         36        ADD                                              ~27     ~24, ~26
         37        FETCH_DIM_R                                      ~28     !1, 0
         38        CAST                                          5  ~29     ~28
         39        FETCH_DIM_R                                      ~30     !1, 1
         40        CAST                                          5  ~31     ~30
         41        ADD                                              ~32     ~29, ~31
         42        SUB                                              ~33     ~27, ~32
         43        SEND_VAL                                                 ~33
         44        DO_FCALL                                      0          
   39    45      > RETURN                                                   null

End of function i21

Function i22:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 12
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 12
Branch analysis from position: 18
Branch analysis from position: 12
filename:       /in/qlk7E
function name:  i22
number of ops:  46
compiled vars:  !0 = $arr, !1 = $start, !2 = $i, !3 = $j, !4 = $a, !5 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   RECV                                             !0      
   42     1        INIT_FCALL                                               'write'
          2        SEND_VAL                                                 '%E6%AF%94%E8%BC%83%E6%BC%94%E7%AE%97%E5%AD%902-2'
          3        DO_FCALL                                      0          
   43     4        INIT_FCALL                                               'microtime'
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !1, $7
   44     7        ASSIGN                                                   !2, 0
          8        COUNT                                            ~10     !0
          9        ASSIGN                                                   !3, ~10
         10        ASSIGN                                                   !4, 6
         11      > JMP                                                      ->16
         12    >   FETCH_DIM_R                                      ~13     !0, !2
         13        IS_IDENTICAL                                     ~14     !4, ~13
         14        FREE                                                     ~14
         15        PRE_INC                                                  !2
         16    >   IS_SMALLER                                               !2, !3
         17      > JMPNZ                                                    ~16, ->12
   45    18    >   INIT_FCALL                                               'microtime'
         19        DO_ICALL                                         $17     
         20        ASSIGN                                                   !5, $17
   46    21        INIT_FCALL                                               'explode'
         22        SEND_VAL                                                 '+'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $19     
         25        ASSIGN                                                   !1, $19
   47    26        INIT_FCALL                                               'explode'
         27        SEND_VAL                                                 '+'
         28        SEND_VAR                                                 !5
         29        DO_ICALL                                         $21     
         30        ASSIGN                                                   !5, $21
   48    31        INIT_FCALL                                               'write'
         32        FETCH_DIM_R                                      ~23     !5, 0
         33        CAST                                          5  ~24     ~23
         34        FETCH_DIM_R                                      ~25     !5, 1
         35        CAST                                          5  ~26     ~25
         36        ADD                                              ~27     ~24, ~26
         37        FETCH_DIM_R                                      ~28     !1, 0
         38        CAST                                          5  ~29     ~28
         39        FETCH_DIM_R                                      ~30     !1, 1
         40        CAST                                          5  ~31     ~30
         41        ADD                                              ~32     ~29, ~31
         42        SUB                                              ~33     ~27, ~32
         43        SEND_VAL                                                 ~33
         44        DO_FCALL                                      0          
   49    45      > RETURN                                                   null

End of function i22

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.62 ms | 1419 KiB | 32 Q