3v4l.org

run code in 300+ PHP versions simultaneously
<?php class container { protected $storage=array(); public function add(test1 $obj) { if(!isset($this->storage[spl_object_hash($obj)])) { $this->storage[spl_object_hash($obj)]=$obj; } } } class test1 { public function __construct($s) { } } $o=new container(); $o->add(new test1("lalala")); // will be added $o->add(new test1("lololo")); // not added - NOT as expected $t=new test("lalala"); $o=new container(); $o->add($t); // will be added $o->add($t); // not added - as expected var_dump($o);

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.0100.01016.88
8.3.50.0160.00522.06
8.3.40.0110.00418.96
8.3.30.0100.00319.21
8.3.20.0000.00720.20
8.3.10.0040.00423.65
8.3.00.0070.00020.69
8.2.180.0120.00616.88
8.2.170.0180.00422.96
8.2.160.0040.01122.04
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0110.00426.16
8.2.120.0040.01122.00
8.2.110.0090.00022.20
8.2.100.0070.00417.84
8.2.90.0030.00619.35
8.2.80.0060.00317.97
8.2.70.0040.00417.75
8.2.60.0080.00018.05
8.2.50.0000.00918.07
8.2.40.0040.00419.21
8.2.30.0000.00718.02
8.2.20.0080.00017.77
8.2.10.0040.00417.87
8.2.00.0040.00417.82
8.1.280.0080.00825.92
8.1.270.0060.00323.91
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.81
8.1.230.0080.00319.17
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00617.23
8.1.190.0040.00417.53
8.1.180.0000.00918.10
8.1.170.0000.00918.53
8.1.160.0090.00022.05
8.1.150.0030.00518.70
8.1.140.0080.00017.39
8.1.130.0040.00417.84
8.1.120.0040.00317.55
8.1.110.0000.00817.50
8.1.100.0000.00817.53
8.1.90.0000.00717.47
8.1.80.0030.00317.38
8.1.70.0040.00417.39
8.1.60.0050.00317.50
8.1.50.0000.00817.52
8.1.40.0080.00017.42
8.1.30.0090.00017.64
8.1.20.0000.00817.55
8.1.10.0050.00317.62
8.1.00.0000.00817.43
8.0.300.0040.00418.77
8.0.290.0040.00417.16
8.0.280.0030.00318.47
8.0.270.0080.00017.30
8.0.260.0000.00716.88
8.0.250.0000.00816.99
8.0.240.0080.00017.04
8.0.230.0050.00317.02
8.0.220.0000.00617.01
8.0.210.0030.00316.90
8.0.200.0060.00316.91
8.0.190.0070.00017.02
8.0.180.0040.00416.87
8.0.170.0080.00016.93
8.0.160.0000.00716.96
8.0.150.0040.00416.90
8.0.140.0070.00016.82
8.0.130.0000.00613.30
8.0.120.0080.00016.89
8.0.110.0000.00716.94
8.0.100.0040.00416.97
8.0.90.0000.00716.76
8.0.80.0070.00717.01
8.0.70.0040.00417.01
8.0.60.0040.00416.76
8.0.50.0000.00717.01
8.0.30.0100.01017.18
8.0.20.0120.00817.40
8.0.10.0040.00417.12
8.0.00.0080.01216.88
7.4.330.0030.00315.08
7.4.320.0030.00316.60
7.4.300.0030.00516.63
7.4.290.0000.00816.59
7.4.280.0000.00716.41
7.4.270.0000.00716.58
7.4.260.0000.00716.53
7.4.250.0070.00016.47
7.4.240.0000.00716.53
7.4.230.0030.00316.56
7.4.220.0130.00716.47
7.4.210.0060.00816.61
7.4.200.0050.00216.63
7.4.190.0040.00416.71
7.4.160.0100.01016.63
7.4.150.0110.00717.40
7.4.140.0120.00817.86
7.4.130.0130.00716.60
7.4.120.0120.00516.60
7.4.110.0120.00916.53
7.4.100.0080.01216.54
7.4.90.0040.01316.41
7.4.80.0100.00716.49
7.4.70.0120.00616.54
7.4.60.0040.01416.60
7.4.50.0000.00916.41
7.4.40.0030.01022.77
7.4.30.0130.00316.54
7.4.00.0070.01115.07
7.3.330.0000.00513.43
7.3.320.0030.00313.46
7.3.310.0050.00216.48
7.3.300.0070.00016.50
7.3.290.0070.01116.45
7.3.280.0100.00916.41
7.3.270.0100.00617.40
7.3.260.0030.01316.44
7.3.250.0100.01016.38
7.3.240.0070.01116.47
7.3.230.0130.01316.59
7.3.210.0110.00616.34
7.3.200.0070.01319.39
7.3.190.0110.01116.48
7.3.180.0160.00316.57
7.3.170.0040.01916.41
7.3.160.0090.00616.45
7.3.120.0090.00614.98
7.3.10.0000.01116.83
7.3.00.0000.00916.64
7.2.330.0100.01016.39
7.2.320.0100.00716.58
7.2.310.0160.00016.82
7.2.300.0120.00416.49
7.2.290.0120.00416.56
7.2.130.0100.00317.02
7.2.120.0120.00016.59
7.2.110.0030.00717.08
7.2.100.0030.00916.56
7.2.90.0030.00916.61
7.2.80.0080.00817.17
7.2.70.0000.01216.84
7.2.60.0020.01316.90
7.2.50.0040.00816.88
7.2.40.0000.01016.79
7.2.30.0040.00816.31
7.2.20.0070.00716.60
7.2.10.0060.00916.96
7.2.00.0030.00817.97
7.1.250.0040.00415.76
7.1.200.0070.00715.80
7.1.100.0090.00318.20
7.1.70.0000.00816.97
7.1.60.0130.01319.29
7.1.50.0030.00716.73
7.1.00.0100.07022.33
7.0.200.0030.00616.53
7.0.140.0000.07322.12
7.0.60.0070.05719.83
7.0.50.0070.04717.84
7.0.40.0070.05020.30
7.0.30.0270.04020.26
7.0.20.0270.07320.09
7.0.10.0070.04020.26
7.0.00.0070.07320.07
5.6.280.0030.07021.16
5.6.210.0170.07320.51
5.6.200.0070.03718.19
5.6.190.0200.07020.68
5.6.180.0270.04020.39
5.6.170.0200.03720.44
5.6.160.0100.08320.56
5.6.150.0070.04318.18
5.6.140.0000.06018.18
5.6.130.0000.04318.16
5.6.120.0000.04720.90
5.6.110.0070.08021.05
5.6.100.0030.09021.11
5.6.90.0030.08020.98
5.6.80.0070.06720.36
5.6.70.4700.04020.48
5.5.350.0200.06720.44
5.5.340.0030.08717.96
5.5.330.0070.08320.40
5.5.320.0100.04720.27
5.5.310.0170.04320.51
5.5.300.0070.05017.95
5.5.290.0070.07318.08
5.5.280.0030.04020.89
5.5.270.0070.04020.77
5.5.260.0170.07320.73
5.5.250.0070.08320.62
5.5.240.0400.05720.27
5.4.450.0930.06319.47
5.4.440.0600.06019.55
5.4.430.0100.05719.38
5.4.420.0600.00019.38
5.4.410.0170.04718.98
5.4.400.0370.06018.61
5.4.390.0700.05018.80
5.4.380.0270.05318.50
5.4.370.0070.04018.62
5.4.360.0070.05018.55
5.4.350.0060.03412.03
5.4.340.0040.03612.03
5.4.320.0080.03912.51
5.4.310.0070.03912.51
5.4.300.0080.04512.51
5.4.290.0050.04212.51
5.4.280.0060.04112.40
5.4.270.0050.03612.40
5.4.260.0070.04312.40
5.4.250.0050.03812.40
5.4.240.0070.04612.40
5.4.230.0080.04112.40
5.4.220.0040.04312.39
5.4.210.0070.04312.39
5.4.200.0110.03812.39
5.4.190.0160.04612.39
5.4.180.0170.04612.38
5.4.170.0150.05412.39
5.4.160.0350.08912.39
5.4.150.0200.04712.38
5.4.140.0190.04212.06
5.4.130.0340.06012.05
5.4.120.0120.04812.01
5.4.110.0250.04212.01
5.4.100.0180.04812.01
5.4.90.0130.04712.00
5.4.80.0150.04612.01
5.4.70.0180.04012.00
5.4.60.0210.03812.00
5.4.50.0160.04212.00
5.4.40.0140.04612.00
5.4.30.0120.04811.99
5.4.20.0160.04411.99
5.4.10.0160.04311.99
5.4.00.0160.04111.48
5.3.290.0080.04812.80
5.3.280.0050.04412.71
5.3.270.0180.04512.72
5.3.260.0190.04312.72
5.3.250.0210.04512.71
5.3.240.0180.04512.72
5.3.230.0210.04412.71
5.3.220.0170.04512.68
5.3.210.0200.04612.68
5.3.200.0170.05412.68
5.3.190.0220.04412.68
5.3.180.0220.04512.68
5.3.170.0210.04412.67
5.3.160.0160.04712.68
5.3.150.0200.04312.67
5.3.140.0190.05012.66
5.3.130.0200.04512.66
5.3.120.0150.04712.65
5.3.110.0150.04812.66
5.3.100.0220.03912.13
5.3.90.0120.04812.11
5.3.80.0140.04912.10
5.3.70.0150.04712.11
5.3.60.0230.04112.09
5.3.50.0160.04512.04
5.3.40.0130.05212.03
5.3.30.0200.04112.00
5.3.20.0190.04011.78
5.3.10.0130.04511.74
5.3.00.0160.04211.73
5.2.170.0120.0369.23
5.2.160.0160.0329.23
5.2.150.0140.0359.23
5.2.140.0100.0389.22
5.2.130.0130.0359.19
5.2.120.0140.0369.18
5.2.110.0120.0379.20
5.2.100.0130.0349.20
5.2.90.0140.0349.19
5.2.80.0130.0359.19
5.2.70.0110.0379.18
5.2.60.0120.0369.14
5.2.50.0130.0359.10
5.2.40.0120.0369.09
5.2.30.0090.0389.05
5.2.20.0140.0339.06
5.2.10.0090.0388.95
5.2.00.0110.0348.80
5.1.60.0100.0308.09
5.1.50.0100.0318.09
5.1.40.0120.0288.07
5.1.30.0120.0308.42
5.1.20.0090.0348.45
5.1.10.0110.0328.17
5.1.00.0110.0308.17
5.0.50.0110.0236.64
5.0.40.0070.0256.50
5.0.30.0100.0356.32
5.0.20.0070.0266.29
5.0.10.0110.0216.26
5.0.00.0070.0376.25
4.4.90.0070.0194.78
4.4.80.0100.0154.75
4.4.70.0080.0194.76
4.4.60.0050.0214.75
4.4.50.0060.0194.77
4.4.40.0060.0304.71
4.4.30.0100.0184.76
4.4.20.0090.0194.84
4.4.10.0070.0204.85
4.4.00.0080.0304.76
4.3.110.0080.0174.67
4.3.100.0090.0164.66
4.3.90.0130.0134.63
4.3.80.0080.0294.59
4.3.70.0070.0174.63
4.3.60.0080.0174.63
4.3.50.0050.0204.63
4.3.40.0090.0264.54
4.3.30.0060.0183.29
4.3.20.0050.0193.29
4.3.10.0050.0203.25
4.3.00.0070.0237.02

preferences:
40.49 ms | 401 KiB | 5 Q