3v4l.org

run code in 300+ PHP versions simultaneously
<?php $links = array( "product.php?shopprodid=1057&variantid=2942" => "https://storksak.com/changing-bags", "index.php?pageid=2" => "https://storksak.com/changing-bags/olivia", "changing-bags/shoulder-bag/emma.html" => "https://storksak.com/changing-bags/emma" ); foreach ($links as $url => $tourl){ $parsed_url = parse_url($url); $query = isset($parsed_url['query']) ? $parsed_url['query'] : ''; parse_str($query,$parts); if (isarray($parts)){ if (isset($parts["shopprodid"]) && isset($parts["variantid"])){ echo 'RewriteCond %{QUERY_STRING} ^shopprodid='.$parts["shopprodid"].'&variantid='.$parts["variantid"].'$'."\n"; echo 'RewriteRule ^product.php$ '.$tourl.' [R=301,L]'."\n"; } elseif (isset($parts["pageid"])){ echo 'RewriteCond %{QUERY_STRING} ^pageid='.$parts["pageid"].'$'."\n"; echo 'RewriteRule ^index.php$ '.$tourl.' [R=301,L]'."\n"; } elseif (isset($parts["shopcatid"])){ echo 'RewriteCond %{QUERY_STRING} ^shopcatid='.$parts["shopcatid"].'$'."\n"; echo 'RewriteRule ^shop.php$ '.$tourl.' [R=301,L]'."\n"; } } else { echo 'RewriteRule ^'.$url.'$ '.$tourl.' [R=301,L]'."\n"; } }

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.3.70.0140.00718.27
8.3.60.0070.01118.55
8.3.50.0070.01016.56
8.3.40.0110.00318.75
8.3.30.0070.00718.64
8.3.20.0000.00819.01
8.3.10.0030.00621.87
8.3.00.0030.00519.60
8.2.180.0120.00316.75
8.2.170.0110.00722.96
8.2.160.0070.00720.31
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00420.47
8.2.120.0040.00426.35
8.2.110.0060.00321.00
8.2.100.0070.00418.03
8.2.90.0050.00319.30
8.2.80.0050.00318.04
8.2.70.0040.00417.50
8.2.60.0040.00417.93
8.2.50.0050.00318.10
8.2.40.0040.00420.50
8.2.30.0050.00321.02
8.2.20.0050.00318.22
8.2.10.0040.00418.23
8.2.00.0070.00018.16
8.1.280.0090.00625.92
8.1.270.0040.00423.82
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00319.09
8.1.230.0080.00417.77
8.1.220.0050.00317.79
8.1.210.0030.00618.77
8.1.200.0040.00417.25
8.1.190.0000.00817.38
8.1.180.0000.00818.10
8.1.170.0050.00318.53
8.1.160.0000.00719.01
8.1.150.0000.00818.85
8.1.140.0000.01119.71
8.1.130.0040.00418.96
8.1.120.0040.00417.42
8.1.110.0030.00617.50
8.1.100.0000.00817.56
8.1.90.0040.00417.50
8.1.80.0080.00317.41
8.1.70.0040.00417.40
8.1.60.0040.00417.63
8.1.50.0040.00417.45
8.1.40.0080.00417.42
8.1.30.0000.00817.71
8.1.20.0080.00017.71
8.1.10.0030.00617.52
8.1.00.0040.00417.54
8.0.300.0030.00618.77
8.0.290.0070.00016.88
8.0.280.0000.00718.48
8.0.270.0040.00417.24
8.0.260.0090.00016.97
8.0.250.0040.00416.99
8.0.240.0060.00316.92
8.0.230.0000.00717.04
8.0.220.0060.00316.98
8.0.210.0030.00517.05
8.0.200.0000.00717.03
8.0.190.0030.00616.94
8.0.180.0080.00016.97
8.0.170.0040.00417.00
8.0.160.0050.00316.96
8.0.150.0040.00416.92
8.0.140.0040.00416.96
8.0.130.0040.00413.41
8.0.120.0040.00416.95
8.0.110.0000.00716.93
8.0.100.0000.00716.85
8.0.90.0040.00416.89
8.0.80.0000.01717.04
8.0.70.0040.00416.88
8.0.60.0000.00716.93
8.0.50.0040.00417.02
8.0.30.0130.00617.15
8.0.20.0120.00917.41
8.0.10.0070.00017.03
8.0.00.0100.01016.97
7.4.330.0000.00515.55
7.4.320.0070.00016.57
7.4.300.0000.00616.49
7.4.290.0030.00316.45
7.4.280.0030.00616.63
7.4.270.0040.00416.58
7.4.260.0030.00516.57
7.4.250.0060.00316.48
7.4.240.0040.00416.55
7.4.230.0000.00716.72
7.4.220.0040.01516.70
7.4.210.0100.00816.61
7.4.200.0030.00316.64
7.4.160.0090.00716.54
7.4.150.0140.00317.40
7.4.140.0090.01017.86
7.4.130.0140.00616.60
7.4.120.0060.01116.48
7.4.110.0100.00716.64
7.4.100.0110.00816.53
7.4.90.0070.01116.64
7.4.80.0100.01019.39
7.4.70.0120.01216.77
7.4.60.0060.01216.56
7.4.50.0100.00016.67
7.4.40.0070.01016.65
7.4.30.0060.01016.64
7.4.00.0030.01215.28
7.3.330.0030.00313.22
7.3.320.0000.00613.21
7.3.310.0080.00016.50
7.3.300.0030.00316.24
7.3.290.0030.00316.37
7.3.280.0100.00616.35
7.3.270.0070.01017.40
7.3.260.0090.00816.50
7.3.250.0150.00616.43
7.3.240.0110.01216.36
7.3.230.0150.01116.52
7.3.210.0110.00716.41
7.3.200.0130.00716.70
7.3.190.0150.00316.54
7.3.180.0100.00616.39
7.3.170.0080.00816.56
7.3.160.0060.00916.41
7.3.10.0080.00416.57
7.3.00.0000.01116.62
7.2.330.0090.00916.79
7.2.320.0030.01416.39
7.2.310.0100.00716.64
7.2.300.0120.00316.58
7.2.290.0070.01016.66
7.2.130.0040.00817.06
7.2.120.0000.01017.00
7.2.110.0000.01116.88
7.2.100.0070.01016.75
7.2.90.0110.00417.17
7.2.80.0030.00616.93
7.2.70.0050.00817.05
7.2.60.0070.00516.99
7.2.50.0090.00616.64
7.2.40.0030.01416.73
7.2.30.0140.00016.74
7.2.20.0030.01216.42
7.2.10.0000.01516.82
7.2.00.0050.00818.08
7.1.250.0090.00015.81
7.1.200.0030.01015.74
7.1.100.0040.00718.22
7.1.70.0000.01117.29
7.1.60.0630.01033.19
7.1.50.0600.01032.80
7.1.40.1670.02332.40
7.1.30.0530.01332.58
7.1.20.0530.01732.79
7.1.10.0470.01014.66
7.1.00.0430.00714.56
7.0.200.0400.01315.00
7.0.190.0400.00714.99
7.0.180.0400.01014.46
7.0.170.0500.00314.58
7.0.160.0470.00714.50
7.0.150.0400.01714.48
7.0.140.0770.01014.42
7.0.130.0470.01014.68
7.0.120.0400.00714.67
7.0.110.0400.01314.61
7.0.100.0400.01314.56
7.0.90.0400.01314.42
7.0.80.0430.00714.61
7.0.70.0430.00714.70
7.0.60.0470.01014.27
7.0.50.0430.00714.45
7.0.40.0470.00714.92
7.0.30.0500.00714.57
7.0.20.0470.01014.68
7.0.10.0430.01014.80
7.0.00.0470.00714.55

preferences:
36.66 ms | 401 KiB | 5 Q