3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isset_( $key, array $array ) { return isset( $array[$key] ); } $my_array = array(); $start = microtime( TRUE ); for( $i = 1; $i < 10000; $i++ ) { array_key_exists( $i, $my_array ); $my_array[$i] = 0; } $stop = microtime( TRUE ); print "array_key_exists( \$my_array ) ".($stop-$start).PHP_EOL; unset( $my_array, $my_array_ref, $start, $stop, $i ); $my_array = array(); $start = microtime( TRUE ); for( $i = 1; $i < 10000; $i++ ) { isset( $my_array[$i] ); $my_array[$i] = 0; } $stop = microtime( TRUE ); print "isset( \$my_array ) ".($stop-$start).PHP_EOL; unset( $my_array, $my_array_ref, $start, $stop, $i ); $my_array = array(); $start = microtime( TRUE ); for( $i = 1; $i < 10000; $i++ ) { isset_( $i, $my_array ); $my_array[$i] = 0; } $stop = microtime( TRUE ); print "isset_( \$my_array ) ".($stop-$start).PHP_EOL; unset( $my_array, $my_array_ref, $start, $stop, $i ); $my_array = array(); $my_array_ref = &$my_array; $start = microtime( TRUE ); for( $i = 1; $i < 10000; $i++ ) { array_key_exists( $i, $my_array_ref ); $my_array_ref[$i] = 0; } $stop = microtime( TRUE ); print "array_key_exists( \$my_array_ref ) ".($stop-$start).PHP_EOL; unset( $my_array, $my_array_ref, $start, $stop, $i ); $my_array = array(); $my_array_ref = &$my_array; $start = microtime( TRUE ); for( $i = 1; $i < 10000; $i++ ) { isset( $my_array_ref[$i] ); $my_array_ref[$i] = 0; } $stop = microtime( TRUE ); print "isset( \$my_array_ref ) ".($stop-$start).PHP_EOL; unset( $my_array, $my_array_ref, $start, $stop, $i ); $my_array = array(); $my_array_ref = &$my_array; $start = microtime( TRUE ); for( $i = 1; $i < 10000; $i++ ) { isset_( $i, $my_array_ref ); $my_array_ref[$i] = 0; } $stop = microtime( TRUE ); print "isset_( \$my_array_ref ) ".($stop-$start).PHP_EOL; unset( $my_array, $my_array_ref, $start, $stop, $i );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 34
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 61
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
2 jumps found. (Code = 44) Position 1 = 98, Position 2 = 91
Branch analysis from position: 98
1 jumps found. (Code = 42) Position 1 = 124
Branch analysis from position: 124
2 jumps found. (Code = 44) Position 1 = 126, Position 2 = 119
Branch analysis from position: 126
1 jumps found. (Code = 42) Position 1 = 154
Branch analysis from position: 154
2 jumps found. (Code = 44) Position 1 = 156, Position 2 = 147
Branch analysis from position: 156
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 147
2 jumps found. (Code = 44) Position 1 = 156, Position 2 = 147
Branch analysis from position: 156
Branch analysis from position: 147
Branch analysis from position: 119
2 jumps found. (Code = 44) Position 1 = 126, Position 2 = 119
Branch analysis from position: 126
Branch analysis from position: 119
Branch analysis from position: 91
2 jumps found. (Code = 44) Position 1 = 98, Position 2 = 91
Branch analysis from position: 98
Branch analysis from position: 91
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 61
Branch analysis from position: 70
Branch analysis from position: 61
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 34
Branch analysis from position: 41
Branch analysis from position: 34
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
Branch analysis from position: 7
filename:       /in/NdK0H
function name:  (null)
number of ops:  170
compiled vars:  !0 = $my_array, !1 = $start, !2 = $i, !3 = $stop, !4 = $my_array_ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
   11     5        ASSIGN                                                   !2, 1
          6      > JMP                                                      ->12
   12     7    >   ARRAY_KEY_EXISTS                                 ~9      !2, !0
          8        FREE                                                     ~9
   13     9        ASSIGN_DIM                                               !0, !2
         10        OP_DATA                                                  0
   11    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, 10000
         13      > JMPNZ                                                    ~12, ->7
   15    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $13     
         17        ASSIGN                                                   !3, $13
   16    18        SUB                                              ~15     !3, !1
         19        CONCAT                                           ~16     'array_key_exists%28+%24my_array+%29+', ~15
         20        CONCAT                                           ~17     ~16, '%0A'
         21        ECHO                                                     ~17
   17    22        UNSET_CV                                                 !0
         23        UNSET_CV                                                 !4
         24        UNSET_CV                                                 !1
         25        UNSET_CV                                                 !3
         26        UNSET_CV                                                 !2
   19    27        ASSIGN                                                   !0, <array>
   20    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $19     
         31        ASSIGN                                                   !1, $19
   21    32        ASSIGN                                                   !2, 1
         33      > JMP                                                      ->39
   22    34    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~22     !0, !2
         35        FREE                                                     ~22
   23    36        ASSIGN_DIM                                               !0, !2
         37        OP_DATA                                                  0
   21    38        PRE_INC                                                  !2
         39    >   IS_SMALLER                                               !2, 10000
         40      > JMPNZ                                                    ~25, ->34
   25    41    >   INIT_FCALL                                               'microtime'
         42        SEND_VAL                                                 <true>
         43        DO_ICALL                                         $26     
         44        ASSIGN                                                   !3, $26
   26    45        SUB                                              ~28     !3, !1
         46        CONCAT                                           ~29     'isset%28+%24my_array+%29+', ~28
         47        CONCAT                                           ~30     ~29, '%0A'
         48        ECHO                                                     ~30
   27    49        UNSET_CV                                                 !0
         50        UNSET_CV                                                 !4
         51        UNSET_CV                                                 !1
         52        UNSET_CV                                                 !3
         53        UNSET_CV                                                 !2
   29    54        ASSIGN                                                   !0, <array>
   30    55        INIT_FCALL                                               'microtime'
         56        SEND_VAL                                                 <true>
         57        DO_ICALL                                         $32     
         58        ASSIGN                                                   !1, $32
   31    59        ASSIGN                                                   !2, 1
         60      > JMP                                                      ->68
   32    61    >   INIT_FCALL                                               'isset_'
         62        SEND_VAR                                                 !2
         63        SEND_VAR                                                 !0
         64        DO_FCALL                                      0          
   33    65        ASSIGN_DIM                                               !0, !2
         66        OP_DATA                                                  0
   31    67        PRE_INC                                                  !2
         68    >   IS_SMALLER                                               !2, 10000
         69      > JMPNZ                                                    ~38, ->61
   35    70    >   INIT_FCALL                                               'microtime'
         71        SEND_VAL                                                 <true>
         72        DO_ICALL                                         $39     
         73        ASSIGN                                                   !3, $39
   36    74        SUB                                              ~41     !3, !1
         75        CONCAT                                           ~42     'isset_%28+%24my_array+%29+', ~41
         76        CONCAT                                           ~43     ~42, '%0A'
         77        ECHO                                                     ~43
   37    78        UNSET_CV                                                 !0
         79        UNSET_CV                                                 !4
         80        UNSET_CV                                                 !1
         81        UNSET_CV                                                 !3
         82        UNSET_CV                                                 !2
   39    83        ASSIGN                                                   !0, <array>
   40    84        ASSIGN_REF                                               !4, !0
   41    85        INIT_FCALL                                               'microtime'
         86        SEND_VAL                                                 <true>
         87        DO_ICALL                                         $46     
         88        ASSIGN                                                   !1, $46
   42    89        ASSIGN                                                   !2, 1
         90      > JMP                                                      ->96
   43    91    >   ARRAY_KEY_EXISTS                                 ~49     !2, !4
         92        FREE                                                     ~49
   44    93        ASSIGN_DIM                                               !4, !2
         94        OP_DATA                                                  0
   42    95        PRE_INC                                                  !2
         96    >   IS_SMALLER                                               !2, 10000
         97      > JMPNZ                                                    ~52, ->91
   46    98    >   INIT_FCALL                                               'microtime'
         99        SEND_VAL                                                 <true>
        100        DO_ICALL                                         $53     
        101        ASSIGN                                                   !3, $53
   47   102        SUB                                              ~55     !3, !1
        103        CONCAT                                           ~56     'array_key_exists%28+%24my_array_ref+%29+', ~55
        104        CONCAT                                           ~57     ~56, '%0A'
        105        ECHO                                                     ~57
   48   106        UNSET_CV                                                 !0
        107        UNSET_CV                                                 !4
        108        UNSET_CV                                                 !1
        109        UNSET_CV                                                 !3
        110        UNSET_CV                                                 !2
   50   111        ASSIGN                                                   !0, <array>
   51   112        ASSIGN_REF                                               !4, !0
   52   113        INIT_FCALL                                               'microtime'
        114        SEND_VAL                                                 <true>
        115        DO_ICALL                                         $60     
        116        ASSIGN                                                   !1, $60
   53   117        ASSIGN                                                   !2, 1
        118      > JMP                                                      ->124
   54   119    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~63     !4, !2
        120        FREE                                                     ~63
   55   121        ASSIGN_DIM                                               !4, !2
        122        OP_DATA                                                  0
   53   123        PRE_INC                                                  !2
        124    >   IS_SMALLER                                               !2, 10000
        125      > JMPNZ                                                    ~66, ->119
   57   126    >   INIT_FCALL                                               'microtime'
        127        SEND_VAL                                                 <true>
        128        DO_ICALL                                         $67     
        129        ASSIGN                                                   !3, $67
   58   130        SUB                                              ~69     !3, !1
        131        CONCAT                                           ~70     'isset%28+%24my_array_ref+%29+', ~69
        132        CONCAT                                           ~71     ~70, '%0A'
        133        ECHO                                                     ~71
   59   134        UNSET_CV                                                 !0
        135        UNSET_CV                                                 !4
        136        UNSET_CV                                                 !1
        137        UNSET_CV                                                 !3
        138        UNSET_CV                                                 !2
   61   139        ASSIGN                                                   !0, <array>
   62   140        ASSIGN_REF                                               !4, !0
   63   141        INIT_FCALL                                               'microtime'
        142        SEND_VAL                                                 <true>
        143        DO_ICALL                                         $74     
        144        ASSIGN                                                   !1, $74
   64   145        ASSIGN                                                   !2, 1
        146      > JMP                                                      ->154
   65   147    >   INIT_FCALL                                               'isset_'
        148        SEND_VAR                                                 !2
        149        SEND_VAR                                                 !4
        150        DO_FCALL                                      0          
   66   151        ASSIGN_DIM                                               !4, !2
        152        OP_DATA                                                  0
   64   153        PRE_INC                                                  !2
        154    >   IS_SMALLER                                               !2, 10000
        155      > JMPNZ                                                    ~80, ->147
   68   156    >   INIT_FCALL                                               'microtime'
        157        SEND_VAL                                                 <true>
        158        DO_ICALL                                         $81     
        159        ASSIGN                                                   !3, $81
   69   160        SUB                                              ~83     !3, !1
        161        CONCAT                                           ~84     'isset_%28+%24my_array_ref+%29+', ~83
        162        CONCAT                                           ~85     ~84, '%0A'
        163        ECHO                                                     ~85
   70   164        UNSET_CV                                                 !0
        165        UNSET_CV                                                 !4
        166        UNSET_CV                                                 !1
        167        UNSET_CV                                                 !3
        168        UNSET_CV                                                 !2
        169      > RETURN                                                   1

Function isset_:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NdK0H
function name:  isset_
number of ops:  5
compiled vars:  !0 = $key, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      !1, !0
          3      > RETURN                                                   ~2
    7     4*     > RETURN                                                   null

End of function isset_

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.75 ms | 1415 KiB | 17 Q