3v4l.org

run code in 300+ PHP versions simultaneously
<?php $homepage = "https://example.com/"; $html = '<img class="drt" src="100.png"><img src="../101.png"><img src="/102.png"><img src="103.png">'; $check_img = preg_match_all("/<img .*?(?=src)src=\"([^\"]+)\"/si", $html, $m); foreach ($m[1] as $img){ if (strpos($img, $homepage) == false) { $old_img = $img; $html = str_replace($old_img, $homepage.basename($old_img), $html); } } echo $html;

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.10.0100.00716.92
8.5.00.0130.00920.36
8.4.160.0130.00823.76
8.4.150.0030.00014.05
8.4.140.0110.01117.59
8.4.130.0120.00819.05
8.4.120.0140.00624.02
8.4.110.0160.00618.92
8.4.100.0110.01018.91
8.4.90.0120.00820.48
8.4.80.0080.00617.97
8.4.70.0160.00418.26
8.4.60.0060.00318.85
8.4.50.0140.00718.07
8.4.40.0120.00417.91
8.4.30.0000.01820.69
8.4.20.0150.00024.44
8.4.10.0080.00019.71
8.3.280.0130.01018.40
8.3.270.0170.00816.61
8.3.260.0130.00516.64
8.3.250.0110.00918.93
8.3.240.0090.00917.07
8.3.230.0100.00616.60
8.3.220.0120.00719.06
8.3.210.0120.00716.59
8.3.200.0060.00217.29
8.3.190.0090.00919.13
8.3.180.0050.00416.74
8.3.170.0000.00716.76
8.3.160.0110.00716.82
8.3.150.0100.01017.29
8.3.140.0040.01119.09
8.3.130.0070.01118.32
8.3.120.0060.00318.86
8.3.110.0060.00320.94
8.3.100.0080.00816.66
8.3.90.0130.00626.77
8.3.80.0090.00019.36
8.3.70.0200.00018.55
8.3.60.0130.00916.88
8.3.50.0100.01023.68
8.3.40.0100.01020.43
8.3.30.0030.01218.59
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0090.01020.65
8.2.280.0070.00918.72
8.2.270.0120.00016.76
8.2.260.0080.00021.06
8.2.250.0040.00417.07
8.2.240.0000.00819.01
8.2.230.0080.00022.58
8.2.220.0000.00924.06
8.2.210.0120.00626.77
8.2.200.0060.00316.88
8.2.190.0070.01118.43
8.2.180.0030.01325.92
8.2.170.0140.00019.04
8.2.160.0100.00322.96
8.2.150.0050.00325.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00020.02
8.2.110.0070.00319.38
8.2.100.0040.00817.97
8.2.90.0080.00019.26
8.2.80.0080.00017.97
8.2.70.0000.00817.75
8.2.60.0070.00317.50
8.2.50.0030.00618.10
8.2.40.0030.00618.32
8.2.30.0040.00418.02
8.2.20.0040.00418.10
8.2.10.0030.00519.30
8.2.00.0000.00819.26
8.1.330.0080.01021.83
8.1.320.0060.00416.29
8.1.310.0140.00416.63
8.1.300.0100.00018.63
8.1.290.0060.00318.88
8.1.280.0110.00325.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00319.57
8.1.230.0100.00017.83
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0030.00617.47
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0030.00618.79
8.1.160.0040.00418.78
8.1.150.0000.00718.83
8.1.140.0060.00318.87
8.1.130.0040.00420.14
8.1.120.0040.00417.65
8.1.110.0050.00317.42
8.1.100.0040.00417.60
8.1.90.0040.00417.55
8.1.80.0040.00417.48
8.1.70.0000.00717.67
8.1.60.0050.00317.73
8.1.50.0080.00017.58
8.1.40.0000.00817.67
8.1.30.0060.00317.79
8.1.20.0040.00417.69
8.1.10.0060.00317.62
8.1.00.0040.00417.67
8.0.300.0040.00418.77
8.0.290.0030.00616.75
8.0.280.0070.00018.30
8.0.270.0000.00718.14
8.0.260.0000.00718.46
8.0.250.0000.00716.99
8.0.240.0030.00317.01
8.0.230.0070.00017.14
8.0.220.0040.00417.04
8.0.210.0040.00317.02
8.0.200.0030.00517.03
8.0.190.0040.00417.13
8.0.180.0000.00717.06
8.0.170.0030.00616.96
8.0.160.0000.00717.10
8.0.150.0030.00616.89
8.0.140.0030.00517.02
8.0.130.0040.00413.46
8.0.120.0070.00016.86
8.0.110.0080.00016.90
8.0.100.0040.00416.88
8.0.90.0000.00717.03
8.0.80.0100.00817.04
8.0.70.0030.00616.88
8.0.60.0040.00416.86
8.0.50.0000.00717.00
8.0.30.0060.01016.88
8.0.20.0100.01217.12
8.0.10.0040.00417.04
8.0.00.0060.01517.16
7.4.330.0000.00615.55
7.4.320.0030.00316.77
7.4.300.0000.00716.81
7.4.290.0030.00316.81
7.4.280.0000.00816.76
7.4.270.0070.00016.83
7.4.260.0030.00313.48
7.4.250.0030.00616.72
7.4.240.0060.00316.72
7.4.230.0040.00416.71
7.4.220.0070.00016.58
7.4.210.0070.01216.83
7.4.200.0030.00316.61
7.4.130.0100.00816.76
7.4.120.0030.01416.49
7.4.110.0070.01016.74
7.4.100.0150.00616.67
7.4.90.0130.00616.81
7.4.80.0170.00316.77
7.4.70.0100.01116.94
7.4.60.0110.00616.71
7.4.50.0140.00316.70
7.4.40.0100.01716.65
7.4.30.0150.00616.55
7.4.20.0200.00316.57
7.4.10.0160.00316.79
7.4.00.0140.00316.55
7.3.330.0000.00716.43
7.3.320.0000.00613.38
7.3.310.0000.00716.55
7.3.300.0030.00316.46
7.3.290.0050.00916.50
7.3.280.0150.00016.45
7.3.260.0040.01216.63
7.3.230.0140.00316.66
7.3.220.0060.01016.59
7.3.210.0170.00316.57
7.3.200.0100.00716.91
7.3.190.0040.01316.70
7.3.180.0100.00816.65
7.3.170.0090.00916.48
7.3.160.0130.00316.49
7.3.150.0100.01116.76
7.3.140.0100.01716.70
7.3.130.0130.00316.50
7.3.120.0070.01116.57
7.3.110.0120.00616.82
7.3.100.0040.01316.73
7.3.90.0090.00916.41
7.3.80.0030.02016.69
7.3.70.0110.00716.48
7.3.60.0150.00416.53
7.3.50.0210.00316.62
7.3.40.0070.01116.45
7.3.30.0140.00416.57
7.3.20.0060.01216.61
7.3.10.0070.01016.66
7.3.00.0130.01216.62
7.2.330.0180.00016.90
7.2.320.0140.00316.99
7.2.310.0050.01416.71
7.2.300.0150.01216.77
7.2.290.0030.01317.04
7.2.280.0100.01416.79
7.2.270.0170.00716.81
7.2.260.0140.00316.60
7.2.250.0100.01416.90
7.2.240.0100.00716.67
7.2.230.0090.00916.68
7.2.220.0090.00916.80
7.2.210.0110.00816.82
7.2.200.0140.01016.64
7.2.190.0140.00316.79
7.2.180.0090.00916.63
7.2.170.0040.01916.99
7.2.160.0060.01216.71
7.2.150.0150.00517.04
7.2.140.0100.01016.84
7.2.130.0060.01317.06
7.2.120.0110.01116.77
7.2.110.0170.00616.87
7.2.100.0130.01016.64
7.2.90.0120.01116.87
7.2.80.0590.00616.95
7.2.70.0180.00616.83
7.2.60.0060.01416.82
7.2.50.0090.00917.04
7.2.40.0230.01016.84
7.2.30.0100.01316.76
7.2.20.0090.01516.87
7.2.10.0120.01216.86
7.2.00.0160.00316.80

preferences:
37.06 ms | 403 KiB | 5 Q