3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "We have received ##AMOUNT## ##CURRENCY## for your OrderID n. ##ORDER_ID##"; $AMOUNT = 123; $CURRENCY = 'GBP'; $ORDER_ID = 20123; $find = ['AMOUNT', 'CURRENCY', 'ORDER_ID']; echo str_replace( array_map(function($v){ return '##'.$v.'##'; }, $find), compact(...$find), $str );

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.1.70.0000.00717.43
8.1.60.0050.00317.52
8.1.50.0050.00317.52
8.1.40.0040.00417.42
8.1.30.0040.00417.65
8.1.20.0040.00417.64
8.1.10.0040.00417.42
8.1.00.0040.00417.45
8.0.200.0070.00016.95
8.0.190.0000.00816.93
8.0.180.0000.00816.91
8.0.170.0040.00416.91
8.0.160.0040.00416.84
8.0.150.0000.00716.93
8.0.140.0040.00416.86
8.0.130.0030.00313.29
8.0.120.0000.00716.98
8.0.110.0040.00416.95
8.0.100.0040.00416.79
8.0.90.0030.00516.79
8.0.80.0030.01216.84
8.0.70.0040.00416.80
8.0.60.0040.00416.97
8.0.50.0040.00416.85
8.0.30.0090.00916.91
8.0.20.0140.00517.22
8.0.10.0080.00816.84
8.0.00.0120.00616.89
7.4.300.0000.00616.43
7.4.290.0000.00816.58
7.4.280.0030.00616.55
7.4.270.0000.00716.55
7.4.260.0040.00416.56
7.4.250.0080.00016.48
7.4.240.0000.00716.62
7.4.230.0040.00416.59
7.4.220.0040.00416.63
7.4.210.0070.00816.60
7.4.200.0070.00016.41
7.4.160.0070.00916.47
7.4.150.0120.00816.66
7.4.140.0080.01117.30
7.4.130.0090.00816.45
7.4.120.0100.00916.46
7.4.110.0110.00616.47
7.4.100.0120.00816.53
7.4.90.0120.00616.49
7.4.80.0050.01217.38
7.4.70.0110.00816.42
7.4.60.0110.00516.41
7.4.50.0100.00816.39
7.4.40.0080.00916.40
7.4.30.0080.01316.53
7.4.20.0090.01216.36
7.4.10.0110.00616.40
7.4.00.0070.01016.00
7.3.330.0050.00013.29
7.3.320.0030.00313.32
7.3.310.0070.00016.24
7.3.300.0030.00616.32
7.3.290.0140.00016.31
7.3.280.0100.00816.29
7.3.270.0020.01516.59
7.3.260.0110.00916.34
7.3.250.0100.00816.45
7.3.240.0090.00816.38
7.3.230.0030.01316.41
7.3.220.0080.01216.39
7.3.210.0090.00916.28
7.3.200.0100.00716.30
7.3.190.0140.00216.33
7.3.180.0080.00716.41
7.3.170.0070.00916.36
7.3.160.0100.00916.34
7.3.150.0080.00816.32
7.3.140.0120.00516.26
7.3.130.0050.01116.34
7.3.120.0080.01016.23
7.3.110.0090.00616.21
7.3.100.0080.00816.35
7.3.90.0090.00616.36
7.3.80.0100.00816.38
7.3.70.0080.00716.37
7.3.60.0030.01316.42
7.3.50.0040.01416.40
7.3.40.0120.00616.39
7.3.30.0140.00516.36
7.3.20.0270.00716.39
7.3.10.0080.00916.39
7.3.00.0080.00816.33
7.2.340.0250.00816.29
7.2.330.0220.00316.39
7.2.320.0420.01016.51
7.2.310.0150.01016.47
7.2.300.0170.00816.56
7.2.290.0150.00916.38
7.2.280.0230.00816.44
7.2.270.0180.01016.44
7.2.260.0140.01216.39
7.2.250.0160.01116.44
7.2.240.0270.00916.42
7.2.230.0190.00816.48
7.2.220.0200.00716.41
7.2.210.0180.01016.44
7.2.200.0230.00516.47
7.2.190.0200.00716.48
7.2.180.0160.01316.40
7.2.170.0180.01116.50
7.2.160.0230.00316.57
7.2.150.0240.01016.51
7.2.140.0210.00716.60
7.2.130.0130.01316.67
7.2.120.0170.00816.54
7.2.110.0200.00816.58
7.2.100.0170.00816.60
7.2.90.0140.01116.47
7.2.80.0120.01216.59
7.2.70.0640.01016.58
7.2.60.0130.01016.67
7.2.50.0200.00516.75
7.2.40.0160.00916.63
7.2.30.0170.00816.54
7.2.20.0210.00516.59
7.2.10.0250.01216.86
7.2.00.0150.01316.89
7.1.330.0190.01015.53
7.1.320.0150.01115.56
7.1.310.0150.01015.61
7.1.300.0360.01015.52
7.1.290.0180.00715.52
7.1.280.0200.00715.49
7.1.270.0120.01315.55
7.1.260.0210.00715.46
7.1.250.0140.01015.48
7.1.240.0200.00315.60
7.1.230.0140.00915.53
7.1.220.0250.00615.51
7.1.210.0170.01015.52
7.1.200.0200.00915.60
7.1.190.0150.01115.43
7.1.180.0100.01215.42
7.1.170.0150.00815.61
7.1.160.0170.00515.45
7.1.150.0150.00715.57
7.1.140.0120.00815.50
7.1.130.0170.00515.50
7.1.120.0190.01015.74
7.1.110.0230.01015.69
7.1.100.0200.01015.67
7.1.90.0160.00915.56
7.1.80.0160.01215.64
7.1.70.0150.01115.39
7.1.60.0210.00820.02
7.1.50.0220.00919.79
7.1.40.0200.01019.89
7.1.30.0190.01119.87
7.1.20.0210.00719.83
7.1.10.0170.00815.38
7.1.00.0180.00915.23
7.0.330.0080.01215.23
7.0.320.0170.00715.10
7.0.310.0220.00715.19
7.0.300.0190.00815.18
7.0.290.0190.00915.11
7.0.280.0220.00915.13
7.0.270.0240.00415.18
7.0.260.0240.01015.13
7.0.250.0190.00715.30
7.0.240.0140.01215.29
7.0.230.0210.00715.44
7.0.220.0190.00815.34
7.0.210.0230.00515.22
7.0.200.0200.00715.24
7.0.190.0240.00515.34
7.0.180.0250.00515.17
7.0.170.0180.00715.25
7.0.160.0190.01015.28
7.0.150.0190.00915.21
7.0.140.0250.00415.22
7.0.130.0130.01215.29
7.0.120.0240.00715.26
7.0.110.0230.00615.10
7.0.100.0190.01015.32
7.0.90.0150.01115.14
7.0.80.0260.00915.14
7.0.70.0160.00915.22
7.0.60.0200.00615.14
7.0.50.0250.00315.15
7.0.40.0190.00815.04
7.0.30.0180.00715.24
7.0.20.0130.01515.13
7.0.10.0170.01115.21
7.0.00.0200.00815.17
5.6.400.0180.00815.82
5.6.390.0190.00615.94
5.6.380.0240.00315.23
5.6.370.0240.00615.80
5.6.360.0150.01515.86
5.6.350.0190.01115.98
5.6.340.0270.00115.86
5.6.330.0110.01415.89
5.6.320.0200.01015.92
5.6.310.0160.01215.75
5.6.300.0180.01315.76
5.6.290.0180.01215.79
5.6.280.0140.01215.89
5.6.270.0190.01215.81
5.6.260.0190.01115.84
5.6.250.0180.01015.87
5.6.240.0170.01515.85
5.6.230.0190.01115.99
5.6.220.0210.00915.99
5.6.210.0200.01015.83
5.6.200.0140.01315.94
5.6.190.0200.01015.96
5.6.180.0190.00915.95
5.6.170.0180.01315.90
5.6.160.0190.01115.94
5.6.150.0230.00715.83
5.6.140.0190.01015.96
5.6.130.0180.01015.83
5.6.120.0230.00315.92
5.6.110.0220.00815.88
5.6.100.0180.01115.86
5.6.90.0190.01215.81
5.6.80.0190.01115.85
5.6.70.0180.00715.83
5.6.60.0160.01115.93
5.6.50.0240.00715.86
5.6.40.0140.01315.73
5.6.30.0160.01015.91
5.6.20.0210.00515.76
5.6.10.0220.00615.78
5.6.00.0220.00915.73

preferences:
61.98 ms | 413 KiB | 14 Q