3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i = 0; $start = microtime(true); $date = new DateTime('2018-02-13'); $period = '+5 days'; while ($i++ < 10000) { $date->modify($period); } $end = microtime(true); echo $date->format('Y-m-d H:i:s'), PHP_EOL; echo $end - $start, PHP_EOL; $i = 0; $start = microtime(true); $date = new DateTime('2018-02-13'); $period = new DateInterval('P5D'); while ($i++ < 10000) { $date->add($period); } $end = microtime(true); echo $date->format('Y-m-d H:i:s'), PHP_EOL; echo $end - $start, PHP_EOL;
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 = 11
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 43
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 43
Branch analysis from position: 49
Branch analysis from position: 43
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 11
Branch analysis from position: 17
Branch analysis from position: 11
filename:       /in/2luKd
function name:  (null)
number of ops:  62
compiled vars:  !0 = $i, !1 = $start, !2 = $date, !3 = $period, !4 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    4     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    5     5        NEW                                              $8      'DateTime'
          6        SEND_VAL_EX                                              '2018-02-13'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $8
    6     9        ASSIGN                                                   !3, '%2B5+days'
    7    10      > JMP                                                      ->14
    8    11    >   INIT_METHOD_CALL                                         !2, 'modify'
         12        SEND_VAR_EX                                              !3
         13        DO_FCALL                                      0          
    7    14    >   POST_INC                                         ~13     !0
         15        IS_SMALLER                                               ~13, 10000
         16      > JMPNZ                                                    ~14, ->11
   10    17    >   INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $15     
         20        ASSIGN                                                   !4, $15
   12    21        INIT_METHOD_CALL                                         !2, 'format'
         22        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         23        DO_FCALL                                      0  $17     
         24        ECHO                                                     $17
         25        ECHO                                                     '%0A'
   13    26        SUB                                              ~18     !4, !1
         27        ECHO                                                     ~18
         28        ECHO                                                     '%0A'
   15    29        ASSIGN                                                   !0, 0
   16    30        INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $20     
         33        ASSIGN                                                   !1, $20
   17    34        NEW                                              $22     'DateTime'
         35        SEND_VAL_EX                                              '2018-02-13'
         36        DO_FCALL                                      0          
         37        ASSIGN                                                   !2, $22
   18    38        NEW                                              $25     'DateInterval'
         39        SEND_VAL_EX                                              'P5D'
         40        DO_FCALL                                      0          
         41        ASSIGN                                                   !3, $25
   19    42      > JMP                                                      ->46
   20    43    >   INIT_METHOD_CALL                                         !2, 'add'
         44        SEND_VAR_EX                                              !3
         45        DO_FCALL                                      0          
   19    46    >   POST_INC                                         ~29     !0
         47        IS_SMALLER                                               ~29, 10000
         48      > JMPNZ                                                    ~30, ->43
   22    49    >   INIT_FCALL                                               'microtime'
         50        SEND_VAL                                                 <true>
         51        DO_ICALL                                         $31     
         52        ASSIGN                                                   !4, $31
   24    53        INIT_METHOD_CALL                                         !2, 'format'
         54        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         55        DO_FCALL                                      0  $33     
         56        ECHO                                                     $33
         57        ECHO                                                     '%0A'
   25    58        SUB                                              ~34     !4, !1
         59        ECHO                                                     ~34
         60        ECHO                                                     '%0A'
   26    61      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.4 ms | 1010 KiB | 14 Q