3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Service { public $class; public function __construct($class) { $this->class = $class; } } class Container { public $services = array(); } $container = new Container(); $start = memory_get_usage(); for ($i = 0; $i < 1000; $i++) { $container->services[] = new Service('Foo'.$i); } $delta = memory_get_usage() - $start; echo 'Memory usage of 1000 service objects: '.$delta, PHP_EOL; $container = new Container(); $start = memory_get_usage(); for ($i = 0; $i < 1000; $i++) { $container->services[] = array('Foo'.$i); } $delta = memory_get_usage() - $start; echo 'Memory usage of 1000 service arrays: '.$delta;

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.3.10.0100.00316.45
7.3.00.0040.01216.42
7.2.130.0070.00716.94
7.2.120.0070.00716.78
7.2.110.0050.00816.84
7.2.100.0050.00916.92
7.2.90.0120.00317.01
7.2.80.0050.00717.00
7.2.70.0100.01016.74
7.2.60.0040.01016.81
7.2.50.0090.00916.66
7.2.40.0110.00716.96
7.2.30.0030.00816.83
7.2.20.0050.00816.86
7.2.10.0100.00716.85
7.2.00.0060.00817.93
7.1.250.0060.00815.59
7.1.240.0150.00415.60
7.1.230.0030.01215.40
7.1.220.0160.00315.70
7.1.210.0080.00415.73
7.1.200.0040.00815.74
7.1.190.0090.00615.65
7.1.180.0000.01515.09
7.1.170.0030.00615.63
7.1.160.0000.01415.68
7.1.150.0070.00715.59
7.1.140.0080.00415.75
7.1.130.0110.00415.80
7.1.120.0040.00415.79
7.1.110.0040.00715.61
7.1.100.0000.01315.93
7.1.90.0100.00715.79
7.1.80.0040.01115.48
7.1.70.0090.00816.54
7.1.60.0050.01117.38
7.1.50.0070.01216.25
7.1.40.0030.00615.64
7.1.30.0040.00715.57
7.1.20.0060.00615.84
7.1.10.0040.00415.27
7.1.00.0070.02018.99
7.0.330.0060.00915.09
7.0.320.0040.00415.27
7.0.310.0070.00415.38
7.0.300.0060.00615.45
7.0.290.0050.00515.15
7.0.280.0050.00515.27
7.0.270.0000.01115.28
7.0.260.0170.00315.35
7.0.250.0060.00915.38
7.0.240.0070.00315.37
7.0.230.0060.00615.26
7.0.220.0090.00915.33
7.0.210.0030.00715.39
7.0.200.0050.00315.96
7.0.190.0070.00315.32
7.0.180.0100.00715.31
7.0.170.0110.00415.44
7.0.160.0030.01015.07
7.0.150.0080.00815.43
7.0.140.0040.03818.64
7.0.130.0070.00715.63
7.0.120.0030.00915.51
7.0.110.0100.00315.50
7.0.100.0060.00315.52
7.0.90.0050.00515.52
7.0.80.0060.00615.55
7.0.70.0000.01215.18
7.0.60.0050.03017.90
7.0.50.0050.04416.98
7.0.40.0070.03216.71
7.0.30.0180.03116.75
7.0.20.0120.04016.63
7.0.10.0030.02816.77
7.0.00.0030.04516.69
5.6.380.0100.00315.14
5.6.370.0030.00615.15
5.6.360.0040.01414.69
5.6.350.0070.00715.01
5.6.340.0090.00614.98
5.6.330.0060.00914.99
5.6.320.0000.01214.87
5.6.310.0060.00614.89
5.6.300.0030.00614.68
5.6.290.0000.01514.57
5.6.280.0120.03718.41
5.6.270.0040.00714.96
5.6.260.0080.00814.92
5.6.250.0060.00915.30
5.6.240.0000.01414.90
5.6.230.0030.01014.91
5.6.220.0080.00414.83
5.6.210.0080.04318.10
5.6.200.0070.04616.91
5.6.190.0130.04117.95
5.6.180.1330.02517.83
5.6.170.0170.04017.95
5.6.160.0070.04517.89
5.6.150.0030.02516.77
5.6.140.0080.04316.67
5.6.130.0080.04316.77
5.6.120.0070.03918.17
5.6.110.0110.04218.13
5.6.100.0050.04918.10
5.6.90.0060.04318.21
5.6.80.0100.04017.82
5.6.70.2170.02517.85
5.6.60.0080.00315.00
5.6.50.0030.01015.11
5.6.40.0060.00814.80
5.6.30.0030.00715.08
5.6.20.0030.01414.89
5.6.10.0090.00615.03
5.6.00.0040.01214.70
5.5.380.0000.01212.02
5.5.370.0060.00611.96
5.5.360.0000.01211.89
5.5.350.0120.02516.32
5.5.340.0070.03115.08
5.5.330.0100.04116.34
5.5.320.1280.02716.16
5.5.310.0190.04416.07
5.5.300.0070.04515.04
5.5.290.0030.03115.13
5.5.280.0070.04916.61
5.5.270.0080.02016.55
5.5.260.0130.03216.32
5.5.250.0070.03216.19
5.5.240.0180.03316.27
5.5.230.0030.00711.79
5.5.220.0070.00311.57
5.5.210.0070.00711.74
5.5.200.0060.00911.66
5.5.190.0040.01111.54
5.5.180.0000.00911.52
5.5.170.0030.01211.78
5.5.160.0070.00711.40
5.5.150.0030.01011.74
5.5.140.0040.00711.61
5.5.130.0030.00711.64
5.5.120.0040.01111.73
5.5.110.0080.00511.37
5.5.100.0060.00611.64
5.5.90.0030.01211.73
5.5.80.0030.00711.53
5.5.70.0000.01411.50
5.5.60.0060.00611.63
5.5.50.0080.00611.55
5.5.40.0030.01011.61
5.5.30.0040.00711.56
5.5.20.0050.00711.54
5.5.10.0070.00311.54
5.5.00.0030.01011.66
5.4.450.0170.03415.86
5.4.440.0130.04515.76
5.4.430.0150.03515.75
5.4.420.0170.04515.69
5.4.410.0150.02315.74
5.4.400.0190.03815.67
5.4.390.0200.02415.62
5.4.380.0180.02115.65
5.4.370.0160.02615.43
5.4.360.0190.03815.33
5.4.350.0170.02315.60
5.4.340.0130.02815.63
5.4.330.0030.01011.33
5.4.320.0180.03815.43
5.4.310.0130.02215.47
5.4.300.0130.02115.59
5.4.290.0070.02515.55
5.4.280.0120.02515.46
5.4.270.0100.02815.41
5.4.260.0140.02015.67
5.4.250.0100.02615.53
5.4.240.0110.02815.40
5.4.230.0110.02215.47
5.4.220.0100.02515.50
5.4.210.0140.02015.32
5.4.200.0120.02315.38
5.4.190.0150.02015.41
5.4.180.0110.02315.50
5.4.170.0120.02715.69
5.4.160.0080.02715.33
5.4.150.0110.02815.42
5.4.140.0140.02114.18
5.4.130.0120.02214.10
5.4.120.0170.01714.46
5.4.110.0090.02514.28
5.4.100.0100.02514.12
5.4.90.0120.02014.15
5.4.80.0070.02814.07
5.4.70.0180.02314.16
5.4.60.0130.02214.29
5.4.50.0130.02214.30
5.4.40.0130.02514.16
5.4.30.0180.03914.21
5.4.20.0170.02214.36
5.4.10.0190.03914.19
5.4.00.0150.03913.86
5.3.290.0140.02213.36
5.3.280.0150.02513.28
5.3.270.0150.02513.29
5.3.260.0160.02013.33
5.3.250.0140.02113.21
5.3.240.0130.02313.12
5.3.230.0120.02413.34
5.3.220.0110.02413.22
5.3.210.0070.02813.29
5.3.200.0180.02013.30
5.3.190.0110.02513.19
5.3.180.0100.02913.37
5.3.170.0150.02613.36
5.3.160.0190.03913.32
5.3.150.0150.04313.38
5.3.140.0180.02413.27
5.3.130.0210.03413.21
5.3.120.0200.01913.21
5.3.110.0230.03813.20
5.3.100.0180.03912.98
5.3.90.0220.02112.97
5.3.80.0200.02512.83
5.3.70.0230.03512.85
5.3.60.0160.02612.83
5.3.50.0130.02513.00
5.3.40.0170.04113.01
5.3.30.0280.03413.05
5.3.20.0200.02612.83
5.3.10.0170.03912.59
5.3.00.0210.02712.63
5.2.170.0150.01911.42
5.2.160.0180.03311.42
5.2.150.0150.03011.42
5.2.140.0170.02811.42
5.2.130.0120.02711.42
5.2.120.0140.02311.42
5.2.110.0170.03211.42
5.2.100.0160.03211.42
5.2.90.0230.02611.42
5.2.80.0170.03111.42
5.2.70.0150.03411.42
5.2.60.0150.02911.42
5.2.50.0250.02011.42
5.2.40.0180.02111.42
5.2.30.0130.03511.42
5.2.20.0140.03311.42
5.2.10.0150.03511.42
5.2.00.0110.02211.42
5.1.60.0100.02111.42
5.1.50.0170.02511.42
5.1.40.0180.01811.42
5.1.30.0160.01911.42
5.1.20.0100.03211.42
5.1.10.0140.02711.42
5.1.00.0140.01211.42
5.0.50.0100.02411.42
5.0.40.0110.01811.42
5.0.30.0090.02611.42
5.0.20.0070.01111.42
5.0.10.0110.02211.42
5.0.00.0080.03111.42
4.4.90.0050.01111.42
4.4.80.0100.01611.42
4.4.70.0050.01711.42
4.4.60.0080.02111.42
4.4.50.0070.01211.42
4.4.40.0080.01711.42
4.4.30.0070.01411.42
4.4.20.0050.01211.42
4.4.10.0060.01311.42
4.4.00.0100.02711.42
4.3.110.0090.01911.42
4.3.100.0050.00911.42
4.3.90.0050.02011.42
4.3.80.0070.01611.42
4.3.70.0080.01711.42
4.3.60.0080.01611.42
4.3.50.0080.01211.42
4.3.40.0070.02711.42
4.3.30.0070.01811.42
4.3.20.0050.01311.42
4.3.10.0050.01811.42
4.3.00.0070.01511.42

preferences:
37.56 ms | 400 KiB | 5 Q