3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <p>Some random text <iframe src="http://some-random-link.com" width="425" height="350" frameborder="0"></iframe></p> HTML; $dom = new DOMDocument; $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); foreach ($dom->getElementsByTagName('iframe') as $iframe) { $src = $iframe->getAttribute('src'); if (parse_url($src, PHP_URL_SCHEME) === 'http') { $iframe->setAttribute('src', substr_replace($src, 's', 4, 0)); } } echo $dom->saveHTML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 34
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 34
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 33
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 33
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/auMZ6
function name:  (null)
number of ops:  39
compiled vars:  !0 = $html, !1 = $dom, !2 = $iframe, !3 = $src
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cp%3ESome+random+text+%3Ciframe+src%3D%22http%3A%2F%2Fsome-random-link.com%22+width%3D%22425%22+height%3D%22350%22+frameborder%3D%220%22%3E%3C%2Fiframe%3E%3C%2Fp%3E'
    7     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    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                                              'iframe'
         10        DO_FCALL                                      0  $9      
         11      > FE_RESET_R                                       $10     $9, ->34
         12    > > FE_FETCH_R                                               $10, !2, ->34
   10    13    >   INIT_METHOD_CALL                                         !2, 'getAttribute'
         14        SEND_VAL_EX                                              'src'
         15        DO_FCALL                                      0  $11     
         16        ASSIGN                                                   !3, $11
   11    17        INIT_FCALL                                               'parse_url'
         18        SEND_VAR                                                 !3
         19        SEND_VAL                                                 0
         20        DO_ICALL                                         $13     
         21        IS_IDENTICAL                                             $13, 'http'
         22      > JMPZ                                                     ~14, ->33
   12    23    >   INIT_METHOD_CALL                                         !2, 'setAttribute'
         24        SEND_VAL_EX                                              'src'
         25        INIT_FCALL                                               'substr_replace'
         26        SEND_VAR                                                 !3
         27        SEND_VAL                                                 's'
         28        SEND_VAL                                                 4
         29        SEND_VAL                                                 0
         30        DO_ICALL                                         $15     
         31        SEND_VAR_NO_REF_EX                                       $15
         32        DO_FCALL                                      0          
    9    33    > > JMP                                                      ->12
         34    >   FE_FREE                                                  $10
   15    35        INIT_METHOD_CALL                                         !1, 'saveHTML'
         36        DO_FCALL                                      0  $17     
         37        ECHO                                                     $17
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.1 ms | 1008 KiB | 15 Q