3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait SerializationHelper { /** * @deprecated Use serializeToArray * * @return string */ public function serialize() { return serialize($this->serializeToArray()); } /** * @deprecated Use unserializeFromArray * * @param string $str * * @return void */ public function unserialize($str) { $this->unserializeFromArray(unserialize($str)); } public function __serialize(): array { return [$this->serialize()]; } public function __unserialize(array $data): void { $this->unserialize($data[0]); } } class ClassMetadata implements \Serializable { use SerializationHelper; /** * @var array */ private $indexMetadatas = []; public function addIndexMetadata($contextName, IndexMetadata $indexMetadata) { $indexMetadata->setClassMetadata($this); $this->indexMetadatas[$contextName] = $indexMetadata; } public function serializeToArray(): array { return [$this->indexMetadatas,]; } public function unserializeFromArray(array $data): void { list($indexMetadata) = $data; $this->indexMetadatas = $indexMetadata; } } class IndexMetadata { /** * @var ClassMetadata */ private $classMetadata; public function getClassMetadata() { return $this->classMetadata; } public function setClassMetadata(ClassMetadata $classMetadata) { $this->classMetadata = $classMetadata; } } $classMetadata = new ClassMetadata(); $indexMetadata = new IndexMetadata(); $classMetadata->addIndexMetadata('test', $indexMetadata); var_dump(serialize($classMetadata));

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.4.140.0580.01229.49
8.4.130.0300.00917.46
8.4.120.0390.00717.58
8.4.110.0390.00717.81
8.4.100.0360.01117.71
8.4.90.0380.00917.59
8.4.80.0380.00917.73
8.4.70.0380.01217.75
8.4.60.0420.01117.33
8.4.50.0380.00817.68
8.4.40.0400.00917.32
8.4.30.0400.01117.56
8.4.20.0410.01217.54
8.4.10.0400.01017.57
8.3.270.0580.01328.43
8.3.260.0320.00816.50
8.3.250.0380.00816.59
8.3.240.0380.01216.41
8.3.230.0350.01116.22
8.3.220.0410.00616.49
8.3.210.0360.01116.38
8.3.200.0370.01016.35
8.3.190.0380.01116.51
8.3.180.0390.00816.60
8.3.170.0390.01016.45
8.3.160.0370.01116.48
8.3.150.0410.00816.48
8.3.140.0420.00816.56
8.3.130.0380.00716.50
8.3.120.0340.01216.48
8.3.110.0360.00916.57
8.3.100.0390.00916.48
8.3.90.0400.01016.48
8.3.80.0380.01016.28
8.3.70.0370.01016.60
8.3.60.0390.00816.55
8.3.50.0390.00916.51
8.3.40.0380.01017.61
8.3.30.0320.00617.34
8.3.20.0350.00717.37
8.3.10.0340.01117.36
8.3.00.0410.00817.43
8.2.290.0340.00816.47
8.2.280.0320.00816.62
8.2.270.0330.00816.29
8.2.260.0320.00816.51
8.2.250.0320.01016.36
8.2.240.0340.00716.55
8.2.230.0320.01016.40
8.2.220.0320.00916.70
8.2.210.0360.00816.51
8.2.200.0330.00916.42
8.2.190.0320.00816.38
8.2.180.0310.00916.37
8.2.170.0400.00317.74
8.2.160.0360.00817.72
8.2.150.0350.00817.46
8.2.140.0330.01117.51
8.2.130.0380.00817.58
8.2.120.0360.01017.68
8.2.110.0390.00617.56
8.2.100.0350.00717.52
8.2.90.0340.00817.62
8.2.80.0350.00817.46
8.2.70.0320.01017.58
8.2.60.0330.01117.64
8.2.50.0370.01017.42
8.2.40.0330.01017.63
8.2.30.0310.00817.57
8.2.20.0310.01117.54
8.2.10.0390.00817.57
8.2.00.0400.00817.57
8.1.330.0310.00816.30
8.1.320.0360.01116.16
8.1.310.0280.01316.23
8.1.300.0330.00916.29
8.1.290.0320.00916.00
8.1.280.0270.01315.99
8.1.270.0340.00817.40
8.1.260.0410.00517.21
8.1.250.0330.00817.25
8.1.240.0310.01116.87
8.1.230.0300.00717.23
8.1.220.0270.01017.32
8.1.210.0330.00817.12
8.1.200.0350.00617.51
8.1.190.0330.00917.35
8.1.180.0340.00717.37
8.1.170.0270.01217.25
8.1.160.0330.01116.94
8.1.150.0300.01117.19
8.1.140.0370.00717.13
8.1.130.0310.01017.24
8.1.120.0320.01016.98
8.1.110.0310.01317.18
8.1.100.0340.00817.02
8.1.90.0390.00717.05
8.1.80.0310.00717.43
8.1.70.0320.00717.50
8.1.60.0280.00917.37
8.1.50.0340.01117.38
8.1.40.0250.01417.26
8.1.30.0330.00617.48
8.1.20.0260.01217.63
8.1.10.0320.00617.32
8.1.00.0340.01117.44
8.0.300.0330.00916.60
8.0.290.0290.01016.79
8.0.280.0280.01116.61
8.0.270.0310.00916.59
8.0.260.0340.01116.67
8.0.250.0260.01316.46
8.0.240.0350.00616.59
8.0.230.0310.00616.96
8.0.220.0290.00916.37
8.0.210.0290.00916.82
8.0.200.0310.00816.68
8.0.190.0310.00716.64
8.0.180.0290.00816.60
8.0.170.0340.00716.57
8.0.160.0320.00616.93
8.0.150.0280.01316.64
8.0.140.0340.00916.78
8.0.130.0250.01416.61
8.0.120.0280.01116.45
8.0.110.0350.00716.51
8.0.100.0390.00716.50
8.0.90.0300.01016.68
8.0.80.0320.00616.87
8.0.70.0330.00716.30
8.0.60.0330.00616.54
8.0.50.0270.01216.55
8.0.30.0270.01016.61
8.0.20.0310.00616.80
8.0.10.0290.01116.86
8.0.00.0300.00816.99
7.4.330.0320.00516.32
7.4.320.0320.00416.41
7.4.300.0260.01216.42
7.4.290.0320.00816.34
7.4.280.0310.00916.48
7.4.270.0300.00716.16
7.4.260.0280.00616.54
7.4.250.0270.00816.24
7.4.240.0260.00816.35
7.4.230.0310.00415.98
7.4.220.0270.00916.28
7.4.210.0270.00716.41
7.4.200.0290.00516.38
7.4.190.0280.00616.36
7.4.180.0320.00516.24
7.4.160.0240.01016.58
7.4.150.0270.00716.32
7.4.140.0290.00716.28
7.4.130.0280.00816.25
7.4.120.0300.00516.26
7.4.110.0300.00816.23
7.4.100.0340.00916.32
7.4.90.0360.00916.10
7.4.80.0260.01016.31
7.4.70.0320.00816.23
7.4.60.0290.00816.14
7.4.50.0450.00516.11
7.4.40.0280.00816.22
7.4.30.0280.00716.18
7.4.20.0270.00816.18
7.4.10.0260.00816.24
7.4.00.0260.01016.11
7.3.330.0300.00516.20
7.3.320.0320.00515.98
7.3.310.0260.00916.21
7.3.300.0280.00616.14
7.3.290.0270.00715.99
7.3.280.0270.01016.10
7.3.270.0320.00716.09
7.3.260.0310.00416.17
7.3.250.0280.00816.04
7.3.240.0290.00716.03
7.3.230.0320.00416.11
7.3.220.0370.00416.02
7.3.210.0270.01016.19
7.3.200.0280.00716.18
7.3.190.0310.00616.16
7.3.180.0270.00916.20
7.3.170.0300.00516.18
7.3.160.0260.00915.94
7.3.150.0270.00816.05
7.3.140.0310.00415.98
7.3.130.0280.00715.91
7.3.120.0280.00815.98
7.3.110.0240.01115.98
7.3.100.0410.00715.93
7.3.90.0290.00716.38
7.3.80.0280.00616.11
7.3.70.0320.00416.07
7.3.60.0260.00816.27
7.3.50.0290.00716.29
7.3.40.0260.00816.13
7.3.30.0240.01016.29
7.3.20.0350.00716.39
7.3.10.0270.01116.02
7.3.00.0300.00716.31
7.2.340.0300.00716.02
7.2.330.0250.00916.07
7.2.320.0260.00915.87
7.2.310.0310.00516.29
7.2.300.0230.01216.00
7.2.290.0340.00516.37
7.2.280.0290.00516.06
7.2.270.0300.00716.07
7.2.260.0270.01116.11
7.2.250.0250.01016.13
7.2.240.0290.00716.18
7.2.230.0300.00715.98
7.2.220.0350.00815.81
7.2.210.0300.01016.00
7.2.200.0220.01216.16
7.2.190.0280.00515.98
7.2.180.0290.00616.20
7.2.170.0270.00916.30
7.2.160.0260.00915.99
7.2.150.0330.00516.07
7.2.140.0320.00716.43
7.2.130.0300.00816.51
7.2.120.0460.00516.61
7.2.110.0310.00916.44
7.2.100.0320.00916.25
7.2.90.0340.01216.04
7.2.80.0290.01016.46
7.2.70.0330.00816.47
7.2.60.0340.00416.65
7.2.50.0280.00916.41
7.2.40.0310.00716.33
7.2.30.0320.00816.53
7.2.20.0330.01116.36
7.2.10.0370.00516.43
7.2.00.0270.01116.40
7.1.330.0280.00615.25
7.1.320.0280.00615.45
7.1.310.0230.01015.51
7.1.300.0280.00815.59
7.1.290.0260.00715.37
7.1.280.0280.00515.16
7.1.270.0270.00615.34
7.1.260.0250.00815.23
7.1.250.0300.00715.21
7.1.240.0240.01015.18
7.1.230.0290.00615.61
7.1.220.0250.00915.27
7.1.210.0300.00415.18
7.1.200.0260.00815.41
7.1.190.0270.00815.68
7.1.180.0250.00815.46
7.1.170.0290.00515.41
7.1.160.0260.00815.28
7.1.150.0290.00415.21
7.1.140.0280.00615.21
7.1.130.1350.00615.52
7.1.120.0150.00515.26
7.1.110.0270.00715.06
7.1.100.0250.00915.22
7.1.90.0360.01015.23
7.1.80.0300.01215.32
7.1.70.0320.00814.96
7.1.60.0280.00615.18
7.1.50.0280.00515.25
7.1.40.0220.01115.34
7.1.30.0230.01115.52
7.1.20.0260.00815.39
7.1.10.0230.01115.26
7.1.00.0220.01115.36
7.0.330.0270.00715.04
7.0.320.0270.00415.05
7.0.310.0260.00915.13
7.0.300.0250.00714.86
7.0.290.0250.00715.05
7.0.280.0260.00615.05
7.0.270.0260.00515.02
7.0.260.0270.00515.05
7.0.250.0820.00414.98
7.0.240.0200.00515.38
7.0.230.0310.00514.97
7.0.220.0250.00715.09
7.0.210.0210.01014.93
7.0.200.0280.00415.22
7.0.190.0240.00814.98
7.0.180.0260.00715.10
7.0.170.0260.00814.94
7.0.160.0260.00715.03
7.0.150.0260.01014.65
7.0.140.0280.00514.61
7.0.130.0270.00615.03
7.0.120.0260.00515.00
7.0.110.0250.00615.03
7.0.100.0250.00614.96
7.0.90.0250.00714.69
7.0.80.0250.00714.56
7.0.70.0280.00414.71
7.0.60.0250.00914.98
7.0.50.0270.00814.77
7.0.40.0260.00515.05
7.0.30.0830.00415.02
7.0.20.0300.00214.98
7.0.10.0400.00714.61
7.0.00.0270.00714.90
5.6.400.0240.00815.48
5.6.390.0280.00715.45
5.6.380.0290.01015.48
5.6.370.0230.00315.15
5.6.360.0250.00715.47
5.6.350.0230.00915.26
5.6.340.0260.00415.32
5.6.330.0230.00715.37
5.6.320.0280.00615.61
5.6.310.0260.00415.32
5.6.300.0280.00215.50
5.6.290.0200.01015.61
5.6.280.0280.00215.68
5.6.270.0180.01215.30
5.6.260.0270.00715.36
5.6.250.0210.01015.33
5.6.240.0290.00715.54
5.6.230.0210.00915.39
5.6.220.0240.00715.41
5.6.210.0250.00615.63
5.6.200.0220.00815.71
5.6.190.0210.00915.45
5.6.180.0160.00615.62
5.6.170.0260.00715.43
5.6.160.0280.00315.55
5.6.150.0290.00415.54
5.6.140.0230.00715.69
5.6.130.0240.00715.42
5.6.120.0240.00615.42
5.6.110.0170.01315.57
5.6.100.0230.00715.41
5.6.90.0200.01015.59
5.6.80.0270.00315.46
5.6.70.0290.00115.19
5.6.60.0260.00315.74
5.6.50.0240.00715.49
5.6.40.0210.00915.61
5.6.30.0270.00715.44
5.6.20.0330.00415.36
5.6.10.0240.00715.39
5.6.00.0220.00815.36
5.5.380.0280.00315.62
5.5.370.0230.00815.47
5.5.360.0210.00815.44
5.5.350.0240.00615.04
5.5.340.0210.01115.18
5.5.330.0280.00615.36
5.5.320.0240.00715.28
5.5.310.0250.00715.16
5.5.300.0250.00615.28
5.5.290.0320.00215.23
5.5.280.0260.00615.35
5.5.270.0250.00615.39
5.5.260.0240.00615.19
5.5.250.0240.00615.51
5.5.240.0230.00615.42
5.5.230.0240.00715.51
5.5.220.0220.00915.44
5.5.210.0240.00615.39
5.5.200.0220.00915.04
5.5.190.0220.00815.21
5.5.180.0200.00915.30
5.5.170.0240.00615.28
5.5.160.0260.00415.43
5.5.150.0240.00615.29
5.5.140.0250.00515.03
5.5.130.0220.00615.25
5.5.120.0250.00415.11
5.5.110.0200.01014.96
5.5.100.0220.00715.41
5.5.90.0230.00615.57
5.5.80.0250.00515.51
5.5.70.0270.01115.29
5.5.60.0230.00615.44
5.5.50.0210.00815.25
5.5.40.0220.00715.40
5.5.30.0220.00715.28
5.5.20.0220.00815.32
5.5.10.0210.00815.43
5.5.00.0190.00915.13
5.4.450.0200.00514.24
5.4.440.0210.00314.24
5.4.430.0210.00514.24
5.4.420.0210.00614.24
5.4.410.0200.00414.24
5.4.400.0200.00314.24
5.4.390.0200.00414.24
5.4.380.0190.00414.24
5.4.370.0150.00714.24
5.4.360.0180.00514.24
5.4.350.0170.00614.24
5.4.340.0200.00314.24
5.4.330.0190.00514.24
5.4.320.0200.00514.24
5.4.310.0230.00214.24
5.4.300.0200.00614.24
5.4.290.0210.00514.24
5.4.280.0230.00614.24
5.4.270.0270.00414.24
5.4.260.0180.00614.24
5.4.250.0180.00514.24
5.4.240.0200.00314.24
5.4.230.0160.00714.24
5.4.220.0170.00614.24
5.4.210.0200.00414.24
5.4.200.0150.00914.24
5.4.190.0180.00514.24
5.4.180.0180.00614.24
5.4.170.0190.00414.24
5.4.160.0150.00814.24
5.4.150.0160.00714.24
5.4.140.0220.00314.24
5.4.130.0190.00314.24
5.4.120.0180.00514.24
5.4.110.0260.00714.24
5.4.100.0200.00514.24
5.4.90.0170.00614.24
5.4.80.0180.00514.24
5.4.70.0170.00614.24
5.4.60.0170.00614.24
5.4.50.0170.00514.24
5.4.40.0200.00214.24
5.4.30.0170.00614.24
5.4.20.0190.00314.24
5.4.10.0140.00914.24
5.4.00.0200.00214.24
5.3.290.0200.00414.24
5.3.280.0190.00614.24
5.3.270.0220.00514.24
5.3.260.0150.01014.24
5.3.250.0170.00714.24
5.3.240.0190.00414.24
5.3.230.0190.00714.24
5.3.220.0180.00514.24
5.3.210.0230.00614.24
5.3.200.0180.00614.24
5.3.190.0180.00814.24
5.3.180.0190.00414.24
5.3.170.0170.00714.24
5.3.160.0170.00714.24
5.3.150.0160.00714.24
5.3.140.0220.00514.24
5.3.130.0170.00614.24
5.3.120.0160.00714.24
5.3.110.0180.00514.24
5.3.100.0210.00414.24
5.3.90.0190.00414.24
5.3.80.0160.00714.24
5.3.70.0150.00814.24
5.3.60.0190.00514.24
5.3.50.0180.00414.24
5.3.40.0180.00514.24
5.3.30.0180.00514.24
5.3.20.0180.00514.24
5.3.10.0160.00714.24
5.3.00.0190.00414.24
5.2.170.0170.00614.24
5.2.160.0140.00614.24
5.2.150.0150.00514.24
5.2.140.0140.00714.24
5.2.130.0150.00414.24
5.2.120.0170.00214.24
5.2.110.0140.00414.24
5.2.100.0150.00314.24
5.2.90.0140.00514.24
5.2.80.0140.00614.24
5.2.70.0150.00414.24
5.2.60.0120.00614.24
5.2.50.0150.00414.24
5.2.40.0150.00414.24
5.2.30.0120.00614.24
5.2.20.0150.00314.24
5.2.10.0120.00614.24
5.2.00.0120.00514.24
5.1.60.0140.00214.24
5.1.50.0110.00614.24
5.1.40.0110.00514.24
5.1.30.0150.00214.24
5.1.20.0110.00614.24
5.1.10.0130.00414.24
5.1.00.0120.00514.24
5.0.50.0110.00314.24
5.0.40.0100.00414.24
5.0.30.0110.00314.24
5.0.20.0120.00214.24
5.0.10.0090.00414.24
5.0.00.0080.00714.24
4.4.90.0080.00014.24
4.4.80.0080.00114.24
4.4.70.0050.00314.24
4.4.60.0070.00214.24
4.4.50.0090.00014.24
4.4.40.0070.00214.24
4.4.30.0070.00114.24
4.4.20.0070.00214.24
4.4.10.0080.00214.24
4.4.00.0080.00214.24
4.3.110.0090.00014.24
4.3.100.0080.00114.24
4.3.90.0060.00314.24
4.3.80.0080.00114.24
4.3.70.0070.00114.24
4.3.60.0070.00114.24
4.3.50.0060.00214.24
4.3.40.0070.00214.24
4.3.30.0050.00114.24
4.3.20.0040.00314.24
4.3.10.0050.00114.24
4.3.00.0060.00114.24

preferences:
67.47 ms | 403 KiB | 5 Q