3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = [ '<ul> <li> Test, Test </li> <li> Test, Test </li> </ul>', '<ul> <li> Test, Test </li> </ul>', ]; $previous_value = libxml_use_internal_errors(true); $dom = new DOMDocument(); foreach($html as $list) { $dom->loadHTML($list); echo $dom->getElementsByTagName('li')->length . "\n"; } libxml_clear_errors(); libxml_use_internal_errors($previous_value);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/L7Ptm
function name:  (null)
number of ops:  27
compiled vars:  !0 = $html, !1 = $previous_value, !2 = $dom, !3 = $list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   19     1        INIT_FCALL                                               'libxml_use_internal_errors'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   21     5        NEW                                              $7      'DOMDocument'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $7
   22     8      > FE_RESET_R                                       $10     !0, ->20
          9    > > FE_FETCH_R                                               $10, !3, ->20
   23    10    >   INIT_METHOD_CALL                                         !2, 'loadHTML'
         11        SEND_VAR_EX                                              !3
         12        DO_FCALL                                      0          
   24    13        INIT_METHOD_CALL                                         !2, 'getElementsByTagName'
         14        SEND_VAL_EX                                              'li'
         15        DO_FCALL                                      0  $12     
         16        FETCH_OBJ_R                                      ~13     $12, 'length'
         17        CONCAT                                           ~14     ~13, '%0A'
         18        ECHO                                                     ~14
   22    19      > JMP                                                      ->9
         20    >   FE_FREE                                                  $10
   26    21        INIT_FCALL                                               'libxml_clear_errors'
         22        DO_ICALL                                                 
   27    23        INIT_FCALL                                               'libxml_use_internal_errors'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.32 ms | 1395 KiB | 17 Q