3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str='<li><a href="test1.php">21.03.2017 <ul>Test1</ul> </a><p> <a href="test1"></a> </p> </li> <li><a href="test2.php">21.03.2017 <ul>Text2</ul> </a><p> <a href="test2.php"></a> </p> </li>'; $dom = new DOMDocument; @$dom->loadHTML($str); $aList = $dom->getElementsByTagName('a'); foreach ($aList as $a) { $output[] = array ( 'str' => $a->nodeValue, 'href' => $a->getAttribute('href') ); } var_dump($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/4Ln5E
function name:  (null)
number of ops:  29
compiled vars:  !0 = $str, !1 = $dom, !2 = $aList, !3 = $a, !4 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cli%3E%3Ca+href%3D%22test1.php%22%3E21.03.2017%0A%0A++++%3Cul%3ETest1%3C%2Ful%3E%0A++++%3C%2Fa%3E%3Cp%3E%0A%0A++++%3Ca+href%3D%22test1%22%3E%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A++++%3C%2Fli%3E%0A%0A++++%3Cli%3E%3Ca+href%3D%22test2.php%22%3E21.03.2017%0A%0A++++%3Cul%3EText2%3C%2Ful%3E%0A++++%3C%2Fa%3E%3Cp%3E%0A%0A++++%3Ca+href%3D%22test2.php%22%3E%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A++++%3C%2Fli%3E'
   23     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
   25     4        BEGIN_SILENCE                                    ~9      
          5        INIT_METHOD_CALL                                         !1, 'loadHTML'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
          8        END_SILENCE                                              ~9
   28     9        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
         10        SEND_VAL_EX                                              'a'
         11        DO_FCALL                                      0  $11     
         12        ASSIGN                                                   !2, $11
   30    13      > FE_RESET_R                                       $13     !2, ->24
         14    > > FE_FETCH_R                                               $13, !3, ->24
   32    15    >   FETCH_OBJ_R                                      ~15     !3, 'nodeValue'
         16        INIT_ARRAY                                       ~16     ~15, 'str'
   33    17        INIT_METHOD_CALL                                         !3, 'getAttribute'
         18        SEND_VAL_EX                                              'href'
         19        DO_FCALL                                      0  $17     
         20        ADD_ARRAY_ELEMENT                                ~16     $17, 'href'
   31    21        ASSIGN_DIM                                               !4
   33    22        OP_DATA                                                  ~16
   30    23      > JMP                                                      ->14
         24    >   FE_FREE                                                  $13
   37    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !4
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.59 ms | 1396 KiB | 15 Q