3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[Attribute(Attribute::TARGET_PROPERTY)] class NotSerializable {} class Foo { #[NotSerializable] protected $bar = 1; #[NotSerializable] protected $baz = 2; public function __serialize(): array { $data = []; foreach ((new ReflectionObject($this))->getProperties() as $property) { if ($property->getAttributes(NotSerializable::class)) { continue; } $data[$property->getName()] = $property->getValue($this); } return $data; } } class FooChild extends Foo { protected $bar; } var_dump(serialize(new FooChild()));

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.5.20.0090.00917.42
8.5.10.0120.00816.88
8.5.00.0100.01320.02
8.4.160.0130.00723.75
8.4.150.0020.00014.05
8.4.140.0130.00817.58
8.4.130.0080.00317.56
8.4.120.0140.00620.67
8.4.110.0030.00622.45
8.4.100.0060.00319.08
8.4.90.0100.01020.76
8.4.80.0100.00918.74
8.4.70.0120.00518.76
8.4.60.0150.00618.79
8.4.50.0160.00418.54
8.4.40.0080.00817.63
8.4.30.0120.00418.86
8.4.20.0100.01017.68
8.4.10.0050.00319.59
8.3.290.0120.00920.72
8.3.280.0180.00518.58
8.3.270.0100.00916.74
8.3.260.0110.00916.53
8.3.250.0100.00519.00
8.3.240.0060.00716.69
8.3.230.0100.01016.85
8.3.220.0080.01118.74
8.3.210.0050.00316.66
8.3.200.0040.00516.39
8.3.190.0140.00417.12
8.3.180.0110.00718.97
8.3.170.0040.01416.75
8.3.160.0120.00617.08
8.3.150.0110.00718.82
8.3.140.0030.00620.73
8.3.130.0040.00416.71
8.3.120.0090.00318.97
8.3.110.0060.00320.94
8.3.100.0050.00324.06
8.3.90.0070.00726.77
8.3.80.0070.00716.63
8.3.70.0000.01616.75
8.3.60.0060.00916.63
8.3.50.0080.00816.60
8.3.40.0100.00323.65
8.3.30.0110.00420.18
8.3.20.0080.00024.18
8.3.10.0100.00921.83
8.3.00.0130.00618.83
8.2.300.0120.00817.98
8.2.290.0120.00617.38
8.2.280.0110.00918.40
8.2.270.0040.01116.82
8.2.260.0050.00216.77
8.2.250.0060.00318.54
8.2.240.0150.00017.18
8.2.230.0040.01122.58
8.2.220.0030.00637.54
8.2.210.0050.00326.77
8.2.200.0030.00618.41
8.2.190.0090.00918.54
8.2.180.0150.00716.88
8.2.170.0120.00322.96
8.2.160.0040.01122.96
8.2.150.0040.00425.66
8.2.140.0100.00820.25
8.2.130.0140.00320.41
8.2.120.0100.00719.04
8.2.110.0070.01019.27
8.2.100.0140.00318.99
8.2.90.0100.01018.85
8.2.80.0090.00818.88
8.2.70.0160.00518.63
8.2.60.0070.01018.77
8.2.50.0120.00518.79
8.2.40.0110.00518.91
8.2.30.0080.01118.77
8.2.20.0100.00618.75
8.2.10.0110.00618.69
8.2.00.0070.00918.63
8.1.340.0070.01217.80
8.1.330.0110.00616.36
8.1.320.0140.00816.14
8.1.310.0100.00716.67
8.1.300.0030.00618.65
8.1.290.0000.00930.84
8.1.280.0040.01125.92
8.1.270.0130.00222.09
8.1.260.0090.00622.06
8.1.250.0080.00721.97
8.1.240.0110.00518.58
8.1.230.0100.00519.19
8.1.220.0120.00318.83
8.1.210.0050.00718.50
8.1.200.0100.00218.59
8.1.190.0100.00218.74
8.1.180.0080.00218.52
8.1.170.0060.00618.63
8.1.160.0060.00318.58
8.1.150.0070.00718.55
8.1.140.0070.00818.50
8.1.130.0040.00418.81
8.1.120.0020.00618.56
8.1.110.0050.00418.63
8.1.100.0070.00218.52
8.1.90.0100.00218.47
8.1.80.0070.00118.63
8.1.70.0020.00618.59
8.1.60.0030.00818.63
8.1.50.0050.00318.54
8.1.40.0040.00818.72
8.1.30.0030.00518.76
8.1.20.0060.00218.77
8.1.10.0050.00318.61
8.1.00.0070.00418.55

preferences:
34.2 ms | 403 KiB | 5 Q