3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cases = array(false, 0, 1, 2, 3, 4, 5, true, null); $cnt = count($cases); $ln = 111111; $s = microtime(true); for ($i = 0; $i < $ln; $i++) { $result = array(); foreach ($cases as $c) { $result[] = !!$c; } } var_dump('time : ' . (microtime(true) - $s) . ' for ' . ($ln * $cnt) . ' times !!$c'); $s = microtime(true); for ($i = 0; $i < $ln; $i++) { $result = array(); foreach ($cases as $c) { $result[] = (bool)$c; } } var_dump('time : ' . (microtime(true) - $s) . ' for ' . ($ln * $cnt) . ' times (bool)$c');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 10
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 40
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
2 jumps found. (Code = 77) Position 1 = 42, Position 2 = 47
Branch analysis from position: 42
2 jumps found. (Code = 78) Position 1 = 43, Position 2 = 47
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 40
Branch analysis from position: 51
Branch analysis from position: 40
Branch analysis from position: 47
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 10
Branch analysis from position: 22
Branch analysis from position: 10
Branch analysis from position: 18
filename:       /in/0aOnk
function name:  (null)
number of ops:  64
compiled vars:  !0 = $cases, !1 = $cnt, !2 = $ln, !3 = $s, !4 = $i, !5 = $result, !6 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        COUNT                                            ~8      !0
          2        ASSIGN                                                   !1, ~8
    5     3        ASSIGN                                                   !2, 111111
    6     4        INIT_FCALL                                               'microtime'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $11     
          7        ASSIGN                                                   !3, $11
    7     8        ASSIGN                                                   !4, 0
          9      > JMP                                                      ->20
    8    10    >   ASSIGN                                                   !5, <array>
    9    11      > FE_RESET_R                                       $15     !0, ->18
         12    > > FE_FETCH_R                                               $15, !6, ->18
   10    13    >   BOOL_NOT                                         ~17     !6
         14        BOOL_NOT                                         ~18     ~17
         15        ASSIGN_DIM                                               !5
         16        OP_DATA                                                  ~18
    9    17      > JMP                                                      ->12
         18    >   FE_FREE                                                  $15
    7    19        PRE_INC                                                  !4
         20    >   IS_SMALLER                                               !4, !2
         21      > JMPNZ                                                    ~20, ->10
   14    22    >   INIT_FCALL                                               'var_dump'
         23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $21     
         26        SUB                                              ~22     $21, !3
         27        CONCAT                                           ~23     'time+%3A+', ~22
         28        CONCAT                                           ~24     ~23, '+for+'
         29        MUL                                              ~25     !2, !1
         30        CONCAT                                           ~26     ~24, ~25
         31        CONCAT                                           ~27     ~26, '+times+%21%21%24c'
         32        SEND_VAL                                                 ~27
         33        DO_ICALL                                                 
   16    34        INIT_FCALL                                               'microtime'
         35        SEND_VAL                                                 <true>
         36        DO_ICALL                                         $29     
         37        ASSIGN                                                   !3, $29
   17    38        ASSIGN                                                   !4, 0
         39      > JMP                                                      ->49
   18    40    >   ASSIGN                                                   !5, <array>
   19    41      > FE_RESET_R                                       $33     !0, ->47
         42    > > FE_FETCH_R                                               $33, !6, ->47
   20    43    >   BOOL                                             ~35     !6
         44        ASSIGN_DIM                                               !5
         45        OP_DATA                                                  ~35
   19    46      > JMP                                                      ->42
         47    >   FE_FREE                                                  $33
   17    48        PRE_INC                                                  !4
         49    >   IS_SMALLER                                               !4, !2
         50      > JMPNZ                                                    ~37, ->40
   23    51    >   INIT_FCALL                                               'var_dump'
         52        INIT_FCALL                                               'microtime'
         53        SEND_VAL                                                 <true>
         54        DO_ICALL                                         $38     
         55        SUB                                              ~39     $38, !3
         56        CONCAT                                           ~40     'time+%3A+', ~39
         57        CONCAT                                           ~41     ~40, '+for+'
         58        MUL                                              ~42     !2, !1
         59        CONCAT                                           ~43     ~41, ~42
         60        CONCAT                                           ~44     ~43, '+times+%28bool%29%24c'
         61        SEND_VAL                                                 ~44
         62        DO_ICALL                                                 
         63      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.02 ms | 1400 KiB | 17 Q