3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('session.serialize_handler', 'php_serialize'); class SerializableClass implements Serializable { public $sharedProp; public function __construct($prop) { $this->sharedProp = $prop; } public function __set($key, $value) { $this->$key = $value; } public function serialize() { return serialize(get_object_vars($this)); } public function unserialize($data) { $ar = unserialize($data); if ($ar === false) { return; } foreach ($ar as $k => $v) { $this->__set($k, $v); } } } // Shared object that acts as property of two another objects stored in session $testPropertyObj = new stdClass(); $testPropertyObj->name = 'test'; // Two instances of \SerializableClass that shares property $sessionObject = [ 'obj1' => new SerializableClass($testPropertyObj), 'obj2' => new SerializableClass($testPropertyObj), ]; session_start(); $_SESSION = $sessionObject; $sessionString = session_encode(); session_decode($sessionString); echo serialize($sessionObject) . "\n"; echo $sessionString . "\n"; echo "\n\n"; var_dump($_SESSION);

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.0100.01318.43
8.3.50.0070.00716.48
8.3.40.0110.00718.92
8.3.30.0070.01418.87
8.3.20.0070.00020.94
8.3.10.0070.00022.06
8.3.00.0040.00423.53
8.2.180.0190.00018.31
8.2.170.0040.01122.96
8.2.160.0060.00920.34
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0040.00421.04
8.2.110.0070.00420.35
8.2.100.0100.00317.98
8.2.90.0070.00317.84
8.2.80.0100.00019.66
8.2.70.0040.00417.50
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0040.00419.95
8.2.30.0060.00318.15
8.2.20.0000.00818.23
8.2.10.0040.00419.41
8.2.00.0080.00019.34
8.1.280.0070.00725.92
8.1.270.0040.00422.50
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0070.01021.96
8.1.230.0100.00319.03
8.1.220.0050.00317.79
8.1.210.0000.00918.77
8.1.200.0100.00017.47
8.1.190.0000.00917.35
8.1.180.0060.00318.10
8.1.170.0060.00320.34
8.1.160.0040.00418.86
8.1.150.0040.00420.83
8.1.140.0000.00720.81
8.1.130.0040.00420.10
8.1.120.0040.00417.50
8.1.110.0030.00617.49
8.1.100.0000.00817.54
8.1.90.0050.00317.47
8.1.80.0040.00417.52
8.1.70.0040.00417.49
8.1.60.0040.00417.61
8.1.50.0000.00717.45
8.1.40.0100.00017.64
8.1.30.0080.00017.66
8.1.20.0000.00917.71
8.1.10.0070.00017.61
8.1.00.0030.00517.42
8.0.300.0060.00319.82
8.0.290.0000.00917.00
8.0.280.0080.00018.57
8.0.270.0040.00418.08
8.0.260.0020.00520.11
8.0.250.0050.00217.08
8.0.240.0050.00317.01
8.0.230.0000.00717.03
8.0.220.0000.00817.00
8.0.210.0030.00316.94
8.0.200.0070.00017.04
8.0.190.0040.00417.14
8.0.180.0030.00516.93
8.0.170.0030.00617.09
8.0.160.0000.00816.87
8.0.150.0080.00016.94
8.0.140.0040.00416.83
8.0.130.0000.00513.38
8.0.120.0050.00316.83
8.0.110.0050.00317.06
8.0.100.0000.00716.80
8.0.90.0060.00316.86
8.0.80.0080.00916.98
8.0.70.0040.00417.05
8.0.60.0080.00016.92
8.0.50.0000.00817.04
8.0.30.0140.00317.34
8.0.20.0110.00817.28
8.0.10.0000.00817.04
8.0.00.0170.00716.90
7.4.330.0050.00016.71
7.4.320.0030.00316.65
7.4.300.0030.00316.68
7.4.290.0050.00516.65
7.4.280.0100.00016.58
7.4.270.0040.00416.47
7.4.260.0060.00013.32
7.4.250.0050.00316.54
7.4.240.0020.00516.68
7.4.230.0040.00416.62
7.4.220.0020.00516.62
7.4.210.0110.00816.60
7.4.200.0040.00416.51
7.4.130.0100.01016.67
7.4.120.0230.00416.65
7.4.110.0120.00516.59
7.4.100.0090.01516.60
7.4.90.0110.01116.51
7.4.80.0090.01318.06
7.4.70.0130.00616.58
7.4.60.0080.01116.45
7.4.50.0070.01016.43
7.4.40.0130.00716.66
7.4.30.0030.01516.39
7.4.20.0040.01616.29
7.4.10.0100.00715.79
7.4.00.0150.00515.67
7.3.330.0030.00316.41
7.3.320.0060.00013.40
7.3.310.0030.00316.28
7.3.300.0050.00316.38
7.3.290.0070.00916.39
7.3.260.0130.00316.44
7.3.230.0090.01216.66
7.3.220.0110.00716.45
7.3.210.0150.00816.45
7.3.200.0060.01316.41
7.3.190.0130.00416.49
7.3.180.0100.00816.62
7.3.170.0100.01016.54
7.3.160.0090.01316.51
7.3.150.0090.00916.55
7.3.140.0110.01216.34
7.3.130.0090.00915.85
7.3.120.0090.01115.65
7.3.110.0110.00715.77
7.3.100.0140.00615.72
7.3.90.0120.00515.71
7.3.80.0150.00215.70
7.3.70.0030.01315.63
7.3.60.0110.00815.69
7.3.50.0130.00515.61
7.3.40.0050.01315.62
7.3.30.0090.01015.60
7.3.20.0120.00615.61
7.3.10.0130.00615.56
7.3.00.0140.00615.77
7.2.340.0190.00316.64
7.2.330.0130.00816.67
7.2.320.0070.01216.68
7.2.310.0070.01116.84
7.2.300.0130.00816.66
7.2.290.0120.00616.72
7.2.280.0110.00816.88
7.2.270.0130.00716.61
7.2.260.0050.01416.00
7.2.250.0100.00915.92
7.2.240.0100.01016.00
7.2.230.0110.00916.08
7.2.220.0030.01415.91
7.2.210.0140.00315.87
7.2.200.0090.00915.81
7.2.190.0060.01415.87
7.2.180.0140.00916.03
7.2.170.0080.01315.89
7.2.160.0110.00615.88
7.2.150.0140.00515.82
7.2.140.0080.01315.93
7.2.130.0120.01015.90
7.2.120.0080.01115.83
7.2.110.0050.01415.89
7.2.100.0060.01415.96
7.2.90.0060.01315.92
7.2.80.0130.00815.91
7.2.70.0080.01115.99
7.2.60.0120.00815.82
7.2.50.0100.00915.83
7.2.40.0110.00715.83
7.2.30.0080.01115.83
7.2.20.0120.00615.87
7.2.10.0130.00615.89
7.2.00.0100.01415.82

preferences:
68.66 ms | 401 KiB | 5 Q