3v4l.org

run code in 500+ 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 = 23
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/o6aUs
function name:  (null)
number of ops:  28
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, ->23
         12    > > FE_FETCH_R                                                   $9, !2, ->23
   10    13    >   INIT_METHOD_CALL                                             !2, 'setAttribute'
         14        SEND_VAL_EX                                                  'href'
         15        INIT_METHOD_CALL                                             !2, 'getAttribute'
         16        SEND_VAL_EX                                                  'href'
         17        DO_FCALL                                          0  $10     
         18        FRAMELESS_ICALL_3                str_replace         ~11     '_', '%2520'
         19        OP_DATA                                                      $10
         20        SEND_VAL_EX                                                  ~11
         21        DO_FCALL                                          0          
    9    22      > JMP                                                          ->12
         23    >   FE_FREE                                                      $9
   12    24        INIT_METHOD_CALL                                             !1, 'saveHTML'
         25        DO_FCALL                                          0  $13     
         26        ECHO                                                         $13
         27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.86 ms | 2068 KiB | 13 Q