3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<!doctype html> <html> <body> <img src="computerIcon.png"> </body> </html> '; $proxy = 'https://proxy.example.com/?url=https://domain.example.com/'; $xml = new DOMDocument("1.0", "utf-8"); $xml->loadHTML($html); foreach($xml->getElementsByTagName('img') as $item) { $item->setAttribute('src', $proxy . $item->getAttribute('src')); } $xml->formatOutput = true; echo $xml->saveHTML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/bW68Z
function name:  (null)
number of ops:  31
compiled vars:  !0 = $html, !1 = $proxy, !2 = $xml, !3 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%21doctype+html%3E%0A%3Chtml%3E%0A+%3Cbody%3E%0A++%3Cimg+src%3D%22computerIcon.png%22%3E%0A+%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A'
   11     1        ASSIGN                                                   !1, 'https%3A%2F%2Fproxy.example.com%2F%3Furl%3Dhttps%3A%2F%2Fdomain.example.com%2F'
   13     2        NEW                                              $6      'DOMDocument'
          3        SEND_VAL_EX                                              '1.0'
          4        SEND_VAL_EX                                              'utf-8'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !2, $6
   14     7        INIT_METHOD_CALL                                         !2, 'loadHTML'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   15    10        INIT_METHOD_CALL                                         !2, 'getElementsByTagName'
         11        SEND_VAL_EX                                              'img'
         12        DO_FCALL                                      0  $10     
         13      > FE_RESET_R                                       $11     $10, ->24
         14    > > FE_FETCH_R                                               $11, !3, ->24
   16    15    >   INIT_METHOD_CALL                                         !3, 'setAttribute'
         16        SEND_VAL_EX                                              'src'
         17        INIT_METHOD_CALL                                         !3, 'getAttribute'
         18        SEND_VAL_EX                                              'src'
         19        DO_FCALL                                      0  $12     
         20        CONCAT                                           ~13     !1, $12
         21        SEND_VAL_EX                                              ~13
         22        DO_FCALL                                      0          
   15    23      > JMP                                                      ->14
         24    >   FE_FREE                                                  $11
   18    25        ASSIGN_OBJ                                               !2, 'formatOutput'
         26        OP_DATA                                                  <true>
   19    27        INIT_METHOD_CALL                                         !2, 'saveHTML'
         28        DO_FCALL                                      0  $16     
         29        ECHO                                                     $16
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
240.12 ms | 998 KiB | 13 Q