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($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.0070.00718.68
8.3.30.0100.00320.35
8.3.20.0080.00020.53
8.3.10.0080.00021.05
8.3.00.0000.01023.64
8.2.170.0120.00322.96
8.2.160.0060.01320.35
8.2.150.0040.01224.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00021.13
8.2.110.0090.00019.09
8.2.100.0040.00817.91
8.2.90.0050.00219.35
8.2.80.0050.00318.05
8.2.70.0060.00617.50
8.2.60.0040.00417.91
8.2.50.0000.00818.07
8.2.40.0080.00018.16
8.2.30.0030.00519.40
8.2.20.0040.00417.67
8.2.10.0000.00817.74
8.2.00.0030.00617.68
8.1.270.0040.00423.99
8.1.260.0000.00826.35
8.1.250.0030.00628.09
8.1.240.0060.00620.81
8.1.230.0080.00420.86
8.1.220.0000.00818.77
8.1.210.0000.00818.77
8.1.200.0030.00617.25
8.1.190.0050.00317.53
8.1.180.0040.00418.10
8.1.170.0030.00618.46
8.1.160.0000.00818.83
8.1.150.0000.00818.67
8.1.140.0060.00317.44
8.1.130.0030.00617.72
8.1.120.0000.00817.48
8.1.110.0000.00717.39
8.1.100.0070.00017.47
8.1.90.0030.00317.37
8.1.80.0000.00917.44
8.1.70.0080.00017.41
8.1.60.0000.00817.56
8.1.50.0040.00417.48
8.1.40.0000.00817.54
8.1.30.0040.00417.68
8.1.20.0000.00817.52
8.1.10.0000.00817.60
8.1.00.0040.00417.40
8.0.300.0080.00020.02
8.0.290.0040.00417.16
8.0.280.0000.00718.47
8.0.270.0030.00317.24
8.0.260.0000.00616.88
8.0.250.0040.00416.95
8.0.240.0050.00216.93
8.0.230.0030.00317.02
8.0.220.0040.00316.91
8.0.210.0040.00416.93
8.0.200.0030.00316.87
8.0.190.0040.00416.84
8.0.180.0050.00216.89
8.0.170.0030.00316.82
8.0.160.0030.00516.88
8.0.150.0040.00416.82
8.0.140.0000.00816.93
8.0.130.0030.00313.36
8.0.120.0000.00816.89
8.0.110.0040.00416.86
8.0.100.0000.00716.91
8.0.90.0000.00717.02
8.0.80.0120.00616.93
8.0.70.0080.00016.74
8.0.60.0040.00416.71
8.0.50.0060.00316.78
8.0.30.0110.00817.32
8.0.20.0130.00817.40
8.0.10.0000.00716.84
8.0.00.0080.01016.84
7.4.330.0000.00516.83
7.4.320.0000.00716.63
7.4.300.0050.00216.62
7.4.290.0030.00316.56
7.4.280.0090.00016.53
7.4.270.0070.00016.47
7.4.260.0070.00013.24
7.4.250.0000.00816.56
7.4.240.0040.00416.60
7.4.230.0000.00716.73
7.4.220.0070.01416.48
7.4.210.0070.00716.59
7.4.200.0070.00016.63
7.4.190.0000.00716.47
7.4.160.0160.00016.36
7.4.150.0140.00417.40
7.4.140.0120.00717.86
7.4.130.0070.01416.46
7.4.120.0100.00816.50
7.4.110.0110.01116.50
7.4.100.0130.00316.65
7.4.90.0070.01116.65
7.4.80.0130.00419.39
7.4.70.0140.00716.42
7.4.60.0110.00716.35
7.4.50.0000.00916.66
7.4.40.0100.00722.77
7.4.30.0060.00916.51
7.4.00.0080.00814.70
7.3.330.0000.00713.39
7.3.320.0000.00513.32
7.3.310.0000.00716.48
7.3.300.0030.00316.43
7.3.290.0100.00316.45
7.3.280.0100.00616.37
7.3.270.0100.01017.40
7.3.260.0100.01018.24
7.3.250.0160.00516.55
7.3.240.0080.00816.40
7.3.230.0130.00316.41
7.3.210.0060.01116.38
7.3.200.0130.00919.39
7.3.190.0060.01216.40
7.3.180.0120.00316.45
7.3.170.0060.00916.54
7.3.160.0160.00016.36
7.3.120.0120.00315.14
7.3.10.0090.00616.59
7.3.00.0070.00716.60
7.2.330.0110.01116.68
7.2.320.0090.00916.70
7.2.310.0150.00416.56
7.2.300.0130.00916.49
7.2.290.0120.01216.56
7.2.130.0060.01016.80
7.2.120.0040.00916.92
7.2.110.0100.00016.93
7.2.100.0060.00616.91
7.2.90.0060.00616.83
7.2.80.0090.01016.58
7.2.70.0000.01416.88
7.2.60.0030.01116.85
7.2.50.0030.01216.55
7.2.40.0000.01416.59
7.2.30.0030.00717.07
7.2.20.0030.00717.13
7.2.10.0070.00317.08
7.2.00.0090.00316.98
7.1.250.0090.00615.79
7.1.200.0040.00715.82
7.1.70.0100.00317.06
7.1.60.0090.01619.17
7.1.50.0040.01217.04
7.1.00.0000.07722.42
7.0.200.0130.00016.77
7.0.140.0100.06721.99
7.0.100.0570.06319.95
7.0.90.0530.07720.04
7.0.80.0430.05719.98
7.0.70.0470.06719.98
7.0.60.0470.08319.89
7.0.50.0570.07320.36
7.0.40.0170.05020.13
7.0.30.0100.08320.18
7.0.20.0100.08320.18
7.0.10.0100.08020.14
7.0.00.0130.06720.14
5.6.280.0030.07321.11
5.6.250.0100.07020.64
5.6.240.0100.08020.64
5.6.230.0100.08020.60
5.6.220.0230.06720.53
5.6.210.0130.06720.56
5.6.200.0000.07721.03
5.6.190.0070.08021.13
5.6.180.0070.08321.06
5.6.170.0030.08320.98
5.6.160.0070.09021.15
5.6.150.0130.08021.08
5.6.140.0000.07021.08
5.6.130.0070.08021.18
5.6.120.0170.07321.11
5.6.110.0070.08721.05
5.6.100.0070.08321.07
5.6.90.0100.08020.95
5.6.80.0100.07320.52
5.6.70.0030.08020.43
5.6.60.0130.07020.50
5.6.50.0070.06720.43
5.6.40.0070.08020.40
5.6.30.0070.08320.34
5.6.20.0070.07720.51
5.6.10.0030.08720.48
5.6.00.0030.05320.32
5.5.380.0030.05720.34
5.5.370.0130.07320.54
5.5.360.0130.07020.34
5.5.350.0030.08720.43
5.5.340.0100.07720.95
5.5.330.0200.06020.89
5.5.320.0130.08020.86
5.5.310.0030.08320.93
5.5.300.0100.08020.90
5.5.290.0030.08720.89
5.5.280.0000.08320.85
5.5.270.0070.07720.81
5.5.260.0170.07320.79
5.5.250.0130.07320.74
5.5.240.0130.06720.24
5.5.230.0030.08320.23
5.5.220.0100.07020.28
5.5.210.0030.07720.23
5.5.200.0100.06320.20
5.5.190.0100.07720.21
5.5.180.0100.06720.17
5.5.160.0100.06720.16
5.5.150.0030.08020.24
5.5.140.0100.05020.14
5.5.130.0070.08020.25
5.5.120.0200.06720.27
5.5.110.0100.06320.26
5.5.100.0100.07320.09
5.5.90.0030.08020.09
5.5.80.0130.07320.19
5.5.70.0130.06720.10
5.5.60.0100.07020.11
5.5.50.0030.08020.11
5.5.40.0170.06320.07
5.5.30.0100.07320.16
5.5.20.0100.07720.07
5.5.10.0070.07720.04
5.5.00.0070.07719.99
5.4.450.0030.06719.18
5.4.440.0030.06019.36
5.4.430.0170.04019.49
5.4.420.0130.07319.44
5.4.410.0030.07719.17
5.4.400.0070.07019.04
5.4.390.0070.06319.05
5.4.380.0130.07018.90
5.4.370.0030.04719.04
5.4.360.0070.07319.19
5.4.350.0070.07719.04
5.4.340.0000.07019.05
5.4.320.0100.07019.23
5.4.310.0100.06019.14
5.4.300.0100.07719.12
5.4.290.0030.07719.13
5.4.280.0100.07319.15
5.4.270.0100.07719.13
5.4.260.0170.06719.18
5.4.250.0000.05018.98
5.4.240.0170.03719.20
5.4.230.0070.07319.23
5.4.220.0130.07319.06
5.4.210.0070.07719.09
5.4.200.0070.07018.94
5.4.190.0100.06719.03
5.4.180.0070.07719.20
5.4.170.0100.07719.03
5.4.160.0200.03719.01
5.4.150.0030.07719.12
5.4.140.0130.06716.33
5.4.130.0170.06016.38
5.4.120.0130.06316.50
5.4.110.0100.05016.39
5.4.100.0070.04716.48
5.4.90.0030.07316.54
5.4.80.0130.06316.36
5.4.70.0200.06016.39
5.4.60.0000.08016.41
5.4.50.0070.06016.42
5.4.40.0100.06316.46
5.4.30.0070.07016.36
5.4.20.0170.06316.33
5.4.10.0100.07716.36
5.4.00.0030.07315.88
5.3.290.0030.07314.69
5.3.280.0000.08314.66
5.3.270.0130.06714.64
5.3.260.0070.07714.62
5.3.250.0170.06714.75
5.3.240.0070.07014.59
5.3.230.0070.07014.67
5.3.220.0070.07014.58
5.3.210.0000.05314.66
5.3.200.0030.07014.67
5.3.190.0100.03314.53
5.3.180.0100.07714.55
5.3.170.0070.07314.55
5.3.160.0070.04314.54
5.3.150.0070.07714.68
5.3.140.0030.07314.66
5.3.130.0070.08314.50
5.3.120.0070.07714.58
5.3.110.0130.06714.58
5.3.100.0030.08314.08
5.3.90.0130.06713.97
5.3.80.0100.06014.12
5.3.70.0100.06713.94
5.3.60.0030.07313.96
5.3.50.0070.07014.01
5.3.40.0130.06713.96
5.3.30.0030.03713.93
5.3.20.0070.06713.68
5.3.10.0130.06313.65
5.3.00.0070.06713.73
5.2.170.0030.05711.00
5.2.160.0030.07711.07
5.2.150.0100.04711.24
5.2.140.0030.05711.13
5.2.130.0130.04311.16
5.2.120.0030.05711.16
5.2.110.0030.06310.98
5.2.100.0000.06711.23
5.2.90.0070.05711.13
5.2.80.0170.05711.01
5.2.70.0030.05711.21
5.2.60.0000.06311.16
5.2.50.0030.05311.14
5.2.40.0000.06010.88
5.2.30.0130.05311.07
5.2.20.0070.06011.03
5.2.10.0000.06310.88
5.2.00.0100.05310.79
5.1.60.0070.05310.55
5.1.50.0070.05710.55
5.1.40.0000.04710.55
5.1.30.0000.05710.55
5.1.20.0030.03010.55
5.1.10.0070.04310.55
5.1.00.0170.04310.55
5.0.50.0100.04310.55
5.0.40.0100.03010.55
5.0.30.0070.06010.55
5.0.20.0070.04010.55
5.0.10.0000.04710.55
5.0.00.0030.06010.55
4.4.90.0000.03710.55
4.4.80.0000.04010.55
4.4.70.0070.03310.55
4.4.60.0030.02710.55
4.4.50.0000.03310.55
4.4.40.0030.05310.55
4.4.30.0000.03710.55
4.4.20.0030.03310.55
4.4.10.0070.03310.55
4.4.00.0000.05710.55
4.3.110.0000.04010.55
4.3.100.0030.03310.55
4.3.90.0000.03710.55
4.3.80.0000.03710.55
4.3.70.0070.03310.55
4.3.60.0000.03710.55
4.3.50.0030.03010.55
4.3.40.0000.05010.55
4.3.30.0000.03710.55
4.3.20.0030.03310.55
4.3.10.0030.03310.55
4.3.00.0070.03010.55

preferences:
41.38 ms | 400 KiB | 5 Q