3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.96 ms | 1388 KiB | 15 Q