3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument( '1.0', 'UTF-8' ); $doc->loadHTML( '<?xml encoding="utf-8" ?><p><p><p><p><p>five<p><p><p><p><p>ten' ); $body = $doc->documentElement->childNodes[0]; $start = hrtime( true ); for ( $i = 0; $i < 1_000_000; $i++ ) $dummy = $body->childNodes->item( 4 ); $stop = hrtime( true ); $seconds = ( $stop - $start ) / 1_000_000_000; echo "$seconds s" . PHP_EOL; $start = hrtime( true ); for ( $i = 0; $i < 1_000_000; $i++ ) $dummy = $body->childNodes[4]; $stop = hrtime( true ); $seconds = ( $stop - $start ) / 1_000_000_000; echo "$seconds s" . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 18
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
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: 18
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 18
Branch analysis from position: 26
Branch analysis from position: 18
filename:       /in/NGEKe
function name:  (null)
number of ops:  61
compiled vars:  !0 = $doc, !1 = $body, !2 = $start, !3 = $i, !4 = $dummy, !5 = $stop, !6 = $seconds
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $7      'DOMDocument'
          1        SEND_VAL_EX                                              '1.0'
          2        SEND_VAL_EX                                              'UTF-8'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $7
    4     5        INIT_METHOD_CALL                                         !0, 'loadHTML'
          6        SEND_VAL_EX                                              '%3C%3Fxml+encoding%3D%22utf-8%22+%3F%3E%3Cp%3E%3Cp%3E%3Cp%3E%3Cp%3E%3Cp%3Efive%3Cp%3E%3Cp%3E%3Cp%3E%3Cp%3E%3Cp%3Eten'
          7        DO_FCALL                                      0          
    5     8        FETCH_OBJ_R                                      ~11     !0, 'documentElement'
          9        FETCH_OBJ_R                                      ~12     ~11, 'childNodes'
         10        FETCH_DIM_R                                      ~13     ~12, 0
         11        ASSIGN                                                   !1, ~13
    7    12        INIT_FCALL                                               'hrtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $15     
         15        ASSIGN                                                   !2, $15
    8    16        ASSIGN                                                   !3, 0
         17      > JMP                                                      ->24
    9    18    >   FETCH_OBJ_R                                      ~18     !1, 'childNodes'
         19        INIT_METHOD_CALL                                         ~18, 'item'
         20        SEND_VAL_EX                                              4
         21        DO_FCALL                                      0  $19     
         22        ASSIGN                                                   !4, $19
    8    23        PRE_INC                                                  !3
         24    >   IS_SMALLER                                               !3, 1000000
         25      > JMPNZ                                                    ~22, ->18
   10    26    >   INIT_FCALL                                               'hrtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $23     
         29        ASSIGN                                                   !5, $23
   11    30        SUB                                              ~25     !5, !2
         31        DIV                                              ~26     ~25, 1000000000
         32        ASSIGN                                                   !6, ~26
   12    33        NOP                                                      
         34        FAST_CONCAT                                      ~28     !6, '+s'
         35        CONCAT                                           ~29     ~28, '%0A'
         36        ECHO                                                     ~29
   14    37        INIT_FCALL                                               'hrtime'
         38        SEND_VAL                                                 <true>
         39        DO_ICALL                                         $30     
         40        ASSIGN                                                   !2, $30
   15    41        ASSIGN                                                   !3, 0
         42      > JMP                                                      ->47
   16    43    >   FETCH_OBJ_R                                      ~33     !1, 'childNodes'
         44        FETCH_DIM_R                                      ~34     ~33, 4
         45        ASSIGN                                                   !4, ~34
   15    46        PRE_INC                                                  !3
         47    >   IS_SMALLER                                               !3, 1000000
         48      > JMPNZ                                                    ~37, ->43
   17    49    >   INIT_FCALL                                               'hrtime'
         50        SEND_VAL                                                 <true>
         51        DO_ICALL                                         $38     
         52        ASSIGN                                                   !5, $38
   18    53        SUB                                              ~40     !5, !2
         54        DIV                                              ~41     ~40, 1000000000
         55        ASSIGN                                                   !6, ~41
   19    56        NOP                                                      
         57        FAST_CONCAT                                      ~43     !6, '+s'
         58        CONCAT                                           ~44     ~43, '%0A'
         59        ECHO                                                     ~44
   20    60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.24 ms | 1010 KiB | 14 Q