3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL|E_STRICT); class Obj { // Testing $this->a being a dynamic property. public function __construct($a) { $this->a = $a; } public function __wakeup() { for ($i = 0; $i < 10000; $i++) { $this->{'b' . $i} = 42; } } } function main() { $obj = (object)["test" => 'foo']; // object used twice as properties of other objects. $variable = [new Obj($obj), new Obj($obj)]; $serialized = serialize($variable); printf("%s\n", $serialized); $unserialized = unserialize($serialized); echo "Called __unserialize\n"; for ($a = 0; $a < 2; $a++) { for ($i = 0; $i < 10000; $i++) { if ($unserialized[$a]->{'b' . $i} !== 42) { echo "Fail $a b$i\n"; return; } unset($unserialized[$a]->{'b' . $i}); } } var_dump($unserialized); } main();

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.0290.00716.88
8.3.50.0120.01218.40
8.3.40.0080.00818.83
8.3.30.0130.00918.96
8.3.20.0130.00020.16
8.3.10.0080.00322.03
8.3.00.0040.00719.38
8.2.180.0400.00616.88
8.2.170.0170.00819.20
8.2.160.0060.00919.41
8.2.150.0090.00024.18
8.2.140.0060.00624.66
8.2.130.0130.00026.16
8.2.120.0090.00019.14
8.2.110.0120.00019.46
8.2.100.0070.00417.84
8.2.90.0000.01719.69
8.2.80.0030.00619.11
8.2.70.0060.00617.88
8.2.60.0040.00818.17
8.2.50.0030.00618.10
8.2.40.0000.01020.77
8.2.30.0130.00019.45
8.2.20.0090.00018.08
8.2.10.0030.00618.28
8.2.00.0050.00318.33
8.1.280.0070.01425.92
8.1.270.0040.00826.05
8.1.260.0140.00026.35
8.1.250.0030.00928.09
8.1.240.0120.00323.92
8.1.230.0030.01422.90
8.1.220.0050.00919.66
8.1.210.0040.01220.90
8.1.200.0000.02019.10
8.1.190.0060.00819.35
8.1.180.0090.00619.36
8.1.170.0000.01420.53
8.1.160.0000.01324.10
8.1.150.0070.00721.28
8.1.140.0040.01121.59
8.1.130.0000.01419.63
8.1.120.0030.01319.35
8.1.110.0060.00919.21
8.1.100.0040.01119.21
8.1.90.0070.00719.34
8.1.80.0070.00719.37
8.1.70.0030.01719.29
8.1.60.0040.01119.32
8.1.50.0000.01619.34
8.1.40.0040.01119.38
8.1.30.0000.01519.43
8.1.20.0000.01419.33
8.1.10.0090.00619.44
8.1.00.0040.01119.21
8.0.300.0070.00722.15
8.0.290.0070.00718.63
8.0.280.0070.00720.45
8.0.270.0030.01018.71
8.0.260.0060.00619.21
8.0.250.0030.01018.64
8.0.240.0040.01118.77
8.0.230.0070.00718.60
8.0.220.0030.01018.67
8.0.210.0070.00718.50
8.0.200.0040.00918.63
8.0.190.0000.01518.66
8.0.180.0030.01618.70
8.0.170.0080.00818.56
8.0.160.0100.00318.76
8.0.150.0000.01518.73
8.0.140.0030.01418.62
8.0.130.0060.00615.19
8.0.120.0040.01118.66
8.0.110.0000.01418.57
8.0.100.0080.00618.48
8.0.90.0070.00718.62
8.0.80.0070.02718.65
8.0.70.0070.00718.62
8.0.60.0030.01218.79
8.0.50.0040.01118.55
8.0.30.0100.01618.86
8.0.20.0110.02318.91
8.0.10.0040.01118.59
8.0.00.0100.01818.66
7.4.330.0040.00715.48
7.4.320.0090.00318.36
7.4.300.0030.01018.36
7.4.290.0030.01318.39
7.4.280.0130.00318.40
7.4.270.0060.00818.46
7.4.260.0030.01418.35
7.4.250.0030.01018.34
7.4.240.0070.00718.45
7.4.230.0050.00818.28
7.4.220.0140.03218.55
7.4.210.0030.02118.34
7.4.200.0050.00918.20
7.4.160.0160.01618.43
7.4.150.0110.01718.56
7.4.140.0120.01718.38
7.4.130.0080.02018.41
7.4.120.0130.02218.39
7.4.110.0090.01818.41
7.4.100.0090.02018.66
7.4.90.0160.01318.41
7.4.80.0200.01719.39
7.4.70.0160.01718.63
7.4.60.0160.01218.41
7.4.50.0070.02018.46
7.4.40.0100.02018.49
7.4.30.0120.01518.48
7.4.00.0030.02316.95
7.3.330.0080.00615.36
7.3.320.0040.00815.30
7.3.310.0050.00918.33
7.3.300.0070.00718.32
7.3.290.0100.01718.24
7.3.280.0120.02318.23
7.3.270.0240.01818.34
7.3.260.0120.01618.32
7.3.250.0100.02118.31
7.3.240.0100.02818.18
7.3.230.0140.01518.30
7.3.210.0030.02718.46
7.3.200.0190.01018.20
7.3.190.0160.02318.34
7.3.180.0100.02018.36
7.3.170.0100.02218.27
7.3.160.0130.01718.32
7.3.10.0000.02318.80
7.3.00.0090.01518.69
7.2.330.0120.01918.21
7.2.320.0110.01818.49
7.2.310.0110.01918.29
7.2.300.0070.02118.41
7.2.290.0060.02318.36
7.2.130.0030.02818.79
7.2.120.0060.01619.04
7.2.110.0090.01618.91
7.2.100.0000.02018.70
7.2.90.0040.02218.54
7.2.80.0120.01819.01
7.2.70.0100.01018.74
7.2.60.0080.01718.84
7.2.50.0030.02018.98
7.2.40.0000.02018.71
7.2.30.0040.02118.98
7.2.20.0030.02018.80
7.2.10.0030.02018.99
7.2.00.0000.02618.86
7.1.250.0030.02417.57
7.1.200.0070.01317.67
7.1.70.0140.01719.13
7.1.60.0030.01419.45
7.1.50.0100.02618.91
7.1.00.0070.07722.43
7.0.200.0000.01718.71
7.0.80.0200.05021.01
7.0.70.0130.06320.94
7.0.60.0300.06020.93
7.0.50.0130.06021.33
7.0.40.0070.06721.32
7.0.30.0030.07021.30
7.0.20.0170.07322.35
7.0.10.0130.07022.28
7.0.00.0070.08022.34
5.6.230.0100.08323.48
5.6.220.0200.08023.46
5.6.210.0170.11323.38
5.6.200.0200.07323.94
5.6.190.0200.07323.93
5.6.180.0100.08323.88
5.6.170.0200.07723.94
5.6.160.0130.07724.05
5.6.150.0170.07323.95
5.6.140.0030.08723.91
5.6.130.0130.07723.94
5.6.120.0270.07323.86
5.6.110.0170.07723.94
5.6.100.0070.08723.91
5.6.90.0200.08324.01
5.6.80.0230.11023.42
5.6.70.0300.10323.41
5.6.60.0170.07723.23
5.6.50.0200.10323.24
5.6.40.0200.11323.33
5.6.30.0170.07323.34
5.6.20.0270.08323.36
5.6.10.0130.07023.36
5.6.00.0070.08023.33

preferences:
56.88 ms | 401 KiB | 5 Q