3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { return ""; } } $ts = microtime(true); for ($i=1; $i<=10000; $i++) { $c = new Foo(); echo $c->bar(); unset ($c); } $tt = microtime(true); $t1 = $tt-$ts; unset($ts, $tt); echo "Variable Instantiation takes {$t1} seconds\n"; $ts = microtime(true); for ($i=1; $i<=10000; $i++) { echo (new Foo())->bar(); } $tt = microtime(true); $t2 = $tt-$ts; unset($ts, $tt); echo "Magic Instantiation takes {$t2} seconds\n"; echo "\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.0100.01015.06
7.4.00.0090.01215.11
7.3.130.0040.01814.99
7.3.120.0120.00614.82
7.3.110.0070.01514.78
7.3.100.0070.01114.81
7.3.90.0070.00714.69
7.3.80.0080.00814.54
7.3.70.0070.01114.79
7.3.60.0090.00614.62
7.3.50.0090.00614.59
7.3.40.0090.00614.93
7.3.30.0090.00414.54
7.3.20.0100.00716.90
7.3.10.0030.01216.67
7.3.00.0030.01416.73
7.2.260.0090.00914.80
7.2.250.0030.01715.04
7.2.240.0030.01615.17
7.2.230.0060.00615.37
7.2.220.0090.00915.20
7.2.210.0060.01314.87
7.2.200.0000.01014.89
7.2.190.0040.01215.18
7.2.180.0000.01815.00
7.2.170.0000.01714.73
7.2.160.0000.01514.95
7.2.150.0070.01016.96
7.2.140.0090.00916.88
7.2.130.0040.01116.89
7.2.120.0070.00816.75
7.2.110.0100.00516.91
7.2.100.0030.01216.90
7.2.90.0050.01416.94
7.2.80.0060.01116.75
7.2.70.0030.01316.96
7.2.60.0050.00716.75
7.2.50.0030.01216.95
7.2.40.0000.01216.95
7.2.30.0060.01116.89
7.2.20.0030.01016.97
7.2.10.0050.01116.89
7.2.00.0080.00717.69
7.1.330.0040.01815.87
7.1.320.0120.00915.80
7.1.310.0030.01316.00
7.1.300.0000.01915.71
7.1.290.0030.01015.43
7.1.280.0100.01015.44
7.1.270.0080.01115.64
7.1.260.0060.01015.48
7.1.250.0040.01615.54
7.1.240.0090.00915.75
7.1.230.0000.01815.91
7.1.220.0070.01415.64
7.1.210.0030.01715.78
7.1.200.0040.00815.90
7.1.190.0000.02215.76
7.1.180.0030.01715.71
7.1.170.0000.01415.68
7.1.160.0090.01215.90
7.1.150.0040.01115.72
7.1.140.0110.00415.54
7.1.130.0060.01315.55
7.1.120.0060.01215.80
7.1.110.0060.01215.56
7.1.100.0100.01015.56
7.1.90.0030.01715.82
7.1.80.0000.01315.48
7.1.70.0050.01016.40
7.1.60.0080.01517.42
7.1.50.0050.01716.32
7.1.40.0030.01615.72
7.1.30.0060.00615.35
7.1.20.0060.00915.69
7.1.10.0060.01215.56
7.1.00.0070.02219.10
7.0.330.0040.01515.31
7.0.320.0030.01315.41
7.0.310.0100.00615.37
7.0.300.0090.00615.26
7.0.290.0000.01715.50
7.0.280.0000.01315.45
7.0.270.0100.01015.39
7.0.260.0120.00615.08
7.0.250.0070.01315.15
7.0.240.0030.01715.29
7.0.230.0060.01315.21
7.0.220.0070.01015.39
7.0.210.0060.01215.46
7.0.200.0070.00816.03
7.0.190.0100.01015.40
7.0.180.0070.01015.17
7.0.170.0070.01015.46
7.0.160.0150.00415.43
7.0.150.0160.00615.25
7.0.140.0060.04318.72
7.0.130.0120.00615.43
7.0.120.0100.03818.67
7.0.110.0090.00915.25
7.0.100.0070.01015.53
7.0.90.0040.01115.51
7.0.80.0000.01915.29
7.0.70.0110.00615.19
7.0.60.0050.04817.77
7.0.50.0050.05116.56
7.0.40.0050.03716.72
7.0.30.0160.04016.77
7.0.20.0130.03216.87
7.0.10.0170.04416.77
7.0.00.0120.04216.79
5.6.400.0030.02314.61
5.6.390.0000.01714.12
5.6.380.0090.01214.50
5.6.370.0000.02314.10
5.6.360.0070.01614.38
5.6.350.0030.02114.59
5.6.340.0070.01514.36
5.6.330.0100.01014.63
5.6.320.0070.01714.59
5.6.310.0060.01314.30
5.6.300.0030.01614.25
5.6.290.0040.01814.31
5.6.280.0050.05017.72
5.6.270.0030.01714.45
5.6.260.0030.01914.05
5.6.250.0070.01114.07
5.6.240.0040.01514.47
5.6.230.0040.01514.40
5.6.220.0030.01714.52
5.6.210.0030.03217.55
5.6.200.0070.05316.29
5.6.190.0080.05317.30
5.6.180.0180.04117.45
5.6.170.0130.04517.33
5.6.160.0050.03217.43
5.6.150.0070.04316.19
5.6.140.0030.05516.19
5.6.130.0000.03716.18
5.6.120.0060.04817.79
5.6.110.0100.04417.72
5.6.100.0050.05717.60
5.6.90.0080.05217.59
5.6.80.0090.02917.32
5.6.70.1980.03217.43
5.6.60.0040.02114.27
5.6.50.0000.02114.45
5.6.40.0100.01314.02
5.6.30.0100.01614.04
5.6.20.0070.01414.44
5.6.10.0040.01814.19
5.6.00.0030.01714.07
5.5.380.0000.01814.40
5.5.370.0030.01714.10
5.5.360.0090.01214.17
5.5.350.0100.03117.30
5.5.340.0080.02816.08
5.5.330.0080.03017.16
5.5.320.0270.03817.23
5.5.310.0150.03717.25
5.5.300.0050.03216.22
5.5.290.0120.04316.09
5.5.280.0050.03417.35
5.5.270.0030.03517.56
5.5.260.0070.02817.43
5.5.250.0050.05517.35
5.5.240.0070.05317.17
5.5.230.0030.02314.11
5.5.220.0070.01813.96
5.5.210.0000.02214.29
5.5.200.0090.01613.98
5.5.190.0030.01914.39
5.5.180.0090.01213.82
5.5.170.0060.01614.17
5.5.160.0030.02314.23
5.5.150.0090.01513.98
5.5.140.0070.01313.77
5.5.130.0060.01514.06
5.5.120.0030.02014.28
5.5.110.0000.02113.89
5.5.100.0070.01713.86
5.5.90.0030.02114.18
5.5.80.0030.01914.15
5.5.70.0040.01814.02
5.5.60.0040.01814.38
5.5.50.0070.01614.34
5.5.40.0040.01814.20
5.5.30.0030.02013.79
5.5.20.0130.01014.26
5.5.10.0060.01613.82
5.5.00.0060.01214.11
5.4.450.0180.04715.35
5.4.440.0180.04815.11
5.4.430.0160.05215.28
5.4.420.0190.02415.37
5.4.410.0160.03615.33
5.4.400.0080.03415.14
5.4.390.0120.02815.20
5.4.380.0200.04215.20
5.4.370.0130.04415.12
5.4.360.0200.04515.14
5.4.350.0150.05015.15
5.4.340.0150.04215.21
5.4.330.0060.00911.05
5.4.320.0130.04615.14
5.4.310.0120.04115.21
5.4.300.0080.04115.09
5.4.290.0150.04615.01
5.4.280.0130.04914.95
5.4.270.0100.05115.23
5.4.260.0120.04315.14
5.4.250.0180.03715.14
5.4.240.0120.03115.21
5.4.230.0120.05215.06
5.4.220.0120.03414.95
5.4.210.0120.03615.22
5.4.200.0130.03515.06
5.4.190.0120.02915.09
5.4.180.0030.03915.14
5.4.170.0080.02915.17
5.4.160.0080.03715.09
5.4.150.0130.03015.05
5.4.140.0140.02413.68
5.4.130.0100.02913.67
5.4.120.0120.02713.72
5.4.110.0080.02813.73
5.4.100.0070.02913.79
5.4.90.0120.03113.81
5.4.80.0080.03413.81
5.4.70.0080.03013.82
5.4.60.0080.02913.80
5.4.50.0080.02913.72
5.4.40.0070.03013.79
5.4.30.0100.02813.77
5.4.20.0050.02913.75
5.4.10.0100.02713.75
5.4.00.0050.03113.45
5.3.290.0080.04412.88
5.3.280.0150.02512.77
5.3.270.0220.01812.88
5.3.260.0120.02012.87
5.3.250.0100.02012.79
5.3.240.0140.02312.83
5.3.230.0110.01812.94
5.3.220.0050.02512.81
5.3.210.0060.02212.83
5.3.200.0080.02112.89
5.3.190.0150.01512.76
5.3.180.0110.01712.77
5.3.170.0070.02212.89
5.3.160.0120.02512.76
5.3.150.0080.02112.79
5.3.140.0080.02212.88
5.3.130.0150.01512.91
5.3.120.0110.01812.85
5.3.110.0070.02312.81
5.3.100.0080.02212.55
5.3.90.0110.01812.54
5.3.80.0080.02112.53
5.3.70.0120.02012.50
5.3.60.0130.01712.48
5.3.50.0060.02312.58
5.3.40.0130.02312.50
5.3.30.0120.01812.53
5.3.20.0100.01812.36
5.3.10.0070.02212.37
5.3.00.0130.01712.38
5.2.170.0130.02712.26
5.2.160.0130.02712.26
5.2.150.0030.03712.26
5.2.140.0170.02312.26
5.2.130.0100.02712.26
5.2.120.0130.03312.26
5.2.110.0200.02012.26
5.2.100.0200.02012.26
5.2.90.0070.03012.26
5.2.80.0070.03312.26
5.2.70.0100.03312.26
5.2.60.0170.02712.26
5.2.50.0200.05012.26
5.2.40.0100.04012.26
5.2.30.0070.04012.26
5.2.20.0100.02712.26
5.2.10.0270.03312.26
5.2.00.0230.05012.26
5.1.60.0100.03312.26
5.1.50.0200.04712.26
5.1.40.0130.02712.26
5.1.30.0130.03012.26
5.1.20.0200.02712.26
5.1.10.0070.05712.26
5.1.00.0170.05712.26
5.0.50.0170.04012.26
5.0.40.0130.04312.26
5.0.30.0070.05312.26
5.0.20.0070.01712.26
5.0.10.0130.01312.26
5.0.00.0130.03312.26
4.4.90.0030.01712.26
4.4.80.0030.01712.26
4.4.70.0070.03712.26
4.4.60.0070.03012.26
4.4.50.0070.02012.26
4.4.40.0100.04012.26
4.4.30.0070.03712.26
4.4.20.0100.03012.26
4.4.10.0100.02712.26
4.4.00.0100.05012.26
4.3.110.0130.01312.26
4.3.100.0030.01712.26
4.3.90.0130.01312.26
4.3.80.0070.02312.26
4.3.70.0200.02312.26
4.3.60.0130.01012.26
4.3.50.0130.03012.26
4.3.40.0100.05012.26
4.3.30.0070.03712.26
4.3.20.0100.01712.26
4.3.10.0000.02712.26
4.3.00.0100.01712.26

preferences:
64.32 ms | 401 KiB | 5 Q