3v4l.org

run code in 500+ PHP versions simultaneously
<?php $body = ' www.example.com, example.com, example.com/hello.html, example.com/logo.png, example.com/yourbaby.php , example.com/newimage.jpg, www.example.com/newimage.jpg'; //values $oldomain = ['example.com','www.']; $newdomain= ['sample.com', '']; $excludeextension = [".png", ".jpg", ".jpeg"]; //Replace $body = str_replace($olddomain, $newdomain, $body); $body = str_replace($excludeextension, '', $body); //output echo $body;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qpOeU
function name:  (null)
number of ops:  12
compiled vars:  !0 = $body, !1 = $oldomain, !2 = $newdomain, !3 = $excludeextension, !4 = $olddomain
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '+www.example.com%2C+example.com%2C+example.com%2Fhello.html%2C+example.com%2Flogo.png%2C+example.com%2Fyourbaby.php+%2C+example.com%2Fnewimage.jpg%2C+www.example.com%2Fnewimage.jpg'
    6     1        ASSIGN                                                       !1, <array>
    7     2        ASSIGN                                                       !2, <array>
    8     3        ASSIGN                                                       !3, <array>
   11     4        FRAMELESS_ICALL_3                str_replace         ~9      !4, !2
          5        OP_DATA                                                      !0
          6        ASSIGN                                                       !0, ~9
   12     7        FRAMELESS_ICALL_3                str_replace         ~11     !3, ''
          8        OP_DATA                                                      !0
          9        ASSIGN                                                       !0, ~11
   15    10        ECHO                                                         !0
   16    11      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
204.12 ms | 1774 KiB | 13 Q