3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '#<tag foo="bar">([\w\s]+[^\s]+)\s?</tag>#'; echo preg_replace($regex, '\1', '<tag foo="bar">Jacopo Nuzzi</tag>'); echo preg_replace($regex, '\1', '<tag foo="bar">Jacopo Nuzzi </tag>'); echo preg_replace($regex, '\1', '<tag foo="bar">Jacopo </tag>'); echo preg_replace($regex, '\1', '<tag foo="bar">Jacopo</tag>');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9LIQs
function name:  (null)
number of ops:  26
compiled vars:  !0 = $regex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%23%3Ctag+foo%3D%22bar%22%3E%28%5B%5Cw%5Cs%5D%2B%5B%5E%5Cs%5D%2B%29%5Cs%3F%3C%2Ftag%3E%23'
    3     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%5C1'
          4        SEND_VAL                                                 '%3Ctag+foo%3D%22bar%22%3EJacopo+Nuzzi%3C%2Ftag%3E'
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
    4     7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 '%5C1'
         10        SEND_VAL                                                 '%3Ctag+foo%3D%22bar%22%3EJacopo+Nuzzi+%3C%2Ftag%3E'
         11        DO_ICALL                                         $3      
         12        ECHO                                                     $3
    5    13        INIT_FCALL                                               'preg_replace'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 '%5C1'
         16        SEND_VAL                                                 '%3Ctag+foo%3D%22bar%22%3EJacopo+%3C%2Ftag%3E'
         17        DO_ICALL                                         $4      
         18        ECHO                                                     $4
    6    19        INIT_FCALL                                               'preg_replace'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 '%5C1'
         22        SEND_VAL                                                 '%3Ctag+foo%3D%22bar%22%3EJacopo%3C%2Ftag%3E'
         23        DO_ICALL                                         $5      
         24        ECHO                                                     $5
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.55 ms | 1387 KiB | 15 Q