3v4l.org

run code in 500+ PHP versions simultaneously
<?php $xml = <<<EOT <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <url> <loc>https://subdomain.example.com</loc> <priority>1.0</priority> <changefreq>always</changefreq> </url> <url> <loc>https://subdomain.example.com/s/queen-katwe-2016-720p-hd-480p-hd/</loc> <priority>1.0</priority> <changefreq>always</changefreq> </url><url> <loc>https://subdomain.example.com/s/justice-league-dark-2017-720p-hd-480p-hd/</loc> <priority>1.0</priority> <changefreq>always</changefreq> </url><url> <loc>https://subdomain.example.com/s/edge-seventeen-2016-720p-hd-480p-hd/</loc> <priority>1.0</priority> <changefreq>always</changefreq> </url></urlset> EOT; $dom = new DOMDocument; $dom->loadXML($xml); foreach($dom->getElementsByTagName('loc') as $node) { if ((XML_ELEMENT_NODE === $node->nodeType) && ('loc' === $node->nodeName)){ $node->nodeValue = mb_strimwidth($node->nodeValue, 0, 15); } } echo $dom->saveHTML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 28
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 28
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 27
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 27
Branch analysis from position: 18
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/fvS02
function name:  (null)
number of ops:  33
compiled vars:  !0 = $xml, !1 = $dom, !2 = $node
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Curlset+xmlns%3D%22http%3A%2F%2Fwww.sitemaps.org%2Fschemas%2Fsitemap%2F0.9%22+xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22+xsi%3AschemaLocation%3D%22http%3A%2F%2Fwww.sitemaps.org%2Fschemas%2Fsitemap%2F0.9+http%3A%2F%2Fwww.sitemaps.org%2Fschemas%2Fsitemap%2F0.9%2Fsitemap.xsd%22%3E%0A%3Curl%3E%0A%3Cloc%3Ehttps%3A%2F%2Fsubdomain.example.com%3C%2Floc%3E%0A%3Cpriority%3E1.0%3C%2Fpriority%3E%0A%3Cchangefreq%3Ealways%3C%2Fchangefreq%3E%0A%3C%2Furl%3E%0A%3Curl%3E%0A%3Cloc%3Ehttps%3A%2F%2Fsubdomain.example.com%2Fs%2Fqueen-katwe-2016-720p-hd-480p-hd%2F%3C%2Floc%3E%0A%3Cpriority%3E1.0%3C%2Fpriority%3E%0A%3Cchangefreq%3Ealways%3C%2Fchangefreq%3E%0A%3C%2Furl%3E%3Curl%3E%0A%3Cloc%3Ehttps%3A%2F%2Fsubdomain.example.com%2Fs%2Fjustice-league-dark-2017-720p-hd-480p-hd%2F%3C%2Floc%3E%0A%3Cpriority%3E1.0%3C%2Fpriority%3E%0A%3Cchangefreq%3Ealways%3C%2Fchangefreq%3E%0A%3C%2Furl%3E%3Curl%3E%0A%3Cloc%3Ehttps%3A%2F%2Fsubdomain.example.com%2Fs%2Fedge-seventeen-2016-720p-hd-480p-hd%2F%3C%2Floc%3E%0A%3Cpriority%3E1.0%3C%2Fpriority%3E%0A%3Cchangefreq%3Ealways%3C%2Fchangefreq%3E%0A%3C%2Furl%3E%3C%2Furlset%3E'
   25     1        NEW                                                  $4      'DOMDocument'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $4
   26     4        INIT_METHOD_CALL                                             !1, 'loadXML'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0          
   28     7        INIT_METHOD_CALL                                             !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                                  'loc'
          9        DO_FCALL                                          0  $8      
         10      > FE_RESET_R                                           $9      $8, ->28
         11    > > FE_FETCH_R                                                   $9, !2, ->28
   29    12    >   FETCH_OBJ_R                                          ~10     !2, 'nodeType'
         13        IS_IDENTICAL                                         ~11     ~10, 1
         14      > JMPZ_EX                                              ~11     ~11, ->18
         15    >   FETCH_OBJ_R                                          ~12     !2, 'nodeName'
         16        IS_IDENTICAL                                         ~13     ~12, 'loc'
         17        BOOL                                                 ~11     ~13
         18    > > JMPZ                                                         ~11, ->27
   30    19    >   INIT_FCALL                                                   'mb_strimwidth'
         20        FETCH_OBJ_R                                          ~15     !2, 'nodeValue'
         21        SEND_VAL                                                     ~15
         22        SEND_VAL                                                     0
         23        SEND_VAL                                                     15
         24        DO_ICALL                                             $16     
         25        ASSIGN_OBJ                                                   !2, 'nodeValue'
         26        OP_DATA                                                      $16
   28    27    > > JMP                                                          ->11
         28    >   FE_FREE                                                      $9
   34    29        INIT_METHOD_CALL                                             !1, 'saveHTML'
         30        DO_FCALL                                          0  $17     
         31        ECHO                                                         $17
         32      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
208.64 ms | 2012 KiB | 14 Q