3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "foobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisout"; $b = str_repeat("a", 300); echo "Static Var\n"; testCopy($a); echo "Dynamic Var\n"; testCopy($b); $c = $a . "test"; echo memory_get_usage() . "\n"; function testCopy($var) { echo memory_get_usage() . "\n"; $var = (string) $var; echo memory_get_usage() . "\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)
7.4.10.0110.00614.99
7.4.00.0120.00614.85
7.3.130.0040.01115.00
7.3.120.0040.01214.88
7.3.110.0080.01114.82
7.3.100.0040.01114.84
7.3.90.0030.01014.73
7.3.80.0070.00715.13
7.3.70.0060.00914.59
7.3.60.0030.01314.96
7.3.50.0100.00615.05
7.3.40.0090.00614.68
7.3.30.0030.01014.82
7.3.20.0030.00616.62
7.3.10.0090.00616.59
7.3.00.0120.00316.70
7.2.260.0100.01015.07
7.2.250.0110.00415.02
7.2.240.0090.00615.21
7.2.230.0060.00615.21
7.2.220.0050.00514.99
7.2.210.0050.00514.78
7.2.200.0070.00714.98
7.2.190.0090.00615.14
7.2.180.0120.00614.97
7.2.170.0090.00614.91
7.2.160.0030.01615.22
7.2.150.0040.01116.93
7.2.140.0120.00617.07
7.2.130.0100.00616.98
7.2.120.0050.00516.85
7.2.110.0090.00617.05
7.2.100.0030.01316.66
7.2.90.0030.00916.95
7.2.80.0060.00817.14
7.2.70.0090.00617.14
7.2.60.0030.01317.01
7.2.50.0130.00716.87
7.2.40.0070.00717.01
7.2.30.0060.00317.02
7.2.20.0060.00916.96
7.2.10.0000.01516.64
7.2.00.0050.00918.14
7.1.330.0120.00415.74
7.1.320.0090.00015.73
7.1.310.0090.00615.69
7.1.300.0120.00615.82
7.1.290.0030.01315.73
7.1.280.0030.01415.82
7.1.270.0070.01115.49
7.1.260.0140.00315.80
7.1.250.0110.00415.97
7.1.240.0110.00415.83
7.1.230.0110.00415.38
7.1.220.0100.00315.71
7.1.210.0060.00915.91
7.1.200.0080.00415.74
7.1.190.0070.00715.85
7.1.180.0070.00715.52
7.1.170.0060.01315.76
7.1.160.0040.00415.85
7.1.150.0070.00315.40
7.1.140.0060.00915.79
7.1.130.0130.00315.91
7.1.120.0090.00615.62
7.1.110.0030.01015.97
7.1.100.0070.00715.82
7.1.90.0050.00515.67
7.1.80.0040.00815.68
7.1.70.0020.00716.52
7.1.60.0070.01217.67
7.1.50.0050.01316.44
7.1.40.0100.00715.62
7.1.30.0120.00415.82
7.1.20.0030.01015.77
7.1.10.0060.00615.85
7.1.00.0020.02919.11
7.0.330.0120.00315.46
7.0.320.0060.00615.34
7.0.310.0070.00415.39
7.0.300.0000.01515.48
7.0.290.0030.01015.13
7.0.280.0040.01115.39
7.0.270.0030.01015.40
7.0.260.0030.00615.28
7.0.250.0080.00415.05
7.0.240.0030.01015.66
7.0.230.0030.00715.53
7.0.220.0030.00715.36
7.0.210.0080.00315.41
7.0.200.0300.00515.18
7.0.190.0060.00915.22
7.0.180.0000.01315.35
7.0.170.0070.00715.11
7.0.160.0080.00415.29
7.0.150.0000.01315.43
7.0.140.0000.04318.74
7.0.130.0090.00915.57
7.0.120.0030.04218.76
7.0.110.0100.00315.50
7.0.100.0060.01015.58
7.0.90.0040.01115.09
7.0.80.0040.00815.44
7.0.70.0000.01615.48
7.0.60.0070.03617.57
7.0.50.0020.04816.59
7.0.40.0050.02315.65
7.0.30.0060.02615.55
7.0.20.0060.04115.58
7.0.10.0030.04815.53
7.0.00.0030.02715.60
5.6.400.0100.00014.28
5.6.390.0080.00814.38
5.6.380.0030.01013.99
5.6.370.0060.00614.46
5.6.360.0090.00314.25
5.6.350.0080.00414.11
5.6.340.0090.00614.60
5.6.330.0030.00614.57
5.6.320.0030.01314.60
5.6.310.0080.00414.39
5.6.300.0070.00714.41
5.6.290.0000.01714.39
5.6.280.0040.04017.53
5.6.270.0060.00614.61
5.6.260.0060.00914.43
5.6.250.0060.00914.09
5.6.240.0140.00014.36
5.6.230.0080.00614.39
5.6.220.0090.00614.21
5.6.210.0110.04217.31
5.6.200.0000.03116.18
5.6.190.0080.03016.10
5.6.180.0060.03016.23
5.6.170.0020.02716.41
5.6.160.0020.04016.36
5.6.150.0060.02316.27
5.6.140.0070.02716.19
5.6.130.0100.02716.21
5.6.120.0040.03516.21
5.6.110.0050.02216.20
5.6.100.0030.04416.21
5.6.90.0020.04916.34
5.6.80.0050.04315.82
5.6.70.0110.03815.93
5.6.60.0080.03915.86
5.6.50.0070.03015.87
5.6.40.0060.04215.82
5.6.30.0050.04415.81
5.6.20.0090.04215.77
5.6.10.0100.03415.94
5.6.00.0060.03315.89
5.5.380.0100.00714.21
5.5.370.0070.00414.27
5.5.360.0040.00814.50
5.5.350.0190.04017.40
5.5.340.0080.04216.18
5.5.330.0080.04516.08
5.5.320.0020.03016.10
5.5.310.0050.04616.00
5.5.300.0110.04016.15
5.5.290.0000.05115.97
5.5.280.0080.03516.14
5.5.270.0050.04116.07
5.5.260.0050.04816.21
5.5.250.0050.02915.86
5.5.240.0030.04515.83
5.5.230.0050.03015.69
5.5.220.0100.03815.75
5.5.210.0080.04215.74
5.5.200.0060.04215.72
5.5.190.0050.03015.73
5.5.180.0100.02015.71
5.5.170.0040.01114.29
5.5.160.0070.04115.95
5.5.150.0030.03015.69
5.5.140.0050.04415.85
5.5.130.0070.04315.85
5.5.120.0120.03915.74
5.5.110.0050.04615.79
5.5.100.0070.02215.73
5.5.90.0070.04315.73
5.5.80.0080.04315.68
5.5.70.0030.03115.75
5.5.60.0050.03015.73
5.5.50.0070.03715.62
5.5.40.0080.03915.75
5.5.30.0070.03415.75
5.5.20.0080.03115.50
5.5.10.0100.02515.73
5.5.00.0050.04215.80
5.4.450.0110.03115.72
5.4.440.0090.02215.74
5.4.430.0070.03615.66
5.4.420.0070.04215.68
5.4.410.0070.04215.61
5.4.400.0020.03515.49
5.4.390.0020.04015.44
5.4.380.0030.03015.55
5.4.370.0070.04115.54
5.4.360.0080.02015.56
5.4.350.0100.04015.50
5.4.340.0050.04515.50
5.4.330.0060.00612.00
5.4.320.0070.03515.55
5.4.310.0050.03715.52
5.4.300.0090.04015.55
5.4.290.0030.04315.52
5.4.280.0050.02715.55
5.4.270.0010.02615.56
5.4.260.0080.02915.56
5.4.250.0070.02215.56
5.4.240.0030.02915.54
5.4.230.0020.03815.56
5.4.220.0030.03115.44
5.4.210.0080.02015.56
5.4.200.0100.02515.63
5.4.190.0050.04515.56
5.4.180.0060.02215.54
5.4.170.0080.01915.55
5.4.160.0030.04515.46
5.4.150.0000.04115.50
5.4.140.0080.01814.29
5.4.130.0030.02214.19
5.4.120.0020.03714.14
5.4.110.0080.03614.15
5.4.100.0030.02214.18
5.4.90.0030.04114.22
5.4.80.0050.04014.26
5.4.70.0030.02214.31
5.4.60.0000.02414.17
5.4.50.0030.03714.10
5.4.40.0050.03014.19
5.4.30.0030.03514.21
5.4.20.0030.03314.19
5.4.10.0080.02214.27
5.4.00.0070.03113.94
5.3.290.0060.04113.33
5.3.280.0110.03813.32
5.3.270.0030.02613.32
5.3.260.0050.04213.31
5.3.250.0050.04213.33
5.3.240.0030.04213.28
5.3.230.0050.03813.35
5.3.220.0040.02613.26
5.3.210.0070.04013.30
5.3.200.0010.04113.28
5.3.190.0070.02013.26
5.3.180.0050.03113.32
5.3.170.0030.02713.31
5.3.160.0020.04413.29
5.3.150.0040.02313.32
5.3.140.0050.04313.30
5.3.130.0050.03713.29
5.3.120.0070.04213.30
5.3.110.0050.03913.28
5.3.100.0050.03912.99
5.3.90.0010.02613.03
5.3.80.0010.04513.00
5.3.70.0050.03013.02
5.3.60.0100.03613.02
5.3.50.0060.02212.92
5.3.40.0050.03812.92
5.3.30.0080.03713.00
5.3.20.0080.02212.89
5.3.10.0070.03012.93
5.3.00.0020.02912.87
5.2.170.0070.06011.16
5.2.160.0030.04011.36
5.2.150.0170.03011.15
5.2.140.0070.06310.99
5.2.130.0070.06311.14
5.2.120.0070.06011.14
5.2.110.0000.05011.14
5.2.100.0070.04311.00
5.2.90.0000.03311.15
5.2.80.0130.05711.11
5.2.70.0030.05711.00
5.2.60.0100.03310.90
5.2.50.0030.03011.09
5.2.40.0000.03311.10
5.2.30.0070.05310.93
5.2.20.0000.06310.80
5.2.10.0070.06010.93
5.2.00.0000.05310.68
5.1.60.0070.0509.96
5.1.50.0070.0309.97
5.1.40.0070.0239.97
5.1.30.0000.06310.39
5.1.20.0070.05310.36
5.1.10.0170.03310.30
5.1.00.0000.04710.13
5.0.50.0000.0508.54
5.0.40.0030.0338.48
5.0.30.0000.0678.14
5.0.20.0030.0378.18
5.0.10.0030.0338.20
5.0.00.0030.0478.13
4.4.90.0000.0337.55
4.4.80.0070.0277.55
4.4.70.0000.0407.55
4.4.60.0000.0407.55
4.4.50.0030.0377.55
4.4.40.0000.0607.55
4.4.30.0000.0237.55
4.4.20.0030.0307.55
4.4.10.0000.0337.55
4.4.00.0030.0577.55
4.3.110.0030.0377.55
4.3.100.0000.0277.55
4.3.90.0070.0277.55
4.3.80.0070.0437.55
4.3.70.0100.0207.55
4.3.60.0000.0307.55
4.3.50.0070.0337.55
4.3.40.0030.0577.55
4.3.30.0000.0377.55
4.3.20.0030.0337.55
4.3.10.0000.0237.55
4.3.00.0000.0177.55

preferences:
41.45 ms | 401 KiB | 5 Q