3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.73 ms | 1386 KiB | 13 Q