3v4l.org

run code in 300+ PHP versions simultaneously
<?php $elements = 1000; $iterations = 10000; $array = array(); for ($i = 0; $i < $elements; $i++) $array[] = $i; $s = microtime(true); for ($i = 0; $i < $iterations; $i++) is_array($array); $e = microtime(true); echo "is_array completed in " . ($e - $s) ." Seconds\n"; $s = microtime(true); for ($i = 0; $i < $iterations; $i++) $array === (array) $array; $e = microtime(true); echo "Cast completed in " . ($e - $s) ." Seconds\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 5
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 16
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 35
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 35
Branch analysis from position: 41
Branch analysis from position: 35
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 16
Branch analysis from position: 21
Branch analysis from position: 16
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 5
Branch analysis from position: 10
Branch analysis from position: 5
filename:       /in/9Q4cS
function name:  (null)
number of ops:  50
compiled vars:  !0 = $elements, !1 = $iterations, !2 = $array, !3 = $i, !4 = $s, !5 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1000
    3     1        ASSIGN                                                   !1, 10000
    5     2        ASSIGN                                                   !2, <array>
    6     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->8
          5    >   ASSIGN_DIM                                               !2
          6        OP_DATA                                                  !3
          7        PRE_INC                                                  !3
          8    >   IS_SMALLER                                               !3, !0
          9      > JMPNZ                                                    ~12, ->5
    8    10    >   INIT_FCALL                                               'microtime'
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $13     
         13        ASSIGN                                                   !4, $13
    9    14        ASSIGN                                                   !3, 0
         15      > JMP                                                      ->19
         16    >   TYPE_CHECK                                  128  ~16     !2
         17        FREE                                                     ~16
         18        PRE_INC                                                  !3
         19    >   IS_SMALLER                                               !3, !1
         20      > JMPNZ                                                    ~18, ->16
   10    21    >   INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $19     
         24        ASSIGN                                                   !5, $19
   11    25        SUB                                              ~21     !5, !4
         26        CONCAT                                           ~22     'is_array+completed+in+', ~21
         27        CONCAT                                           ~23     ~22, '+Seconds%0A'
         28        ECHO                                                     ~23
   13    29        INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $24     
         32        ASSIGN                                                   !4, $24
   14    33        ASSIGN                                                   !3, 0
         34      > JMP                                                      ->39
         35    >   CAST                                          7  ~27     !2
         36        IS_IDENTICAL                                     ~28     !2, ~27
         37        FREE                                                     ~28
         38        PRE_INC                                                  !3
         39    >   IS_SMALLER                                               !3, !1
         40      > JMPNZ                                                    ~30, ->35
   15    41    >   INIT_FCALL                                               'microtime'
         42        SEND_VAL                                                 <true>
         43        DO_ICALL                                         $31     
         44        ASSIGN                                                   !5, $31
   16    45        SUB                                              ~33     !5, !4
         46        CONCAT                                           ~34     'Cast+completed+in+', ~33
         47        CONCAT                                           ~35     ~34, '+Seconds%0A'
         48        ECHO                                                     ~35
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.05 ms | 1400 KiB | 15 Q