3v4l.org

run code in 300+ PHP versions simultaneously
<?php function object_diff($source, $target) { if (!is_object($source) || !is_object($target) || !($source instanceof $target)) { return null; } $sourceProperties = []; $targetProperties = []; $sourceReflection = new ReflectionObject($source); $targetReflection = new ReflectionObject($target); foreach ($sourceReflection->getProperties() as $sourceProperty) { $sourceProperty->setAccessible(true); $sourceProperties[$sourceProperty->getName()] = $sourceProperty->getValue($source); } foreach ($targetReflection->getProperties() as $targetProperty) { $targetProperty->setAccessible(true); $targetProperties[$targetProperty->getName()] = $targetProperty->getValue($target); } return array_diff_assoc($sourceProperties, $targetProperties); } class Foo { private $a, $b, $c; public function __construct($a, $b, $c) { $this->a = $a; $this->b = $b; $this->c = $c; } } $foo1 = new Foo('1', '2', '3'); $foo2 = new Foo('1', '3', '4'); var_dump(object_diff($foo1, $foo2));

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.40.0090.00618.98
8.3.30.0100.00320.29
8.3.20.0080.00020.48
8.3.10.0040.00421.04
8.3.00.0030.00623.66
8.2.170.0100.01022.96
8.2.160.0070.00720.39
8.2.150.0030.00524.18
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0000.00721.08
8.2.110.0030.00621.06
8.2.100.0040.00817.84
8.2.90.0000.00817.75
8.2.80.0040.00418.73
8.2.70.0070.00417.50
8.2.60.0050.00318.03
8.2.50.0060.00318.07
8.2.40.0100.00318.27
8.2.30.0030.00618.07
8.2.20.0000.00717.80
8.2.10.0040.00417.78
8.2.00.0030.00717.81
8.1.270.0040.00423.99
8.1.260.0000.00726.35
8.1.250.0000.00828.09
8.1.240.0000.01117.35
8.1.230.0060.00619.61
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0030.00617.35
8.1.180.0060.00320.60
8.1.170.0040.00420.07
8.1.160.0040.00418.91
8.1.150.0080.00018.67
8.1.140.0000.00717.53
8.1.130.0030.00517.84
8.1.120.0040.00417.49
8.1.110.0000.00817.36
8.1.100.0040.00417.38
8.1.90.0040.00417.55
8.1.80.0040.00417.34
8.1.70.0000.00717.43
8.1.60.0040.00417.52
8.1.50.0030.00517.43
8.1.40.0040.00417.53
8.1.30.0000.00817.61
8.1.20.0040.00417.65
8.1.10.0050.00317.53
8.1.00.0050.00317.53
8.0.300.0070.00018.96
8.0.290.0030.00516.63
8.0.280.0070.00018.38
8.0.270.0030.00317.29
8.0.260.0040.00416.80
8.0.250.0030.00517.01
8.0.240.0000.00716.87
8.0.230.0030.00316.99
8.0.220.0070.00016.91
8.0.210.0040.00416.87
8.0.200.0030.00316.98
8.0.190.0060.00316.94
8.0.180.0000.00716.97
8.0.170.0000.00816.82
8.0.160.0000.01116.79
8.0.150.0000.01016.93
8.0.140.0000.00716.87
8.0.130.0000.00513.33
8.0.120.0080.00016.90
8.0.110.0000.00716.71
8.0.100.0000.00716.89
8.0.90.0000.00716.88
8.0.80.0040.01116.80
8.0.70.0000.00716.91
8.0.60.0030.00516.90
8.0.50.0050.00316.97
8.0.30.0100.00817.08
8.0.20.0130.00717.40
8.0.10.0040.00316.92
8.0.00.0120.00516.84
7.4.330.0050.00016.76
7.4.320.0050.00216.47
7.4.300.0040.00416.39
7.4.290.0030.00316.46
7.4.280.0030.00616.52
7.4.270.0030.00316.62
7.4.260.0060.00013.29
7.4.250.0070.00016.53
7.4.240.0030.00316.55
7.4.230.0000.00716.59
7.4.220.0060.01216.45
7.4.210.0090.00716.66
7.4.200.0050.00216.52
7.4.190.0070.00016.50
7.4.160.0080.00816.28
7.4.150.0090.00917.40
7.4.140.0070.01117.86
7.4.130.0130.00816.53
7.4.120.0110.00916.53
7.4.110.0140.00716.58
7.4.100.0130.00316.57
7.4.90.0110.00716.55
7.4.80.0160.00319.39
7.4.70.0150.00616.71
7.4.60.0090.00616.57
7.4.50.0060.00316.34
7.4.40.0100.00722.77
7.4.30.0080.00816.69
7.4.00.0040.01115.02
7.3.330.0000.00513.38
7.3.320.0000.00613.40
7.3.310.0000.00716.38
7.3.300.0060.00016.32
7.3.290.0070.01116.32
7.3.280.0100.00716.40
7.3.270.0100.01317.40
7.3.260.0120.01018.24
7.3.250.0240.00916.49
7.3.240.0070.01016.60
7.3.230.0070.01016.59
7.3.210.0100.00716.46
7.3.200.0100.01019.39
7.3.190.0070.01416.30
7.3.180.0090.00916.66
7.3.170.0110.00716.44
7.3.160.0060.01516.42
7.3.120.0070.00714.99
7.2.330.0040.01416.59
7.2.320.0190.00416.61
7.2.310.0140.00716.69
7.2.300.0120.00616.46
7.2.290.0060.01216.69
7.2.00.0030.00719.48
7.1.100.0000.01017.73
7.1.70.0110.00417.23
7.1.60.0140.01119.17
7.1.50.0120.00916.68
7.1.00.0030.07722.51
7.0.200.0080.00016.88
7.0.140.0100.06722.09
7.0.100.0100.07720.08
7.0.90.0000.08720.05
7.0.80.0170.04720.00
7.0.70.0230.06719.89
7.0.60.0030.08319.90
7.0.50.0170.07720.37
7.0.40.0130.08020.19
7.0.30.0130.07720.13
7.0.20.0100.08020.03
7.0.10.0070.05020.10
7.0.00.0100.06020.08
5.6.280.0030.07320.91
5.6.250.0130.07720.68
5.6.240.0100.07720.62
5.6.230.0170.07020.55
5.6.220.0070.08020.50
5.6.210.0100.07720.69
5.6.200.0070.08721.05
5.6.190.0030.07721.08
5.6.180.0030.08321.05
5.6.170.0170.07321.00
5.6.160.0130.05321.07
5.6.150.0100.04721.06
5.6.140.0170.07321.06
5.6.130.0200.07721.07
5.6.120.0100.08321.12
5.6.110.0170.07721.02
5.6.100.0030.08721.04
5.6.90.0100.04721.12
5.6.80.0170.06020.40
5.6.70.0030.06720.40
5.6.60.0170.07020.51
5.6.50.0100.07020.50
5.6.40.0130.07720.31
5.6.30.0100.07720.50
5.6.20.0070.06720.41
5.6.10.0070.08020.25
5.6.00.0070.07020.40
5.5.380.0030.08720.37
5.5.370.0130.06720.53
5.5.360.0130.08720.40
5.5.350.0130.08020.43
5.5.340.0200.07320.95
5.5.330.0100.08320.88
5.5.320.0130.07720.92
5.5.310.0170.05020.75
5.5.300.0070.08720.93
5.5.290.0170.06020.88
5.5.280.0100.07720.93
5.5.270.0070.08720.80
5.5.260.0100.07720.88
5.5.250.0100.08720.75
5.5.240.0200.06320.26
5.5.230.0130.07720.27
5.5.220.0030.07720.15
5.5.210.0130.07320.30
5.5.200.0070.04020.08
5.5.190.0070.04720.28
5.5.180.0170.05720.29
5.5.160.0100.06020.13
5.5.150.0100.06320.14
5.5.140.0030.07320.20
5.5.130.0100.07720.19
5.5.120.0030.08320.25
5.5.110.0000.08720.13
5.5.100.0070.07320.12
5.5.90.0100.07720.06
5.5.80.0100.08020.11
5.5.70.0130.06720.18
5.5.60.0130.07020.07
5.5.50.0070.07720.10
5.5.40.0100.06019.95
5.5.30.0130.06020.12
5.5.20.0070.07320.07
5.5.10.0100.07320.02
5.5.00.0100.07720.05
5.4.450.0130.07719.18
5.4.440.0000.09019.37
5.4.430.0200.07019.35
5.4.420.0070.04719.17
5.4.410.0170.07319.29
5.4.400.0070.07019.07
5.4.390.0000.04318.91
5.4.380.0170.07019.03
5.4.370.0030.04719.09
5.4.360.0070.08019.05
5.4.350.0200.06019.13
5.4.340.0170.06019.04
5.4.320.0130.06718.95
5.4.310.0030.08019.13
5.4.300.0100.07319.02
5.4.290.0170.03319.15
5.4.280.0070.08019.21
5.4.270.0070.04718.86
5.4.260.0070.07319.18
5.4.250.0070.07319.08
5.4.240.0130.06719.04
5.4.230.0070.07319.09
5.4.220.0100.04318.90
5.4.210.0100.07318.94
5.4.200.0130.03718.87
5.4.190.0170.06719.13
5.4.180.0070.07718.93
5.4.170.0030.07318.99
5.4.160.0000.04018.85
5.4.150.0030.08318.95
5.4.140.0100.05716.45
5.4.130.0130.05716.41
5.4.120.0030.07016.41
5.4.110.0130.06716.44
5.4.100.0170.06316.56
5.4.90.0030.07316.49
5.4.80.0130.06716.54
5.4.70.0070.06016.43
5.4.60.0100.05716.26
5.4.50.0130.05716.44
5.4.40.0070.07016.50
5.4.30.0170.06016.41
5.4.20.0030.04316.25
5.4.10.0100.06016.39
5.4.00.0100.06315.82
5.3.290.0030.04714.67
5.3.280.0070.08014.56
5.3.270.0070.06714.66
5.3.260.0030.08014.64
5.3.250.0000.04714.54
5.3.240.0200.06314.63
5.3.230.0170.06714.70
5.3.220.0130.07014.62
5.3.210.0030.08014.54
5.3.200.0030.05314.63
5.3.190.0070.07714.57
5.3.180.0170.07014.62
5.3.170.0100.07314.63
5.3.160.0100.05014.52
5.3.150.0070.04014.53
5.3.140.0070.06714.49
5.3.130.0070.07714.64
5.3.120.0100.07014.57
5.3.110.0070.05014.47
5.3.100.0130.06714.01
5.3.90.0070.06713.96
5.3.80.0070.07313.95
5.3.70.0100.07014.08
5.3.60.0100.05314.13
5.3.50.0170.06714.01
5.3.40.0070.07714.01
5.3.30.0000.07713.94
5.3.20.0100.07313.80
5.3.10.0100.06313.72
5.3.00.0030.07713.56
5.2.170.0100.04013.17
5.2.160.0070.05013.17
5.2.150.0070.05013.17
5.2.140.0030.06313.17
5.2.130.0030.06313.17
5.2.120.0070.06013.17
5.2.110.0030.06313.17
5.2.100.0030.04713.17
5.2.90.0030.06013.17
5.2.80.0100.05713.17
5.2.70.0030.06713.17
5.2.60.0030.05713.17
5.2.50.0000.04313.17
5.2.40.0030.06313.17
5.2.30.0070.05713.17
5.2.20.0100.05713.17
5.2.10.0030.06013.17
5.2.00.0030.06313.17
5.1.60.0000.06013.17
5.1.50.0100.05013.17
5.1.40.0030.05313.17
5.1.30.0100.05313.17
5.1.20.0030.03313.17
5.1.10.0000.05013.17
5.1.00.0100.04013.17
5.0.50.0070.04013.17
5.0.40.0030.04313.17
5.0.30.0030.05013.17
5.0.20.0130.03013.17
5.0.10.0030.04013.17
5.0.00.0000.06713.17
4.4.90.0000.04013.17
4.4.80.0030.03013.17
4.4.70.0070.01313.17
4.4.60.0000.03713.17
4.4.50.0000.04013.17
4.4.40.0030.03313.17
4.4.30.0000.03713.17
4.4.20.0030.03313.17
4.4.10.0070.03013.17
4.4.00.0000.03313.17
4.3.110.0030.02013.17
4.3.100.0000.02313.17
4.3.90.0000.03713.17
4.3.80.0070.04713.17
4.3.70.0070.03313.17
4.3.60.0070.02313.17
4.3.50.0030.03313.17
4.3.40.0070.03013.17
4.3.30.0000.02013.17
4.3.20.0000.03713.17
4.3.10.0030.03313.17
4.3.00.0000.03713.17

preferences:
42.23 ms | 400 KiB | 5 Q