3v4l.org

run code in 500+ PHP versions simultaneously
<?php $xml = <<<EOT <loc>https://subdomain.example.com</loc> <loc>https://subdomain.example.com/s/queen-katwe-2016-720p-hd-480p-hd/</loc> <loc>https://subdomain.example.com/s/justice-league-dark-2017-720p-hd-480p-hd/</loc> <loc>https://subdomain.example.com/s/edge-seventeen-2016-720p-hd-480p-hd/</loc> EOT; var_dump( preg_replace_callback( '/<loc>(?<value>[^<]+)<\/loc>/', static function($matches) { return sprintf('<loc>%1$s</loc>', mb_strimwidth($matches['value'], 0, 15)); }, $xml ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OhmtZ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $xml
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Cloc%3Ehttps%3A%2F%2Fsubdomain.example.com%3C%2Floc%3E%0A%3Cloc%3Ehttps%3A%2F%2Fsubdomain.example.com%2Fs%2Fqueen-katwe-2016-720p-hd-480p-hd%2F%3C%2Floc%3E%0A%3Cloc%3Ehttps%3A%2F%2Fsubdomain.example.com%2Fs%2Fjustice-league-dark-2017-720p-hd-480p-hd%2F%3C%2Floc%3E%0A%3Cloc%3Ehttps%3A%2F%2Fsubdomain.example.com%2Fs%2Fedge-seventeen-2016-720p-hd-480p-hd%2F%3C%2Floc%3E'
   10     1        INIT_FCALL                                                   'var_dump'
   11     2        INIT_FCALL                                                   'preg_replace_callback'
   12     3        SEND_VAL                                                     '%2F%3Cloc%3E%28%3F%3Cvalue%3E%5B%5E%3C%5D%2B%29%3C%5C%2Floc%3E%2F'
   13     4        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   15     5        SEND_VAL                                                     ~2
   16     6        SEND_VAR                                                     !0
   11     7        DO_ICALL                                             $3      
   16     8        SEND_VAR                                                     $3
   10     9        DO_ICALL                                                     
   18    10      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OhmtZ
function name:  {closure:/in/OhmtZ:13}
number of ops:  13
compiled vars:  !0 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
   14     1        INIT_FCALL                                                   'sprintf'
          2        SEND_VAL                                                     '%3Cloc%3E%251%24s%3C%2Floc%3E'
          3        INIT_FCALL                                                   'mb_strimwidth'
          4        FETCH_DIM_R                                          ~1      !0, 'value'
          5        SEND_VAL                                                     ~1
          6        SEND_VAL                                                     0
          7        SEND_VAL                                                     15
          8        DO_ICALL                                             $2      
          9        SEND_VAR                                                     $2
         10        DO_ICALL                                             $3      
         11      > RETURN                                                       $3
   15    12*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.5 ms | 1905 KiB | 17 Q