3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <p>Some random text <iframe src="the link"" width="425" height="350" frameborder="0"></iframe></p> HTML; libxml_use_internal_errors(true); $dom = new DOMDocument; $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); foreach ($dom->getElementsByTagName('iframe') as $iframe) { $iframe->setAttribute('data-src', $iframe->getAttribute('src')); $iframe->removeAttribute('src'); } echo $dom->saveHTML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 27
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/SjZST
function name:  (null)
number of ops:  32
compiled vars:  !0 = $html, !1 = $dom, !2 = $iframe
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cp%3ESome+random+text+%3Ciframe+src%3D%22the+link%22%22+width%3D%22425%22+height%3D%22350%22+frameborder%3D%220%22%3E%3C%2Fiframe%3E%3C%2Fp%3E'
    7     1        INIT_FCALL                                               'libxml_use_internal_errors'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                                 
    8     4        NEW                                              $5      'DOMDocument'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
    9     7        INIT_METHOD_CALL                                         !1, 'loadHTML'
          8        SEND_VAR_EX                                              !0
          9        SEND_VAL_EX                                              8196
         10        DO_FCALL                                      0          
   10    11        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
         12        SEND_VAL_EX                                              'iframe'
         13        DO_FCALL                                      0  $9      
         14      > FE_RESET_R                                       $10     $9, ->27
         15    > > FE_FETCH_R                                               $10, !2, ->27
   11    16    >   INIT_METHOD_CALL                                         !2, 'setAttribute'
         17        SEND_VAL_EX                                              'data-src'
         18        INIT_METHOD_CALL                                         !2, 'getAttribute'
         19        SEND_VAL_EX                                              'src'
         20        DO_FCALL                                      0  $11     
         21        SEND_VAR_NO_REF_EX                                       $11
         22        DO_FCALL                                      0          
   12    23        INIT_METHOD_CALL                                         !2, 'removeAttribute'
         24        SEND_VAL_EX                                              'src'
         25        DO_FCALL                                      0          
   10    26      > JMP                                                      ->15
         27    >   FE_FREE                                                  $10
   14    28        INIT_METHOD_CALL                                         !1, 'saveHTML'
         29        DO_FCALL                                      0  $14     
         30        ECHO                                                     $14
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.73 ms | 1011 KiB | 14 Q