3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.41 ms | 1400 KiB | 19 Q