3v4l.org

run code in 300+ PHP versions simultaneously
<?php $set = [ 'abc' => 'ABC', 'def' => 'DEF' ]; $text = 'abc aaa defr def'; foreach ($set as $key => $value) { $text = str_replace($key, $value, $text); } echo $text;

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.60.0030.01218.18
8.3.50.0060.01216.27
8.3.40.0070.00718.54
8.3.30.0120.00318.42
8.3.20.0080.00021.77
8.3.10.0040.00423.52
8.3.00.0040.00423.50
8.2.180.0040.01516.65
8.2.170.0110.00422.96
8.2.160.0070.00720.34
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0000.00720.66
8.2.110.0030.00720.94
8.2.100.0050.00517.78
8.2.90.0040.00419.34
8.2.80.0040.00419.95
8.2.70.0040.00417.93
8.2.60.0000.00817.63
8.2.50.0040.00418.20
8.2.40.0040.00420.43
8.2.30.0030.00319.30
8.2.20.0070.00018.05
8.2.10.0030.00617.71
8.2.00.0070.00017.97
8.1.280.0080.01225.92
8.1.270.0080.00023.67
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0080.00420.41
8.1.230.0040.00722.65
8.1.220.0080.00017.77
8.1.210.0040.00418.77
8.1.200.0040.00417.23
8.1.190.0080.00017.35
8.1.180.0000.00818.10
8.1.170.0080.00018.57
8.1.160.0050.00218.88
8.1.150.0060.00320.16
8.1.140.0040.00417.75
8.1.130.0070.00020.67
8.1.120.0000.00717.41
8.1.110.0040.00417.42
8.1.100.0000.00717.39
8.1.90.0060.00317.40
8.1.80.0000.00717.33
8.1.70.0000.00717.36
8.1.60.0030.00617.58
8.1.50.0040.00417.52
8.1.40.0070.00417.42
8.1.30.0000.00817.68
8.1.20.0000.00817.57
8.1.10.0030.00517.41
8.1.00.0090.00317.43
8.0.300.0000.00920.05
8.0.290.0040.00416.75
8.0.280.0000.00718.37
8.0.270.0070.00017.24
8.0.260.0070.00016.84
8.0.250.0040.00416.95
8.0.240.0000.00816.89
8.0.230.0000.00716.88
8.0.220.0000.00716.91
8.0.210.0030.00316.76
8.0.200.0040.00416.93
8.0.190.0070.00016.85
8.0.180.0040.00416.91
8.0.170.0030.00516.91
8.0.160.0000.00716.82
8.0.150.0030.00616.77
8.0.140.0000.00716.83
8.0.130.0030.00313.30
8.0.120.0000.00716.89
8.0.110.0000.00816.82
8.0.100.0030.00616.93
8.0.90.0000.00716.82
8.0.80.0060.00916.85
8.0.70.0030.00516.77
8.0.60.0070.00016.70
8.0.50.0030.00416.68
8.0.30.0070.01117.15
8.0.20.0180.00017.40
8.0.10.0040.00416.87
8.0.00.0080.01016.79
7.4.330.0020.00215.55
7.4.320.0030.00316.35
7.4.300.0030.00316.59
7.4.290.0060.00316.57
7.4.280.0000.00716.55
7.4.270.0030.00316.47
7.4.260.0030.00316.47
7.4.250.0000.00716.44
7.4.240.0040.00416.57
7.4.230.0050.00216.50
7.4.220.0070.00016.66
7.4.210.0070.00716.52
7.4.200.0040.00416.34
7.4.160.0090.00716.43
7.4.140.0110.00717.86
7.4.130.0140.00316.36
7.4.120.0090.01116.47
7.4.110.0070.01016.34
7.4.100.0070.01016.25
7.4.90.0070.01016.33
7.4.80.0190.00319.39
7.4.70.0140.00616.50
7.4.60.0040.01116.33
7.4.50.0100.00716.49
7.4.40.0090.00616.32
7.4.10.0060.01216.32
7.4.00.0040.01215.36
7.3.330.0030.00313.05
7.3.320.0030.00312.96
7.3.310.0080.00016.20
7.3.300.0070.00016.24
7.3.290.0080.01116.24
7.3.280.0040.01216.21
7.3.260.0140.00616.47
7.3.250.0120.00716.51
7.3.240.0090.00916.43
7.3.230.0150.00416.52
7.3.210.0080.00816.44
7.3.200.0100.00616.27
7.3.190.0090.00616.30
7.3.180.0140.00416.23
7.3.170.0060.00916.25
7.3.160.0120.00316.54
7.3.130.0070.00716.33
7.3.120.0100.00715.42
7.3.110.0060.01015.43
7.3.100.0090.00515.26
7.3.90.0060.01015.25
7.3.80.0080.00515.28
7.3.70.0050.01215.23
7.3.60.0040.00915.37
7.3.50.0060.00515.24
7.3.40.0050.00715.17
7.3.30.0070.00715.18
7.3.20.0090.00517.20
7.3.10.0050.00816.98
7.3.00.0030.00817.01
7.2.330.0000.01816.53
7.2.320.0120.00616.52
7.2.310.0100.00616.65
7.2.300.0120.00616.72
7.2.290.0120.00916.79
7.2.260.0030.01616.72
7.2.250.0120.00815.48
7.2.240.0100.00615.40
7.2.230.0090.00615.53
7.2.220.0060.00815.63
7.2.210.0050.00915.43
7.2.200.0050.00915.55
7.2.190.0070.00915.36
7.2.180.0100.00415.44
7.2.170.0040.00915.51
7.2.160.0070.00316.60
7.2.150.0080.01118.44
7.2.140.0120.00618.24
7.2.130.0030.01217.60
7.2.120.0030.01117.54
7.2.110.0030.01017.71
7.2.100.0110.00617.59
7.2.90.0030.01017.61
7.2.80.0070.00717.71
7.2.70.0060.01017.70
7.2.60.0040.01117.43
7.2.50.0020.01217.72
7.2.40.0060.00817.64
7.2.30.0660.01017.74
7.2.20.0080.01017.72
7.2.10.0070.01017.85
7.2.00.0110.01017.74
7.1.330.0060.00816.40
7.1.320.0100.00516.25
7.1.310.0040.00816.43
7.1.300.0080.00516.43
7.1.290.0040.01016.20
7.1.280.0030.01116.17
7.1.270.0080.00816.39
7.1.260.0050.01016.34
7.1.250.0070.00616.37
7.1.240.0030.01317.47
7.1.230.0060.01217.18
7.1.220.0090.00917.25
7.1.210.0110.00417.41
7.1.200.0130.00316.39
7.1.190.0070.00717.17
7.1.180.0030.01017.26
7.1.170.0060.00617.21
7.1.160.0070.00717.09
7.1.150.0160.00517.11
7.1.140.0100.00817.10
7.1.130.0120.00917.16
7.1.120.0120.00816.90
7.1.110.0090.00716.67
7.1.100.0160.01416.78
7.1.90.0080.01116.89
7.1.80.0080.01016.79
7.1.70.0090.01016.28
7.1.60.0210.01425.32
7.1.50.0220.00925.20
7.1.40.0170.01424.89
7.1.30.0160.01624.98
7.1.20.0160.01425.13
7.1.10.0080.00916.03
7.1.00.0080.01016.00
7.0.330.0130.00016.82
7.0.320.0030.00917.06
7.0.310.0040.00716.90
7.0.300.0040.01216.76
7.0.290.0090.00617.09
7.0.280.0030.01317.00
7.0.270.0000.01217.06
7.0.260.0090.00016.81
7.0.250.0000.00917.05
7.0.240.0040.00716.89
7.0.230.0100.00717.04
7.0.220.0070.00416.99
7.0.210.0120.00316.88
7.0.200.0000.01217.12
7.0.190.0090.00317.12
7.0.180.0070.00717.07
7.0.170.0040.00417.15
7.0.160.0000.01017.10
7.0.150.0000.01017.10
7.0.140.0030.01017.09
7.0.130.0140.00417.04
7.0.120.0100.00617.13
7.0.110.0040.00716.98
7.0.100.0040.00817.19
7.0.90.0060.00317.03
7.0.80.0060.00617.07
7.0.70.0060.00916.98
7.0.60.0030.01017.04
7.0.50.0000.00916.96
7.0.40.0060.00614.95
7.0.30.0090.00014.85
7.0.20.0050.00514.95
7.0.10.0110.00715.01
7.0.00.0040.01115.07
5.6.400.0090.00015.81
5.6.390.0000.01215.91
5.6.380.0070.00715.71
5.6.370.0040.01216.04
5.6.360.0000.01516.03
5.6.350.0060.00915.79
5.6.340.0060.00315.52
5.6.330.0040.01116.12
5.6.320.0110.00415.63
5.6.310.0120.00315.66
5.6.300.0030.01416.07
5.6.290.0040.00715.99
5.6.280.0040.01515.74
5.6.270.0000.01015.76
5.6.260.0030.01015.88
5.6.250.0040.00815.90
5.6.240.0090.00015.82
5.6.230.0040.01116.19
5.6.220.0000.01715.81
5.6.210.0000.01315.64
5.6.200.0060.00616.03
5.6.190.0000.01615.70
5.6.180.0040.00815.97
5.6.170.0070.00715.87
5.6.160.0120.00615.76
5.6.150.0030.01215.64
5.6.140.0060.00315.97
5.6.130.0040.00815.79
5.6.120.0150.00315.78
5.6.110.0030.01015.84
5.6.100.0070.00715.84
5.6.90.0080.00816.01
5.6.80.0030.01015.79
5.6.70.0030.00715.64
5.6.60.0030.00615.77
5.6.50.0050.00515.87
5.6.40.0030.00615.77
5.6.30.0090.00615.56
5.6.20.0060.00815.84
5.6.10.0000.00915.83
5.6.00.0070.00415.76

preferences:
58.38 ms | 404 KiB | 6 Q