3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '{download} button {download="hello"} {download=\'hey\'} assa {download="asa"}'; $str = str_replace('{download}', '{download="Download"}', $str); $str = preg_replace( '/\{download(\=\"(.*)\"|\=\'(.*)\'|)\}/siU', '<a href="#" class="button">$2</a>', $str); echo $str; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YA6Wu
function name:  (null)
number of ops:  15
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7Bdownload%7D+button+%7Bdownload%3D%22hello%22%7D+%7Bdownload%3D%27hey%27%7D+assa+%7Bdownload%3D%22asa%22%7D'
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '%7Bdownload%7D'
          3        SEND_VAL                                                 '%7Bdownload%3D%22Download%22%7D'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
    6     7        INIT_FCALL                                               'preg_replace'
    7     8        SEND_VAL                                                 '%2F%5C%7Bdownload%28%5C%3D%5C%22%28.%2A%29%5C%22%7C%5C%3D%27%28.%2A%29%27%7C%29%5C%7D%2FsiU'
    8     9        SEND_VAL                                                 '%3Ca+href%3D%22%23%22+class%3D%22button%22%3E%242%3C%2Fa%3E'
    9    10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $4      
    6    12        ASSIGN                                                   !0, $4
   11    13        ECHO                                                     !0
   13    14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.36 ms | 1394 KiB | 17 Q