3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Widget implements Serializable { public $references = array(); public $config; public function serialize() { $vars = get_object_vars($this); $vars['config'] = serialize($vars['config']); $serialized = serialize($vars); return $serialized; } public function unserialize($serialized) { $array = unserialize($serialized); $array['config'] = unserialize($array['config']); foreach($array as $k => $v) { $this->$k = $v; } } } class Placeholder { public $id; public function __construct($id) { $this->id = $id; } } $collection = array(); $placeholder1 = new Placeholder(1); $placeholder2 = new Placeholder(2); $widget1 = new Widget; $widget1->config = array('id_section' => 9); $widget1->references[] = $placeholder1; $widget2 = new Widget; $widget2->config = array('id_section' => 9); $widget2->references[] = $placeholder2; $widget3 = new Widget; $widget3->config = array('id_section' => 9); $widget3->references[] = $placeholder1; $widget4 = new Widget; $widget4->config = array('id_section' => 9); $widget4->references[] = $placeholder1; $collection[] = $widget1; $collection[] = $widget2; $collection[] = $widget3; // reference to placeholder will be missing here $collection[] = $widget4; // reference to placeholder will be missing here print_r(unserialize(serialize($collection)));

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.0140.00416.75
8.3.50.0130.00517.55
8.3.40.0100.01318.96
8.3.30.0110.00318.97
8.3.20.0040.00418.70
8.3.10.0030.00720.66
8.3.00.0040.00419.51
8.2.180.0170.00316.88
8.2.170.0130.00722.96
8.2.160.0060.00918.95
8.2.150.0060.00324.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0090.00018.89
8.2.110.0030.00620.57
8.2.100.0090.00318.04
8.2.90.0110.00018.18
8.2.80.0000.00819.26
8.2.70.0040.00417.63
8.2.60.0080.00018.05
8.2.50.0060.00318.07
8.2.40.0060.00318.34
8.2.30.0040.00418.16
8.2.20.0050.00319.38
8.2.10.0000.00717.76
8.2.00.0040.00417.82
8.1.280.0150.00325.92
8.1.270.0050.00323.99
8.1.260.0000.00926.35
8.1.250.0040.00428.09
8.1.240.0060.00322.19
8.1.230.0080.00320.97
8.1.220.0050.00317.76
8.1.210.0030.00619.04
8.1.200.0040.00417.35
8.1.190.0060.00317.52
8.1.180.0060.00318.10
8.1.170.0040.00418.85
8.1.160.0000.00818.95
8.1.150.0000.00718.66
8.1.140.0040.00417.53
8.1.130.0030.00317.86
8.1.120.0050.00217.55
8.1.110.0040.00417.48
8.1.100.0000.00917.47
8.1.90.0040.00417.51
8.1.80.0030.00517.44
8.1.70.0080.00017.43
8.1.60.0040.00417.65
8.1.50.0050.00217.46
8.1.40.0030.00617.48
8.1.30.0000.00817.53
8.1.20.0030.00517.61
8.1.10.0030.00617.60
8.1.00.0000.00817.58
8.0.300.0040.00420.13
8.0.290.0000.00716.75
8.0.280.0030.00318.43
8.0.270.0000.00817.20
8.0.260.0030.00316.93
8.0.250.0000.00717.12
8.0.240.0000.00717.03
8.0.230.0050.00217.09
8.0.220.0070.00016.91
8.0.210.0000.00716.87
8.0.200.0080.00016.91
8.0.190.0000.00917.00
8.0.180.0040.00417.00
8.0.170.0000.00816.98
8.0.160.0040.00316.95
8.0.150.0090.00017.05
8.0.140.0070.00316.91
8.0.130.0050.00013.46
8.0.120.0040.00416.88
8.0.110.0050.00516.86
8.0.100.0000.00716.81
8.0.90.0030.00316.82
8.0.80.0090.00616.95
8.0.70.0050.00316.82
8.0.60.0050.00217.04
8.0.50.0040.00416.85
8.0.30.0120.00617.15
8.0.20.0160.01216.96
8.0.10.0000.00717.17
8.0.00.0090.00917.04
7.4.330.0000.00513.04
7.4.320.0000.00716.64
7.4.300.0030.00316.63
7.4.290.0000.00716.64
7.4.280.0030.00416.66
7.4.270.0030.00316.53
7.4.260.0060.00013.23
7.4.250.0080.00016.45
7.4.240.0040.00416.45
7.4.230.0070.00016.38
7.4.220.0150.00716.54
7.4.210.0110.00416.55
7.4.200.0050.00216.44
7.4.190.0000.00716.77
7.4.160.0130.00316.83
7.4.150.0120.00616.61
7.4.140.0100.00716.34
7.4.130.0110.00616.72
7.4.120.0070.01016.53
7.4.110.0090.00916.51
7.4.100.0060.01216.51
7.4.90.0120.00616.66
7.4.80.0140.01116.63
7.4.70.0120.00416.75
7.4.60.0070.01016.64
7.4.50.0060.00016.63
7.4.40.0070.01116.45
7.4.30.0130.00316.39
7.4.00.0030.00914.95
7.3.330.0000.00613.35
7.3.320.0030.00313.28
7.3.310.0000.00716.37
7.3.300.0070.00016.39
7.3.290.0060.00816.43
7.3.280.0120.00516.39
7.3.270.0110.01216.50
7.3.260.0070.01116.60
7.3.250.0130.00716.42
7.3.240.0060.01316.46
7.3.230.0090.01216.65
7.3.210.0090.00916.70
7.3.200.0070.01019.39
7.3.190.0050.01716.38
7.3.180.0090.00616.54
7.3.170.0100.01116.44
7.3.160.0030.01316.60
7.3.120.0040.01115.09
7.3.10.0350.01016.58
7.3.00.0190.00616.31
7.2.330.0090.01316.72
7.2.320.0100.00716.93
7.2.310.0130.00516.44
7.2.300.0090.01016.49
7.2.290.0040.01316.66
7.2.130.0170.00616.83
7.2.120.0090.01316.87
7.2.110.0170.00416.31
7.2.100.0200.00716.54
7.2.90.0240.00616.70
7.2.80.0070.01016.82
7.2.70.0040.01517.06
7.2.60.0050.01216.83
7.2.50.0090.01516.79
7.2.40.0130.00716.91
7.2.30.0100.00616.87
7.2.20.0120.00616.62
7.2.10.0140.00716.95
7.2.00.0110.00518.25
7.1.250.0270.00315.63
7.1.200.0050.00815.73
7.1.70.0000.01017.22
7.1.60.0180.00719.17
7.1.50.0100.01316.95
7.1.00.0030.07022.28
7.0.200.0090.00916.59
7.0.140.0070.06722.08
7.0.120.0000.07722.00
7.0.60.0030.09020.00
7.0.50.0100.08717.99
7.0.40.0000.05320.27
7.0.30.0270.04020.25
7.0.20.0200.04720.12
7.0.10.0200.04320.23
7.0.00.0030.04720.33
5.6.280.0000.07720.93
5.6.210.0170.07320.75
5.6.200.0070.08718.14
5.6.190.0030.09320.48
5.6.180.0270.05720.58
5.6.170.0430.06720.55
5.6.160.0070.04020.71
5.6.150.0030.08718.14
5.6.140.0070.04318.28
5.6.130.0070.08718.15
5.6.120.0070.05020.92
5.6.110.0130.07721.11
5.6.100.0100.08020.90
5.6.90.0100.08020.97
5.6.80.0070.08320.41
5.6.70.0230.05020.55
5.5.350.0330.06320.38
5.5.340.0070.04718.08
5.5.330.0070.08020.13
5.5.320.0170.08020.19
5.5.310.0230.04020.27
5.5.300.0070.06017.97
5.5.290.0100.03318.08
5.5.280.0100.07720.90
5.5.270.0070.04720.76
5.5.260.0100.08320.96
5.5.250.0100.07720.74
5.5.240.0030.04320.19
5.4.450.0030.07319.35
5.4.440.0130.06719.57
5.4.430.0030.06719.44
5.4.420.0130.07019.47
5.4.410.0100.08019.34
5.4.400.0100.06019.15
5.4.390.0070.03719.17
5.4.380.0170.07018.87
5.4.370.0100.07318.85
5.4.360.0030.05319.14
5.4.350.0100.07319.25
5.4.340.0030.04319.00
5.4.320.0100.08018.92
5.4.310.0100.06319.12
5.4.300.0100.08319.14
5.4.290.0130.06719.25
5.4.280.0130.07318.94
5.4.270.0030.07019.11
5.4.260.0070.04019.11
5.4.250.0130.04019.14
5.4.240.0100.07718.84
5.4.230.0070.08318.97
5.4.220.0070.05719.14
5.4.210.0030.05718.91
5.4.200.0030.08319.00
5.4.190.0170.05318.84
5.4.180.0070.05719.13
5.4.170.0030.06319.19
5.4.160.0130.07319.13
5.4.150.0030.07319.12
5.4.140.0100.07316.36
5.4.130.0230.05316.30
5.4.120.0000.06716.34
5.4.110.0030.04716.72
5.4.100.0130.07016.61
5.4.90.0000.05716.50
5.4.80.0100.07316.45
5.4.70.0030.07716.33
5.4.60.0030.08016.47
5.4.50.0100.05316.31
5.4.40.0030.04716.28
5.4.30.0030.07316.37
5.4.20.0030.06316.27
5.4.10.0070.07316.40
5.4.00.0030.06015.84
5.3.290.0130.07014.76
5.3.280.0130.05314.55
5.3.270.0130.07014.69
5.3.260.0170.07014.70
5.3.250.0130.07314.69
5.3.240.0070.06314.64
5.3.230.0070.05714.67
5.3.220.0100.03314.65
5.3.210.0030.08014.61
5.3.200.0030.07014.62
5.3.190.0070.06314.50
5.3.180.0070.04714.60
5.3.170.0000.06014.66
5.3.160.0030.07314.63
5.3.150.0100.06014.67
5.3.140.0000.05014.61
5.3.130.0170.05014.59
5.3.120.0100.06314.58
5.3.110.0000.04314.63
5.3.100.0100.07714.11
5.3.90.0000.08314.20
5.3.80.0030.03714.08
5.3.70.0030.03713.94
5.3.60.0070.05314.09
5.3.50.0030.05314.00
5.3.40.0130.07013.95
5.3.30.0030.03713.90
5.3.20.0000.04713.78
5.3.10.0030.03713.74
5.3.00.0070.04013.84
5.2.170.0000.03711.35
5.2.160.0100.05711.22
5.2.150.0100.03311.15
5.2.140.0000.03311.14
5.2.130.0030.03011.30
5.2.120.0030.03011.29
5.2.110.0030.05311.09
5.2.100.0170.04711.14
5.2.90.0070.05011.09
5.2.80.0030.06711.10
5.2.70.0070.05311.30
5.2.60.0000.06711.03
5.2.50.0000.05011.02
5.2.40.0030.06010.99
5.2.30.0030.04711.17
5.2.20.0030.03010.96
5.2.10.0100.04710.79
5.2.00.0030.06310.77
5.1.60.0070.05710.04
5.1.50.0100.04710.06
5.1.40.0030.0409.97
5.1.30.0000.04710.38
5.1.20.0000.03710.39
5.1.10.0030.05710.11
5.1.00.0000.04310.09
5.0.50.0030.0338.64
5.0.40.0030.0278.50
5.0.30.0030.0578.15
5.0.20.0130.0338.20
5.0.10.0070.0238.15
5.0.00.0070.0638.33
4.4.90.0000.0308.07
4.4.80.0070.0238.07
4.4.70.0070.0208.07
4.4.60.0030.0308.07
4.4.50.0000.0208.07
4.4.40.0000.0408.07
4.4.30.0000.0338.07
4.4.20.0030.0378.07
4.4.10.0070.0138.07
4.4.00.0070.0338.07
4.3.110.0030.0178.07
4.3.100.0000.0338.07
4.3.90.0000.0278.07
4.3.80.0070.0508.07
4.3.70.0000.0208.07
4.3.60.0030.0138.07
4.3.50.0070.0308.07
4.3.40.0070.0478.07
4.3.30.0000.0208.07
4.3.20.0030.0338.07
4.3.10.0070.0308.07
4.3.00.0000.0378.07

preferences:
46.12 ms | 400 KiB | 5 Q