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 = array(); $targetProperties = array(); $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.70.0070.01416.75
8.3.60.0130.00618.30
8.3.50.0230.00521.21
8.3.40.0090.00618.76
8.3.30.0090.00520.09
8.3.20.0080.00020.46
8.3.10.0000.00721.11
8.3.00.0040.00423.66
8.2.180.0040.01116.88
8.2.170.0070.00722.96
8.2.160.0080.00820.38
8.2.150.0080.00024.18
8.2.140.0070.00324.66
8.2.130.0040.00426.16
8.2.120.0050.00320.93
8.2.110.0090.00019.45
8.2.100.0040.00817.97
8.2.90.0030.00519.15
8.2.80.0040.00418.05
8.2.70.0070.00717.50
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0090.00017.92
8.2.30.0070.00019.37
8.2.20.0040.00417.68
8.2.10.0040.00417.82
8.2.00.0040.00717.65
8.1.280.0120.00925.92
8.1.270.0000.00823.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00720.68
8.1.230.0040.00821.03
8.1.220.0050.00318.77
8.1.210.0030.00518.97
8.1.200.0000.00817.35
8.1.190.0000.00817.54
8.1.180.0000.00818.10
8.1.170.0030.00518.71
8.1.160.0030.00518.91
8.1.150.0040.00418.62
8.1.140.0040.00417.39
8.1.130.0030.00517.88
8.1.120.0000.00717.39
8.1.110.0040.00417.45
8.1.100.0070.00017.50
8.1.90.0040.00417.48
8.1.80.0040.00417.43
8.1.70.0000.00717.45
8.1.60.0040.00417.57
8.1.50.0040.00417.50
8.1.40.0030.00517.60
8.1.30.0030.00517.59
8.1.20.0030.00617.68
8.1.10.0000.00917.43
8.1.00.0040.00417.45
8.0.300.0040.00419.97
8.0.290.0050.00217.15
8.0.280.0000.00718.35
8.0.270.0000.00717.31
8.0.260.0070.00016.80
8.0.250.0040.00416.93
8.0.240.0030.00317.00
8.0.230.0030.00316.99
8.0.220.0000.00716.91
8.0.210.0000.00716.87
8.0.200.0000.00716.96
8.0.190.0000.00816.95
8.0.180.0050.00317.00
8.0.170.0000.00716.90
8.0.160.0070.00016.95
8.0.150.0030.00316.74
8.0.140.0000.00716.83
8.0.130.0000.00513.27
8.0.120.0060.00316.85
8.0.110.0000.00816.87
8.0.100.0040.00416.74
8.0.90.0080.00016.96
8.0.80.0070.01016.95
8.0.70.0040.00416.79
8.0.60.0000.00716.92
8.0.50.0030.00516.80
8.0.30.0050.01317.05
8.0.20.0150.01217.40
8.0.10.0000.00717.07
8.0.00.0120.00616.83
7.4.330.0060.00015.12
7.4.320.0030.00316.61
7.4.300.0050.00216.62
7.4.290.0000.00616.47
7.4.280.0030.00716.46
7.4.270.0000.00716.63
7.4.260.0030.00313.23
7.4.250.0000.00716.49
7.4.240.0030.00316.62
7.4.230.0000.00716.52
7.4.220.0110.01516.53
7.4.210.0090.00716.56
7.4.200.0030.00516.43
7.4.190.0030.00316.49
7.4.160.0060.00916.59
7.4.150.0040.01417.40
7.4.140.0090.00817.86
7.4.130.0070.01216.49
7.4.120.0080.01016.56
7.4.110.0140.00616.82
7.4.100.0120.00616.58
7.4.90.0120.00816.72
7.4.80.0170.00019.39
7.4.70.0100.01016.41
7.4.60.0000.01716.48
7.4.50.0050.00016.43
7.4.40.0000.01722.77
7.4.30.0090.00916.50
7.4.00.0070.01014.76
7.3.330.0050.00013.41
7.3.320.0030.00313.31
7.3.310.0030.00516.29
7.3.300.0030.00316.27
7.3.290.0110.00816.35
7.3.280.0100.00816.38
7.3.270.0090.00917.40
7.3.260.0130.01118.24
7.3.250.0090.00816.65
7.3.240.0140.00316.33
7.3.230.0110.00516.66
7.3.210.0100.00716.48
7.3.200.0110.01119.39
7.3.190.0110.01116.55
7.3.180.0100.00616.61
7.3.170.0070.01116.28
7.3.160.0070.01416.52
7.3.120.0080.00814.66
7.3.110.0030.01214.47
7.3.100.0140.00314.62
7.3.90.0080.00015.12
7.3.80.0090.00315.00
7.3.70.0100.00714.89
7.3.60.0000.01114.84
7.3.50.0070.01014.70
7.3.40.0100.00014.95
7.3.30.0060.00314.85
7.3.20.0060.00616.73
7.3.10.0110.00416.70
7.3.00.0140.00416.52
7.2.330.0090.01216.61
7.2.320.0090.01216.66
7.2.310.0150.00316.60
7.2.300.0100.01316.52
7.2.290.0060.01216.62
7.2.240.0040.00715.41
7.2.230.0070.00715.23
7.2.220.0080.00514.98
7.2.210.0070.00714.97
7.2.200.0030.01314.91
7.2.190.0140.00015.21
7.2.180.0070.01114.87
7.2.170.0000.01415.03
7.2.160.0070.00715.13
7.2.150.0090.00617.00
7.2.140.0030.00917.18
7.2.130.0090.00516.83
7.2.120.0050.00816.91
7.2.110.0050.00916.90
7.2.100.0090.00416.83
7.2.90.0080.00616.81
7.2.80.0040.01016.90
7.2.70.0090.01116.78
7.2.60.0050.00816.81
7.2.50.0120.00716.79
7.2.40.0050.01316.91
7.2.30.0070.00916.88
7.2.20.0090.00616.79
7.2.10.0080.00816.89
7.2.00.0060.00717.49
7.1.330.0000.01615.80
7.1.320.0090.00915.48
7.1.310.0100.00016.10
7.1.300.0000.01015.87
7.1.290.0060.01015.79
7.1.280.0100.00715.84
7.1.270.0040.01115.60
7.1.260.0030.01015.84
7.1.250.0070.00815.56
7.1.100.0000.01418.07
7.1.70.0110.00317.25
7.1.60.0100.01419.17
7.1.50.0090.00616.77
7.1.00.0000.03722.57
7.0.200.0030.00516.85
7.0.140.0100.06722.08
7.0.60.0230.06320.02
7.0.50.0070.08317.92
7.0.40.0100.06720.11
7.0.30.0230.05720.16
7.0.20.0430.07020.05
7.0.10.0000.05020.06
7.0.00.0130.05320.32
5.6.280.0130.06321.05
5.6.210.0030.05320.56
5.6.200.0100.08018.19
5.6.190.0030.05320.33
5.6.180.0400.03320.68
5.6.170.0270.06320.54
5.6.160.0100.07720.61
5.6.150.0070.06718.17
5.6.140.0030.04318.21
5.6.130.0030.04718.24
5.6.120.0030.04721.04
5.6.110.0130.07321.02
5.6.100.0000.04321.03
5.6.90.0100.07321.14
5.6.80.0000.04320.41
5.5.350.0130.08720.48
5.5.340.0070.08017.96
5.5.330.0130.06320.40
5.5.320.0230.04020.32
5.5.310.0170.04020.24
5.5.300.0130.07717.96
5.5.290.0070.08717.93
5.5.280.0100.08020.78
5.5.270.0030.09020.89
5.5.260.0030.06320.66
5.5.250.0100.08320.63
5.5.240.0200.07020.28
5.4.450.4230.04019.57
5.4.440.3830.04019.49
5.4.430.3830.04019.45
5.4.420.3370.03719.54
5.4.410.3470.03319.32
5.4.400.4100.03019.07
5.4.390.3430.04019.23
5.4.380.3800.04019.06
5.4.370.3670.03719.15
5.4.360.3870.03318.96
5.4.350.4500.04719.13
5.4.340.4670.03719.13
5.4.320.4030.04019.05
5.4.310.3600.03718.94
5.4.300.4600.03318.96
5.4.290.3500.04019.22
5.4.280.3400.04319.23
5.4.270.3470.04019.19
5.4.260.4530.03318.96
5.4.250.4570.04319.04
5.4.240.3900.03719.14
5.4.230.4170.04318.93
5.4.220.4470.03318.94
5.4.210.4570.04019.26
5.4.200.3970.02719.14
5.4.190.3930.04019.26
5.4.180.3670.03019.04
5.4.170.3670.03719.21
5.4.160.4300.03718.95
5.4.150.4200.04019.08
5.4.140.4300.03316.41
5.4.130.3570.03316.48
5.4.120.3600.03316.42
5.4.110.4570.04316.52
5.4.100.4130.04016.53
5.4.90.3900.03316.45
5.4.80.3330.03316.48
5.4.70.5370.04016.53
5.4.60.4700.03016.43
5.4.50.3930.03316.55
5.4.40.3500.03316.50
5.4.30.0170.03316.49
5.4.20.2230.04716.49
5.4.10.3600.03316.66
5.4.00.3870.03315.83
5.3.290.3870.04314.74
5.3.280.4300.03714.50
5.3.270.3670.04014.64
5.3.260.3770.04014.63
5.3.250.4570.04014.79
5.3.240.3830.03314.64
5.3.230.3930.05014.77
5.3.220.4470.03314.75
5.3.210.4100.03314.60
5.3.200.3830.04314.63
5.3.190.4100.05014.66
5.3.180.4070.02714.62
5.3.170.3870.04014.60
5.3.160.4170.03014.59
5.3.150.4130.03714.61
5.3.140.4000.03714.58
5.3.130.0100.05714.63
5.3.120.0070.05314.60
5.3.110.4000.03714.57
5.3.100.3800.03714.04
5.3.90.3930.02714.21
5.3.80.3970.04014.00
5.3.70.3530.04014.09
5.3.60.3970.03714.07
5.3.50.3800.03714.01
5.3.40.3730.04013.95
5.3.30.2970.03713.89
5.3.20.2930.04313.75
5.3.10.3830.03313.68
5.3.00.4130.04313.66
5.2.170.3230.03011.16
5.2.160.3030.02711.16
5.2.150.3200.02711.16
5.2.140.2430.03011.17
5.2.130.2770.02311.01
5.2.120.2670.02711.16
5.2.110.3370.02311.28
5.2.100.0030.06011.12
5.2.90.0030.04011.20
5.2.80.0030.05711.20
5.2.70.0030.06311.19
5.2.60.2530.02310.95
5.2.50.3200.01711.04
5.2.40.2370.02711.02
5.2.30.2500.02710.94
5.2.20.2300.03010.97
5.2.10.2400.03011.02
5.2.00.2230.02310.63
5.1.60.2430.0209.93
5.1.50.2600.02710.02
5.1.40.2470.0239.91
5.1.30.2730.02710.39
5.1.20.2570.02310.33
5.1.10.2830.0309.99
5.1.00.1600.03010.14
5.0.50.1430.0238.63
5.0.40.1000.0178.35
5.0.30.1570.0308.27
5.0.20.1730.0208.27
5.0.10.1600.0208.34
5.0.00.1630.0308.24
4.4.90.0670.0206.39
4.4.80.1230.0176.39
4.4.70.1500.0136.39
4.4.60.1170.0176.39
4.4.50.1330.0136.39
4.4.40.1230.0236.39
4.4.30.1170.0176.39
4.4.20.1470.0176.39
4.4.10.1330.0176.39
4.4.00.1470.0236.39
4.3.110.1200.0176.39
4.3.100.1370.0136.39
4.3.90.2000.0106.39
4.3.80.1830.0236.39
4.3.70.1730.0176.39
4.3.60.1530.0106.39
4.3.50.1330.0136.39
4.3.40.1170.0236.39
4.3.30.0600.0176.39
4.3.20.0530.0236.39
4.3.10.0970.0206.39
4.3.00.0970.0176.39

preferences:
106.3 ms | 401 KiB | 5 Q