3v4l.org

run code in 300+ PHP versions simultaneously
<?php const ITERATIONS = 100000; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { try { throw new Exception($i); } catch (\Throwable $e) { } } $end = microtime(true); $total = $end - $start; echo "Throwing exceptions: $total\n"; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { new Exception($i); } $end = microtime(true); $total = $end - $start; echo "Creating exceptions: $total\n"; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { new stdClass(); } $end = microtime(true); $total = $end - $start; echo "Creating stdClass : $total\n"; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { new Attribute(); } $end = microtime(true); $total = $end - $start; echo "Creating Attribute : $total\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 33
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 57
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 84
Branch analysis from position: 84
2 jumps found. (Code = 44) Position 1 = 87, Position 2 = 80
Branch analysis from position: 87
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 80
2 jumps found. (Code = 44) Position 1 = 87, Position 2 = 80
Branch analysis from position: 87
Branch analysis from position: 80
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: 33
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 33
Branch analysis from position: 41
Branch analysis from position: 33
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/rXTja
function name:  (null)
number of ops:  98
compiled vars:  !0 = $start, !1 = $i, !2 = $e, !3 = $end, !4 = $total
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'ITERATIONS', 100000
    5     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !0, $5
    6     5        ASSIGN                                                   !1, 0
          6      > JMP                                                      ->14
    8     7    >   NEW                                              $8      'Exception'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $8
         11*       JMP                                                      ->13
    9    12  E > > CATCH                                       last         'Throwable'
    6    13    >   PRE_INC                                                  !1
         14    >   FETCH_CONSTANT                                   ~11     'ITERATIONS'
         15        IS_SMALLER                                               !1, ~11
         16      > JMPNZ                                                    ~12, ->7
   12    17    >   INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $13     
         20        ASSIGN                                                   !3, $13
   14    21        SUB                                              ~15     !3, !0
         22        ASSIGN                                                   !4, ~15
   15    23        ROPE_INIT                                     3  ~18     'Throwing+exceptions%3A+'
         24        ROPE_ADD                                      1  ~18     ~18, !4
         25        ROPE_END                                      2  ~17     ~18, '%0A'
         26        ECHO                                                     ~17
   17    27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $20     
         30        ASSIGN                                                   !0, $20
   18    31        ASSIGN                                                   !1, 0
         32      > JMP                                                      ->38
   19    33    >   NEW                                              $23     'Exception'
         34        SEND_VAR_EX                                              !1
         35        DO_FCALL                                      0          
         36        FREE                                                     $23
   18    37        PRE_INC                                                  !1
         38    >   FETCH_CONSTANT                                   ~26     'ITERATIONS'
         39        IS_SMALLER                                               !1, ~26
         40      > JMPNZ                                                    ~27, ->33
   21    41    >   INIT_FCALL                                               'microtime'
         42        SEND_VAL                                                 <true>
         43        DO_ICALL                                         $28     
         44        ASSIGN                                                   !3, $28
   23    45        SUB                                              ~30     !3, !0
         46        ASSIGN                                                   !4, ~30
   24    47        ROPE_INIT                                     3  ~33     'Creating+exceptions%3A+'
         48        ROPE_ADD                                      1  ~33     ~33, !4
         49        ROPE_END                                      2  ~32     ~33, '%0A'
         50        ECHO                                                     ~32
   26    51        INIT_FCALL                                               'microtime'
         52        SEND_VAL                                                 <true>
         53        DO_ICALL                                         $35     
         54        ASSIGN                                                   !0, $35
   27    55        ASSIGN                                                   !1, 0
         56      > JMP                                                      ->61
   28    57    >   NEW                                              $38     'stdClass'
         58        DO_FCALL                                      0          
         59        FREE                                                     $38
   27    60        PRE_INC                                                  !1
         61    >   FETCH_CONSTANT                                   ~41     'ITERATIONS'
         62        IS_SMALLER                                               !1, ~41
         63      > JMPNZ                                                    ~42, ->57
   30    64    >   INIT_FCALL                                               'microtime'
         65        SEND_VAL                                                 <true>
         66        DO_ICALL                                         $43     
         67        ASSIGN                                                   !3, $43
   32    68        SUB                                              ~45     !3, !0
         69        ASSIGN                                                   !4, ~45
   33    70        ROPE_INIT                                     3  ~48     'Creating+stdClass++%3A+'
         71        ROPE_ADD                                      1  ~48     ~48, !4
         72        ROPE_END                                      2  ~47     ~48, '%0A'
         73        ECHO                                                     ~47
   35    74        INIT_FCALL                                               'microtime'
         75        SEND_VAL                                                 <true>
         76        DO_ICALL                                         $50     
         77        ASSIGN                                                   !0, $50
   36    78        ASSIGN                                                   !1, 0
         79      > JMP                                                      ->84
   37    80    >   NEW                                              $53     'Attribute'
         81        DO_FCALL                                      0          
         82        FREE                                                     $53
   36    83        PRE_INC                                                  !1
         84    >   FETCH_CONSTANT                                   ~56     'ITERATIONS'
         85        IS_SMALLER                                               !1, ~56
         86      > JMPNZ                                                    ~57, ->80
   39    87    >   INIT_FCALL                                               'microtime'
         88        SEND_VAL                                                 <true>
         89        DO_ICALL                                         $58     
         90        ASSIGN                                                   !3, $58
   41    91        SUB                                              ~60     !3, !0
         92        ASSIGN                                                   !4, ~60
   42    93        ROPE_INIT                                     3  ~63     'Creating+Attribute+%3A+'
         94        ROPE_ADD                                      1  ~63     ~63, !4
         95        ROPE_END                                      2  ~62     ~63, '%0A'
         96        ECHO                                                     ~62
         97      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.62 ms | 1019 KiB | 14 Q