3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image id="my-image" xlink:href="http://example.com/image.png" /> </svg> '); $xml->registerXPathNamespace('svg', 'http://www.w3.org/2000/svg'); $xml->registerXPathNamespace('xlink', 'http://www.w3.org/1999/xlink'); $images = $xml->xpath('//svg:image[@xlink:href]'); foreach ($images as $image) { var_dump($image); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/NTcvP
function name:  (null)
number of ops:  24
compiled vars:  !0 = $xml, !1 = $images, !2 = $image
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $3      'SimpleXMLElement'
          1        SEND_VAL_EX                                              '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22+%3F%3E%0A++++%3Csvg+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22+xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%0A++++++++%3Cimage+id%3D%22my-image%22+xlink%3Ahref%3D%22http%3A%2F%2Fexample.com%2Fimage.png%22+%2F%3E%0A++++%3C%2Fsvg%3E%0A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    9     4        INIT_METHOD_CALL                                         !0, 'registerXPathNamespace'
          5        SEND_VAL_EX                                              'svg'
          6        SEND_VAL_EX                                              'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'
          7        DO_FCALL                                      0          
   10     8        INIT_METHOD_CALL                                         !0, 'registerXPathNamespace'
          9        SEND_VAL_EX                                              'xlink'
         10        SEND_VAL_EX                                              'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'
         11        DO_FCALL                                      0          
   11    12        INIT_METHOD_CALL                                         !0, 'xpath'
         13        SEND_VAL_EX                                              '%2F%2Fsvg%3Aimage%5B%40xlink%3Ahref%5D'
         14        DO_FCALL                                      0  $8      
         15        ASSIGN                                                   !1, $8
   12    16      > FE_RESET_R                                       $10     !1, ->22
         17    > > FE_FETCH_R                                               $10, !2, ->22
   13    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
   12    21      > JMP                                                      ->17
         22    >   FE_FREE                                                  $10
   14    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.14 ms | 1006 KiB | 14 Q