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"; $c = clone $c; 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.00.0110.00715.04
7.3.120.0030.01314.53
7.3.110.0070.00714.67
7.3.100.0060.01014.69
7.3.90.0110.00714.66
7.3.80.0080.00414.95
7.3.70.0100.01014.89
7.3.60.0040.01114.71
7.3.50.0000.01414.88
7.3.40.0100.00614.84
7.3.30.0060.00314.79
7.3.20.0040.00816.55
7.3.10.0070.01016.71
7.3.00.0090.00616.64
7.2.250.0120.00615.05
7.2.240.0070.01314.77
7.2.230.0060.00915.19
7.2.220.0090.00615.18
7.2.210.0060.01014.83
7.2.200.0070.01115.19
7.2.190.0030.01014.91
7.2.180.0080.00815.05
7.2.170.0070.00314.78
7.2.00.0040.00419.46
7.1.330.0060.00915.75
7.1.320.0110.00315.79
7.1.310.0120.00615.64
7.1.300.0040.00415.72
7.1.290.0100.00315.79
7.1.280.0000.01015.50
7.1.270.0130.00015.52
7.1.260.0000.01015.52
7.1.70.0030.01017.15
7.1.60.0100.01619.17
7.1.50.0130.01734.87
7.1.00.0000.04022.30
7.0.200.0040.00416.96
7.0.140.0070.07022.18
7.0.100.0070.08020.07
7.0.90.0100.03719.93
7.0.80.0170.04319.86
7.0.70.0070.08019.93
7.0.60.0030.08319.88
7.0.50.0100.07320.29
7.0.40.0070.04720.14
7.0.30.0170.07320.17
7.0.20.0100.07720.09
7.0.10.0100.07320.04
7.0.00.0070.08320.09
5.6.280.0100.06321.08
5.6.250.0070.07020.67
5.6.240.0130.07720.55
5.6.230.0000.05720.61
5.6.220.0030.07720.59
5.6.210.0070.08020.67
5.6.200.0170.06321.02
5.6.190.0070.08321.07
5.6.180.0100.08021.04
5.6.170.0070.08720.99
5.6.160.0070.05021.11
5.6.150.0030.08321.11
5.6.140.0130.07320.93
5.6.130.0030.09020.98
5.6.120.0130.07321.11
5.6.110.0030.08021.10
5.6.100.0130.07021.02
5.6.90.0170.06721.01
5.6.80.0070.08320.50
5.6.70.0130.07020.45
5.6.60.0100.07320.42
5.6.50.0000.08020.32
5.6.40.0170.06720.41
5.6.30.0070.07720.37
5.6.20.0130.04020.36
5.6.10.0030.07720.41
5.6.00.0200.06320.52
5.5.380.0070.08020.41
5.5.370.0100.08320.41
5.5.360.0100.07320.40
5.5.350.0000.08720.43
5.5.340.0100.08720.77
5.5.330.0170.07020.87
5.5.320.0100.08020.92
5.5.310.0130.07320.74
5.5.300.0130.08020.77
5.5.290.0100.08320.82
5.5.280.0030.08320.88
5.5.270.0130.07720.94
5.5.260.0130.07320.83
5.5.250.0170.06320.75
5.5.240.0070.07320.24
5.5.230.0070.05020.24
5.5.220.0100.07320.19
5.5.210.0100.08320.28
5.5.200.0030.07720.29
5.5.190.0170.07320.24
5.5.180.0100.07720.21
5.5.160.0070.05720.25
5.5.150.0070.08020.13
5.5.140.0000.08020.26
5.5.130.0030.04720.13
5.5.120.0100.05020.11
5.5.110.0100.07720.15
5.5.100.0070.08020.05
5.5.90.0000.04320.06
5.5.80.0070.06319.98
5.5.70.0000.06020.07
5.5.60.0100.04320.06
5.5.50.0030.07320.10
5.5.40.0070.04720.06
5.5.30.0070.07320.09
5.5.20.0070.07720.06
5.5.10.0070.07020.02
5.5.00.0170.06720.07
5.4.450.0070.07019.22
5.4.440.0070.05019.36
5.4.430.0070.07719.50
5.4.420.0030.07719.45
5.4.410.0100.07719.32
5.4.400.0070.06719.04
5.4.390.0130.07019.22
5.4.380.0030.07318.90
5.4.370.0130.05319.06
5.4.360.0000.04719.08
5.4.350.0000.07718.89
5.4.340.0030.04719.18
5.4.320.0130.06718.95
5.4.310.0100.07019.06
5.4.300.0000.08319.21
5.4.290.0130.06018.85
5.4.280.0100.05019.24
5.4.270.0030.07719.18
5.4.260.0100.07019.09
5.4.250.0030.08319.02
5.4.240.0000.08319.12
5.4.230.0100.06719.09
5.4.220.0130.05718.94
5.4.210.0130.06319.18
5.4.200.0100.06018.81
5.4.190.0100.07318.84
5.4.180.0030.07719.08
5.4.170.0070.08019.18
5.4.160.0070.03718.83
5.4.150.0030.06319.02
5.4.140.0000.05316.19
5.4.130.0200.05716.43
5.4.120.0100.07316.41
5.4.110.0070.04316.35
5.4.100.0070.07016.47
5.4.90.0030.07316.28
5.4.80.0070.05316.42
5.4.70.0030.07316.41
5.4.60.0100.06716.41
5.4.50.0000.07316.37
5.4.40.0030.06716.46
5.4.30.0100.06316.43
5.4.20.0070.07316.39
5.4.10.0070.03716.31
5.4.00.0070.08015.87
5.3.290.0100.04714.62
5.3.280.0130.07314.74
5.3.270.0100.07714.66
5.3.260.0100.07014.70
5.3.250.0030.06014.61
5.3.240.0030.05714.58
5.3.230.0100.07714.56
5.3.220.0030.04314.49
5.3.210.0070.07314.52
5.3.200.0070.07314.51
5.3.190.0030.07314.60
5.3.180.0130.06714.49
5.3.170.0030.08014.69
5.3.160.0130.06314.59
5.3.150.0130.07014.54
5.3.140.0070.08014.70
5.3.130.0100.07714.69
5.3.120.0070.07714.66
5.3.110.0070.06714.60
5.3.100.0130.06314.10
5.3.90.0170.06014.08
5.3.80.0000.08314.15
5.3.70.0100.07313.93
5.3.60.0030.07314.13
5.3.50.0130.07013.94
5.3.40.0100.07014.02
5.3.30.0030.07713.84
5.3.20.0070.07013.59
5.3.10.0030.07313.68
5.3.00.0070.07313.53
5.2.170.0000.07011.06
5.2.160.0030.05711.01
5.2.150.0000.06711.28
5.2.140.0100.05711.28
5.2.130.0070.05311.23
5.2.120.0030.04311.24
5.2.110.0030.03711.16
5.2.100.0100.03011.09
5.2.90.0100.05711.02
5.2.80.0030.05711.16
5.2.70.0030.06311.01
5.2.60.0070.06011.19
5.2.50.0100.06010.93
5.2.40.0000.06311.00
5.2.30.0070.05711.04
5.2.20.0030.06711.05
5.2.10.0000.06310.92
5.2.00.0100.05310.64
5.1.60.0030.05010.04
5.1.50.0070.05010.08
5.1.40.0070.05710.09
5.1.30.0130.05010.47
5.1.20.0070.03010.22
5.1.10.0030.05710.11
5.1.00.0030.04710.16
5.0.50.0030.04710.04
5.0.40.0000.04010.04
5.0.30.0000.06710.04
5.0.20.0000.04310.04
5.0.10.0030.04310.04
5.0.00.0070.05710.04
4.4.90.0030.03710.04
4.4.80.0030.03010.04
4.4.70.0070.02710.04
4.4.60.0000.03710.04
4.4.50.0030.03710.04
4.4.40.0030.05710.04
4.4.30.0070.03010.04
4.4.20.0000.03710.04
4.4.10.0030.03310.04
4.4.00.0000.04710.04
4.3.110.0030.03310.04
4.3.100.0030.03310.04
4.3.90.0030.03310.04
4.3.80.0030.05010.04
4.3.70.0000.02010.04
4.3.60.0100.02710.04
4.3.50.0000.03710.04
4.3.40.0100.04310.04
4.3.30.0030.03310.04
4.3.20.0030.03310.04
4.3.10.0030.03310.04
4.3.00.0000.02710.04

preferences:
31.78 ms | 400 KiB | 5 Q