3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = (object)array( 1 => 'value of 1', 'x' => 'value of x', ); function get_real_object_vars($obj) { if (version_compare(PHP_VERSION, '5.0.0') >= 0) { class StdclassIterator implements Iterator { private $subject; public function __construct($object) { $this->subject = $object; } public function current() { return current($this->subject); } public function next() { next($this->subject); } public function key() { return key($this->subject); } public function valid() { $key = key($this->subject); return NULL !== key($this->subject); } public function rewind() { reset($this->subject); } } return iterator_to_array(new StdclassIterator($obj)); } else { return get_object_vars($obj); } } var_dump($obj, get_real_object_vars($obj));

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.0090.00916.61
8.3.50.0080.01018.35
8.3.40.0210.00018.54
8.3.30.0120.00318.54
8.3.20.0040.00418.60
8.3.10.0050.00320.39
8.3.00.0040.00419.30
8.2.180.0110.00716.88
8.2.170.0130.00922.96
8.2.160.0070.00722.08
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0030.00619.59
8.2.110.0030.00620.22
8.2.100.0110.00017.84
8.2.90.0050.00319.26
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0060.00317.93
8.2.50.0040.00418.07
8.2.40.0080.00018.09
8.2.30.0060.00318.14
8.2.20.0000.00817.74
8.2.10.0030.00517.86
8.2.00.0030.00717.76
8.1.280.0070.00725.92
8.1.270.0000.00824.66
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0040.00422.20
8.1.230.0040.00717.45
8.1.220.0070.00317.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0040.00417.54
8.1.180.0050.00318.10
8.1.170.0000.00818.75
8.1.160.0040.00418.91
8.1.150.0080.00018.75
8.1.140.0040.00417.47
8.1.130.0070.00017.76
8.1.120.0040.00417.53
8.1.110.0000.00817.42
8.1.100.0030.00617.44
8.1.90.0000.00717.37
8.1.80.0050.00217.38
8.1.70.0000.00717.47
8.1.60.0000.00717.64
8.1.50.0070.00017.48
8.1.40.0060.00317.54
8.1.30.0000.00817.71
8.1.20.0000.00917.64
8.1.10.0040.00417.57
8.1.00.0040.00417.57
8.0.300.0060.00318.77
8.0.290.0000.00916.88
8.0.280.0030.00318.34
8.0.270.0000.00717.19
8.0.260.0040.00416.90
8.0.250.0070.00017.04
8.0.240.0070.00317.03
8.0.230.0000.00716.89
8.0.220.0040.00416.85
8.0.210.0030.00316.97
8.0.200.0030.00317.04
8.0.190.0000.00716.95
8.0.180.0000.00716.99
8.0.170.0060.00316.96
8.0.160.0000.00716.93
8.0.150.0070.00316.90
8.0.140.0050.00316.82
8.0.130.0000.00513.39
8.0.120.0000.00816.93
8.0.110.0000.00717.04
8.0.100.0040.00417.01
8.0.90.0000.00816.93
8.0.80.0060.00916.98
8.0.70.0070.00016.80
8.0.60.0070.00016.99
8.0.50.0040.00416.79
8.0.30.0100.01017.08
8.0.20.0120.00717.16
8.0.10.0000.00716.92
8.0.00.0100.01216.86
7.4.330.0030.00312.96
7.4.320.0030.00316.67
7.4.300.0000.00716.54
7.4.290.0000.00716.60
7.4.280.0030.00716.63
7.4.270.0000.00816.54
7.4.260.0000.00513.25
7.4.250.0060.00316.55
7.4.240.0000.00716.57
7.4.230.0000.00816.42
7.4.220.0070.01316.55
7.4.210.0130.00616.60
7.4.200.0000.00816.71
7.4.190.0000.00716.68
7.4.160.0090.00616.64
7.4.150.0060.01216.53
7.4.140.0120.00916.59
7.4.130.0110.00716.51
7.4.120.0150.00616.50
7.4.110.0070.01016.59
7.4.100.0080.00816.61
7.4.90.0130.00416.52
7.4.80.0060.01016.51
7.4.70.0100.00716.41
7.4.60.0150.00616.50
7.4.50.0030.00616.48
7.4.40.0060.00616.27
7.4.30.0080.00816.26
7.3.330.0040.00413.38
7.3.320.0030.00313.16
7.3.310.0030.00316.48
7.3.300.0070.00016.38
7.3.290.0000.01416.40
7.3.280.0120.00416.37
7.3.270.0080.00816.43
7.3.260.0060.01116.45
7.3.250.0070.01116.60
7.3.240.0080.01116.60
7.3.230.0150.00916.35
7.3.210.0140.00516.40
7.3.200.0030.01519.39
7.3.190.0110.01116.39
7.3.180.0090.00616.62
7.3.170.0100.00616.54
7.3.160.0090.00616.59
7.2.330.0080.01116.39
7.2.320.0060.01216.73
7.2.310.0050.01916.61
7.2.300.0120.00616.83
7.2.290.0090.00916.38
5.4.450.0070.08319.41
5.4.440.0170.06719.29
5.4.430.0030.05719.58
5.4.420.0170.08019.17
5.4.410.0100.07319.20
5.4.400.0070.07718.86
5.4.390.0070.05019.12
5.4.380.0030.07719.14
5.4.370.0030.06019.02
5.4.360.0170.05018.94
5.4.350.0030.05019.26
5.4.340.0170.06719.24
5.4.320.0030.07318.98
5.4.310.0100.06319.14
5.4.300.0030.05019.14
5.4.290.0100.06719.14
5.4.280.0030.05019.24
5.4.270.0070.07018.98
5.4.260.0070.05019.07
5.4.250.0100.03319.23
5.4.240.0200.06018.91
5.4.230.0030.04719.20
5.4.220.0030.04319.13
5.4.210.0170.05319.25
5.4.200.0130.03019.24
5.4.190.0170.07019.07
5.4.180.0100.04718.91
5.4.170.0070.06719.20
5.4.160.0030.05718.95
5.4.150.0100.04719.23
5.4.140.0030.06016.32
5.4.130.0070.04316.45
5.4.120.0230.05316.40
5.4.110.0100.07016.35
5.4.100.0100.06716.39
5.4.90.0100.04716.44
5.4.80.0100.06716.53
5.4.70.0070.06016.46
5.4.60.0000.07716.37
5.4.50.0070.07316.26
5.4.40.0070.06016.64
5.4.30.0130.06016.46
5.4.20.0030.05016.36
5.4.10.0030.07716.42
5.4.00.0100.07015.90
5.3.290.0030.06014.73
5.3.280.0030.04714.61
5.3.270.0170.04714.65
5.3.260.0370.01714.64
5.3.250.0000.06314.78
5.3.240.0030.04014.78
5.3.230.0070.05314.64
5.3.220.0130.07014.50
5.3.210.0030.08014.74
5.3.200.0130.06714.59
5.3.190.0070.07714.59
5.3.180.0070.07314.74
5.3.170.0100.05014.62
5.3.160.0170.04314.73
5.3.150.0030.08014.58
5.3.140.0100.06714.57
5.3.130.0030.08314.57
5.3.120.0100.07314.64
5.3.110.0030.05014.62
5.3.100.0030.07714.06
5.3.90.0100.06713.93
5.3.80.0030.05014.09
5.3.70.0130.03014.08
5.3.60.0100.07314.07
5.3.50.0030.07013.92
5.3.40.0030.04714.03
5.3.30.0100.04714.10
5.3.20.0030.04013.88
5.3.10.0100.07013.70
5.3.00.0030.05013.81

preferences:
38.78 ms | 401 KiB | 5 Q