3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <p><a rel="nofollow" class="external text" href="http://10.20.0.30:1234/index.php/this_is_an_example.html">How_to_sample.</a></p> HTML; $dom = new DOMDocument; $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); foreach($dom->getElementsByTagName('a') as $a) { $a->setAttribute('href', str_replace('_', '%20', $a->getAttribute('href'))); } echo $dom->saveHTML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 26
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 26
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/o6aUs
function name:  (null)
number of ops:  31
compiled vars:  !0 = $html, !1 = $dom, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cp%3E%3Ca+rel%3D%22nofollow%22+class%3D%22external+text%22+href%3D%22http%3A%2F%2F10.20.0.30%3A1234%2Findex.php%2Fthis_is_an_example.html%22%3EHow_to_sample.%3C%2Fa%3E%3C%2Fp%3E'
    7     1        NEW                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    8     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAL_EX                                              8196
          7        DO_FCALL                                      0          
    9     8        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          9        SEND_VAL_EX                                              'a'
         10        DO_FCALL                                      0  $8      
         11      > FE_RESET_R                                       $9      $8, ->26
         12    > > FE_FETCH_R                                               $9, !2, ->26
   10    13    >   INIT_METHOD_CALL                                         !2, 'setAttribute'
         14        SEND_VAL_EX                                              'href'
         15        INIT_FCALL                                               'str_replace'
         16        SEND_VAL                                                 '_'
         17        SEND_VAL                                                 '%2520'
         18        INIT_METHOD_CALL                                         !2, 'getAttribute'
         19        SEND_VAL_EX                                              'href'
         20        DO_FCALL                                      0  $10     
         21        SEND_VAR                                                 $10
         22        DO_ICALL                                         $11     
         23        SEND_VAR_NO_REF_EX                                       $11
         24        DO_FCALL                                      0          
    9    25      > JMP                                                      ->12
         26    >   FE_FREE                                                  $9
   12    27        INIT_METHOD_CALL                                         !1, 'saveHTML'
         28        DO_FCALL                                      0  $13     
         29        ECHO                                                     $13
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.76 ms | 1076 KiB | 14 Q