3v4l.org

run code in 300+ PHP versions simultaneously
<?php $buffer="<img src='ggg' />"; $dom = new DOMDocument(); $dom->loadHTML($buffer); foreach($doc->getElementsByTagName('img') as $tag) { $src = $tag->getAttribute('src'); $tag->setAttribute('data-src', '/images/blank.gif'); $tag->setAttribute('data-original', $src); } $buffer=$dom->saveHTML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 25
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/mTecU
function name:  (null)
number of ops:  30
compiled vars:  !0 = $buffer, !1 = $dom, !2 = $doc, !3 = $tag, !4 = $src
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cimg+src%3D%27ggg%27+%2F%3E'
    3     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
    4     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    7     7        INIT_METHOD_CALL                                         !2, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'img'
          9        DO_FCALL                                      0  $10     
         10      > FE_RESET_R                                       $11     $10, ->25
         11    > > FE_FETCH_R                                               $11, !3, ->25
    8    12    >   INIT_METHOD_CALL                                         !3, 'getAttribute'
         13        SEND_VAL_EX                                              'src'
         14        DO_FCALL                                      0  $12     
         15        ASSIGN                                                   !4, $12
    9    16        INIT_METHOD_CALL                                         !3, 'setAttribute'
         17        SEND_VAL_EX                                              'data-src'
         18        SEND_VAL_EX                                              '%2Fimages%2Fblank.gif'
         19        DO_FCALL                                      0          
   10    20        INIT_METHOD_CALL                                         !3, 'setAttribute'
         21        SEND_VAL_EX                                              'data-original'
         22        SEND_VAR_EX                                              !4
         23        DO_FCALL                                      0          
    7    24      > JMP                                                      ->11
         25    >   FE_FREE                                                  $11
   15    26        INIT_METHOD_CALL                                         !1, 'saveHTML'
         27        DO_FCALL                                      0  $16     
         28        ASSIGN                                                   !0, $16
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.28 ms | 1395 KiB | 13 Q