3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'fix me <a href="www.link.com">link</a> or fix me <a href="link.com">link</a> and fix me too <a href="http://link.com">link</a> and replace me with <a href="http://www.link.com>link</a> <a href="http://www-is-for-world-wide-web.com">buggy!</a>'; echo str_replace('www.www.', 'www.', str_replace('http://www.http://', 'http://www.', str_replace('a href="', 'a href="http://www.', $str)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kNR67
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'fix+me+%3Ca+href%3D%22www.link.com%22%3Elink%3C%2Fa%3E+or+fix+me+%3Ca+href%3D%22link.com%22%3Elink%3C%2Fa%3E+and+fix+me+too+%3Ca+href%3D%22http%3A%2F%2Flink.com%22%3Elink%3C%2Fa%3E+and+replace+me+with+%3Ca+href%3D%22http%3A%2F%2Fwww.link.com%3Elink%3C%2Fa%3E+%3Ca+href%3D%22http%3A%2F%2Fwww-is-for-world-wide-web.com%22%3Ebuggy%21%3C%2Fa%3E'
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 'www.www.'
          3        SEND_VAL                                                 'www.'
          4        INIT_FCALL                                               'str_replace'
          5        SEND_VAL                                                 'http%3A%2F%2Fwww.http%3A%2F%2F'
          6        SEND_VAL                                                 'http%3A%2F%2Fwww.'
          7        INIT_FCALL                                               'str_replace'
          8        SEND_VAL                                                 'a+href%3D%22'
          9        SEND_VAL                                                 'a+href%3D%22http%3A%2F%2Fwww.'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $2      
         12        SEND_VAR                                                 $2
         13        DO_ICALL                                         $3      
         14        SEND_VAR                                                 $3
         15        DO_ICALL                                         $4      
         16        ECHO                                                     $4
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.69 ms | 1386 KiB | 15 Q