3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replaceSingleQuotesInsideTags( $input ) { $output = preg_replace('/<[^>]*>/e', "str_replace(\"'\", \"\\\"\", '$0')", $input); echo $output; } replaceSingleQuotesInsideTags("On <A href='/home/' target='_self'>this</Apage you will find <SPAN STYLE='font-style: italic'>stuff</SPAN>"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jcQXX
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'replacesinglequotesinsidetags'
          1        SEND_VAL                                                 'On+%3CA+href%3D%27%2Fhome%2F%27+target%3D%27_self%27%3Ethis%3C%2FApage+you+will+find+%3CSPAN+STYLE%3D%27font-style%3A+italic%27%3Estuff%3C%2FSPAN%3E'
          2        DO_FCALL                                      0          
   10     3      > RETURN                                                   1

Function replacesinglequotesinsidetags:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jcQXX
function name:  replaceSingleQuotesInsideTags
number of ops:  9
compiled vars:  !0 = $input, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%3C%5B%5E%3E%5D%2A%3E%2Fe'
          3        SEND_VAL                                                 'str_replace%28%22%27%22%2C+%22%5C%22%22%2C+%27%240%27%29'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !1, $2
    6     7        ECHO                                                     !1
    7     8      > RETURN                                                   null

End of function replacesinglequotesinsidetags

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.47 ms | 1397 KiB | 16 Q