3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'Current PHP Version: ' . phpversion() . "\n\n"; $start1 = 1; $start0 = 0; $time_start = microtime(TRUE); for( $i = 0 ; $i < 8500000; $i++ ) { $answer = $start0 == 1; $answer = $start1 == 1; } $time_end = microtime(TRUE); echo 'Did COMPARISON in ' . ($time_end - $time_start) . " seconds\n"; $time_start = microtime(TRUE); for( $i = 0 ; $i < 8500000; $i++ ) { $answer = !empty($start0); $answer = !empty($start1); } $time_end = microtime(TRUE); echo 'Did NOT EMPTY in ' . ($time_end - $time_start) . " seconds\n"; $time_start = microtime(TRUE); for( $i = 0 ; $i < 8500000; $i++ ) { $answer = (bool)$start0; $answer = (bool)$start1; } $time_end = microtime(TRUE); echo 'Did TYPECAST BOOL in ' . ($time_end - $time_start) . " seconds\n"; $time_start = microtime(TRUE); for( $i = 0 ; $i < 8500000; $i++ ) { $answer = $start0 == TRUE; $answer = $start1 == TRUE; } $time_end = microtime(TRUE); echo 'Did EQUALS TRUE in ' . ($time_end - $time_start) . " seconds\n"; $time_start = microtime(TRUE); for( $i = 0 ; $i < 8500000; $i++ ) { $answer = !!$start0; $answer = !!$start1; } $time_end = microtime(TRUE); echo 'Did NOT NOT in ' . ($time_end - $time_start) . " seconds\n"; $time_start = microtime(TRUE); for( $i = 0 ; $i < 8500000; $i++ ) { $answer = is_null($start0); $answer = is_null($start1); } $time_end = microtime(TRUE); echo 'Did IS NULL in ' . ($time_end - $time_start) . " seconds\n";

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 13
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 34
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 57
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 83
Branch analysis from position: 83
2 jumps found. (Code = 44) Position 1 = 85, Position 2 = 78
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 106
Branch analysis from position: 106
2 jumps found. (Code = 44) Position 1 = 108, Position 2 = 99
Branch analysis from position: 108
1 jumps found. (Code = 42) Position 1 = 127
Branch analysis from position: 127
2 jumps found. (Code = 44) Position 1 = 129, Position 2 = 122
Branch analysis from position: 129
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 122
2 jumps found. (Code = 44) Position 1 = 129, Position 2 = 122
Branch analysis from position: 129
Branch analysis from position: 122
Branch analysis from position: 99
2 jumps found. (Code = 44) Position 1 = 108, Position 2 = 99
Branch analysis from position: 108
Branch analysis from position: 99
Branch analysis from position: 78
2 jumps found. (Code = 44) Position 1 = 85, Position 2 = 78
Branch analysis from position: 85
Branch analysis from position: 78
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 57
Branch analysis from position: 64
Branch analysis from position: 57
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 34
Branch analysis from position: 43
Branch analysis from position: 34
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 13
Branch analysis from position: 20
Branch analysis from position: 13
filename:       /in/t4K5j
function name:  (null)
number of ops:  138
compiled vars:  !0 = $start1, !1 = $start0, !2 = $time_start, !3 = $i, !4 = $answer, !5 = $time_end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'phpversion'
          1        DO_ICALL                                         $6      
          2        CONCAT                                           ~7      'Current+PHP+Version%3A+', $6
          3        CONCAT                                           ~8      ~7, '%0A%0A'
          4        ECHO                                                     ~8
    4     5        ASSIGN                                                   !0, 1
    5     6        ASSIGN                                                   !1, 0
    7     7        INIT_FCALL                                               'microtime'
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !2, $11
    8    11        ASSIGN                                                   !3, 0
         12      > JMP                                                      ->18
   10    13    >   IS_EQUAL                                         ~14     !1, 1
         14        ASSIGN                                                   !4, ~14
   11    15        IS_EQUAL                                         ~16     !0, 1
         16        ASSIGN                                                   !4, ~16
    8    17        PRE_INC                                                  !3
         18    >   IS_SMALLER                                               !3, 8500000
         19      > JMPNZ                                                    ~19, ->13
   13    20    >   INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $20     
         23        ASSIGN                                                   !5, $20
   14    24        SUB                                              ~22     !5, !2
         25        CONCAT                                           ~23     'Did+COMPARISON+in+', ~22
         26        CONCAT                                           ~24     ~23, '+seconds%0A'
         27        ECHO                                                     ~24
   16    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $25     
         31        ASSIGN                                                   !2, $25
   17    32        ASSIGN                                                   !3, 0
         33      > JMP                                                      ->41
   19    34    >   ISSET_ISEMPTY_CV                                 ~28     !1
         35        BOOL_NOT                                         ~29     ~28
         36        ASSIGN                                                   !4, ~29
   20    37        ISSET_ISEMPTY_CV                                 ~31     !0
         38        BOOL_NOT                                         ~32     ~31
         39        ASSIGN                                                   !4, ~32
   17    40        PRE_INC                                                  !3
         41    >   IS_SMALLER                                               !3, 8500000
         42      > JMPNZ                                                    ~35, ->34
   22    43    >   INIT_FCALL                                               'microtime'
         44        SEND_VAL                                                 <true>
         45        DO_ICALL                                         $36     
         46        ASSIGN                                                   !5, $36
   23    47        SUB                                              ~38     !5, !2
         48        CONCAT                                           ~39     'Did+NOT+EMPTY+in+', ~38
         49        CONCAT                                           ~40     ~39, '+seconds%0A'
         50        ECHO                                                     ~40
   25    51        INIT_FCALL                                               'microtime'
         52        SEND_VAL                                                 <true>
         53        DO_ICALL                                         $41     
         54        ASSIGN                                                   !2, $41
   26    55        ASSIGN                                                   !3, 0
         56      > JMP                                                      ->62
   28    57    >   BOOL                                             ~44     !1
         58        ASSIGN                                                   !4, ~44
   29    59        BOOL                                             ~46     !0
         60        ASSIGN                                                   !4, ~46
   26    61        PRE_INC                                                  !3
         62    >   IS_SMALLER                                               !3, 8500000
         63      > JMPNZ                                                    ~49, ->57
   31    64    >   INIT_FCALL                                               'microtime'
         65        SEND_VAL                                                 <true>
         66        DO_ICALL                                         $50     
         67        ASSIGN                                                   !5, $50
   32    68        SUB                                              ~52     !5, !2
         69        CONCAT                                           ~53     'Did+TYPECAST+BOOL+in+', ~52
         70        CONCAT                                           ~54     ~53, '+seconds%0A'
         71        ECHO                                                     ~54
   34    72        INIT_FCALL                                               'microtime'
         73        SEND_VAL                                                 <true>
         74        DO_ICALL                                         $55     
         75        ASSIGN                                                   !2, $55
   35    76        ASSIGN                                                   !3, 0
         77      > JMP                                                      ->83
   37    78    >   BOOL                                             ~58     !1
         79        ASSIGN                                                   !4, ~58
   38    80        BOOL                                             ~60     !0
         81        ASSIGN                                                   !4, ~60
   35    82        PRE_INC                                                  !3
         83    >   IS_SMALLER                                               !3, 8500000
         84      > JMPNZ                                                    ~63, ->78
   40    85    >   INIT_FCALL                                               'microtime'
         86        SEND_VAL                                                 <true>
         87        DO_ICALL                                         $64     
         88        ASSIGN                                                   !5, $64
   41    89        SUB                                              ~66     !5, !2
         90        CONCAT                                           ~67     'Did+EQUALS+TRUE+in+', ~66
         91        CONCAT                                           ~68     ~67, '+seconds%0A'
         92        ECHO                                                     ~68
   43    93        INIT_FCALL                                               'microtime'
         94        SEND_VAL                                                 <true>
         95        DO_ICALL                                         $69     
         96        ASSIGN                                                   !2, $69
   44    97        ASSIGN                                                   !3, 0
         98      > JMP                                                      ->106
   46    99    >   BOOL_NOT                                         ~72     !1
        100        BOOL_NOT                                         ~73     ~72
        101        ASSIGN                                                   !4, ~73
   47   102        BOOL_NOT                                         ~75     !0
        103        BOOL_NOT                                         ~76     ~75
        104        ASSIGN                                                   !4, ~76
   44   105        PRE_INC                                                  !3
        106    >   IS_SMALLER                                               !3, 8500000
        107      > JMPNZ                                                    ~79, ->99
   49   108    >   INIT_FCALL                                               'microtime'
        109        SEND_VAL                                                 <true>
        110        DO_ICALL                                         $80     
        111        ASSIGN                                                   !5, $80
   50   112        SUB                                              ~82     !5, !2
        113        CONCAT                                           ~83     'Did+NOT+NOT+in+', ~82
        114        CONCAT                                           ~84     ~83, '+seconds%0A'
        115        ECHO                                                     ~84
   52   116        INIT_FCALL                                               'microtime'
        117        SEND_VAL                                                 <true>
        118        DO_ICALL                                         $85     
        119        ASSIGN                                                   !2, $85
   53   120        ASSIGN                                                   !3, 0
        121      > JMP                                                      ->127
   55   122    >   TYPE_CHECK                                    2  ~88     !1
        123        ASSIGN                                                   !4, ~88
   56   124        TYPE_CHECK                                    2  ~90     !0
        125        ASSIGN                                                   !4, ~90
   53   126        PRE_INC                                                  !3
        127    >   IS_SMALLER                                               !3, 8500000
        128      > JMPNZ                                                    ~93, ->122
   58   129    >   INIT_FCALL                                               'microtime'
        130        SEND_VAL                                                 <true>
        131        DO_ICALL                                         $94     
        132        ASSIGN                                                   !5, $94
   59   133        SUB                                              ~96     !5, !2
        134        CONCAT                                           ~97     'Did+IS+NULL+in+', ~96
        135        CONCAT                                           ~98     ~97, '+seconds%0A'
        136        ECHO                                                     ~98
        137      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.59 ms | 1019 KiB | 15 Q