3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<html><body> <a href="a.html">some a</a> <a href="b.html">some b</a> </body></html>'; libxml_use_internal_errors(true); // ignore malformed HTML $xml = new DOMDocument(); $xml->loadHTML($html); foreach($xml->getElementsByTagName('a') as $link) { $link->nodeValue = $link->nodeValue . ' --- ' . $link->getAttribute('href'); } print_r($html);
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/TSrgT
function name:  (null)
number of ops:  29
compiled vars:  !0 = $html, !1 = $xml, !2 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%3Cbody%3E%0A++++++++++%3Ca+href%3D%22a.html%22%3Esome+a%3C%2Fa%3E%0A++++++++++%3Ca+href%3D%22b.html%22%3Esome+b%3C%2Fa%3E%0A+++++++++%3C%2Fbody%3E%3C%2Fhtml%3E'
    6     1        INIT_FCALL                                               'libxml_use_internal_errors'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                                 
    7     4        NEW                                              $5      'DOMDocument'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
    8     7        INIT_METHOD_CALL                                         !1, 'loadHTML'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
    9    10        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
         11        SEND_VAL_EX                                              'a'
         12        DO_FCALL                                      0  $9      
         13      > FE_RESET_R                                       $10     $9, ->24
         14    > > FE_FETCH_R                                               $10, !2, ->24
   10    15    >   FETCH_OBJ_R                                      ~12     !2, 'nodeValue'
         16        CONCAT                                           ~13     ~12, '+---+'
         17        INIT_METHOD_CALL                                         !2, 'getAttribute'
         18        SEND_VAL_EX                                              'href'
         19        DO_FCALL                                      0  $14     
         20        CONCAT                                           ~15     ~13, $14
         21        ASSIGN_OBJ                                               !2, 'nodeValue'
         22        OP_DATA                                                  ~15
    9    23      > JMP                                                      ->14
         24    >   FE_FREE                                                  $10
   13    25        INIT_FCALL                                               'print_r'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.06 ms | 1396 KiB | 17 Q