3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Obj { // Testing $this->a being a dynamic property. function __construct($a) { $this->a = $a; } public function __wakeup() { echo "Calling __wakeup\n"; for ($i = 0; $i < 10000; $i++) { $this->{'b' . $i} = 42; } } } function main() { $obj = new stdClass(); $obj->test = 'foo'; $variable = [new Obj($obj), new Obj($obj)]; $serialized = serialize($variable); printf("%s\n", $serialized); $unserialized = unserialize($serialized); for ($i = 0; $i < 10000; $i++) { if ($unserialized[0]->{'b' . $i} !== 42) { echo "Fail 0 b$i\n"; return; } if ($unserialized[1]->{'b' . $i} !== 42) { echo "Fail 1 b$i\n"; return; } unset($unserialized[0]->{'b' . $i}); unset($unserialized[1]->{'b' . $i}); } var_dump($unserialized); } main();

Abusive script

This script was stopped while abusing our resources

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.110.0100.01320.94
8.3.100.0110.00024.06
8.3.90.0150.01226.77
8.3.80.0040.00818.43
8.3.70.0040.01818.68
8.3.60.0040.01116.75
8.3.50.0160.00922.79
8.3.40.0170.00018.95
8.3.30.0030.01319.04
8.3.20.0090.00020.29
8.3.10.0040.00421.85
8.3.00.0040.00419.85
8.2.230.0030.00722.58
8.2.220.0070.00337.54
8.2.210.0080.00426.77
8.2.200.0100.00318.41
8.2.190.0170.01316.75
8.2.180.0100.00616.75
8.2.170.0100.01022.96
8.2.160.0070.00721.10
8.2.150.0000.00924.18
8.2.140.0040.00424.66
8.2.130.0030.00526.16
8.2.120.0050.00521.18
8.2.110.0170.00720.87
8.2.100.0060.00617.84
8.2.90.0120.00419.39
8.2.80.0080.00017.97
8.2.70.0030.00717.77
8.2.60.0050.00318.03
8.2.50.0060.00618.10
8.2.40.0000.00920.72
8.2.30.0000.00821.10
8.2.20.0060.00317.88
8.2.10.0000.00818.34
8.2.00.0040.00418.20
8.1.290.0030.01030.84
8.1.280.0100.01025.92
8.1.270.0060.00625.99
8.1.260.0090.00326.35
8.1.250.0080.00428.09
8.1.240.0130.00722.37
8.1.230.0100.01319.64
8.1.220.0030.01219.78
8.1.210.0040.01119.36
8.1.200.0100.00619.35
8.1.190.0000.01419.35
8.1.180.0030.01219.22
8.1.170.0040.01120.52
8.1.160.0080.00424.09
8.1.150.0090.00622.03
8.1.140.0000.01321.47
8.1.130.0070.00719.69
8.1.120.0000.01319.32
8.1.110.0000.01419.26
8.1.100.0040.00919.29
8.1.90.0000.01919.29
8.1.80.0000.01319.32
8.1.70.0030.01019.29
8.1.60.0000.01419.44
8.1.50.0110.00319.40
8.1.40.0000.01519.39
8.1.30.0030.01319.33
8.1.20.0030.01219.47
8.1.10.0040.01119.41
8.1.00.0080.01219.36
8.0.300.0040.01119.96
8.0.290.0000.01718.63
8.0.280.0030.01020.41
8.0.270.0030.01019.14
8.0.260.0060.01019.28
8.0.250.0000.01318.70
8.0.240.0000.01318.79
8.0.230.0030.01018.61
8.0.220.0030.01018.69
8.0.210.0000.01418.64
8.0.200.0000.01318.65
8.0.190.0060.00918.63
8.0.180.0060.00818.62
8.0.170.0040.01118.71
8.0.160.0060.00918.75
8.0.150.0000.01518.72
8.0.140.0030.01218.66
8.0.130.0000.01315.20
8.0.120.0000.01518.47
8.0.110.0030.01018.61
8.0.100.0030.01018.42
8.0.90.0070.01018.50
8.0.80.0070.02118.67
8.0.70.0040.01118.43
8.0.60.0000.01418.49
8.0.50.0000.01418.48
8.0.30.0130.01618.84
8.0.20.0100.02418.73
8.0.10.0070.00718.80
8.0.00.0030.03718.45
7.4.330.0040.00717.09
7.4.320.0070.00718.29
7.4.300.0030.01018.02
7.4.290.0040.01118.06
7.4.280.0030.01718.23
7.4.270.0070.00718.25
7.4.260.0070.00718.16
7.4.250.0030.01018.21
7.4.240.0060.00918.31
7.4.230.0030.01018.31
7.4.220.0130.01618.16
7.4.210.0070.01818.08
7.4.200.0100.00318.15
7.4.160.0110.01618.26
7.4.150.0100.02018.29
7.4.140.0090.01918.10
7.4.130.0120.02118.22
7.4.120.0090.02018.29
7.4.110.0120.01618.23
7.4.100.0150.02718.34
7.4.90.0120.01518.34
7.4.80.0100.01719.39
7.4.70.0060.03218.18
7.4.60.0140.01418.13
7.4.50.0100.01618.23
7.4.40.0070.02118.28
7.4.30.0070.03218.30
7.4.10.0070.02516.66
7.4.00.0070.02416.59
7.3.330.0030.01015.11
7.3.320.0030.01015.30
7.3.310.0030.01218.10
7.3.300.0040.00918.17
7.3.290.0030.01018.02
7.3.280.0130.02318.20
7.3.270.0130.01618.51
7.3.260.0120.02018.52
7.3.250.0140.02618.31
7.3.240.0140.01618.44
7.3.230.0130.01618.42
7.3.210.0080.01918.11
7.3.200.0100.01918.50
7.3.190.0150.01518.48
7.3.180.0090.01918.21
7.3.170.0090.01818.38
7.3.160.0180.02118.39
7.3.130.0130.01616.71
7.3.120.0070.02416.75
7.3.110.0130.01716.95
7.3.100.0070.01616.84
7.3.90.0100.01516.73
7.3.80.0090.01616.69
7.3.70.0070.01716.70
7.3.60.0030.02316.85
7.3.50.0070.01616.84
7.3.40.0140.01216.85
7.3.30.0100.01616.76
7.3.20.0050.01418.75
7.3.10.0080.01918.60
7.3.00.0060.01718.60
7.2.330.0150.01518.54
7.2.320.0070.02118.71
7.2.310.0130.02018.69
7.2.300.0060.02218.59
7.2.290.0110.02018.44
7.2.260.0100.02316.79
7.2.250.0060.02117.03
7.2.240.0080.02316.82
7.2.230.0050.01717.04
7.2.220.0110.01517.00
7.2.210.0080.01816.70
7.2.200.0030.01916.97
7.2.190.0050.01916.86
7.2.180.0100.01217.00
7.2.170.0140.01216.79
7.2.160.0090.02016.97
7.2.150.0020.02318.85
7.2.140.0050.02318.81
7.2.130.0100.01318.84
7.2.120.0080.02018.70
7.2.110.0070.01918.91
7.2.100.0060.01918.81
7.2.90.0020.02119.07
7.2.80.0030.01818.98
7.2.70.0050.01518.94
7.2.60.0110.01218.96
7.2.50.0060.01918.98
7.2.40.0080.01418.95
7.2.30.0100.01918.95
7.2.20.0050.01518.76
7.2.10.0050.01918.90
7.2.00.0060.01618.66
7.1.330.0040.02717.75
7.1.320.0030.02317.79
7.1.310.0050.02317.86
7.1.300.0080.01417.83
7.1.290.0060.02017.79
7.1.280.0020.02317.72
7.1.270.0070.02317.84
7.1.260.0030.02317.86
7.1.250.0010.02017.73
7.1.240.0090.01617.87
7.1.230.0050.02117.52
7.1.220.0050.02217.83
7.1.210.0060.01717.66
7.1.200.0080.01417.82
7.1.190.0060.01717.62
7.1.180.0070.01717.65
7.1.170.0090.01617.77
7.1.160.0050.02017.79
7.1.150.0050.01917.81
7.1.140.0030.02017.83
7.1.130.0050.01717.82
7.1.120.0110.02117.94
7.1.110.0060.02617.86
7.1.100.0050.02117.88
7.1.90.0050.01717.88
7.1.80.0100.01317.78
7.1.70.0050.01918.34
7.1.60.0040.02018.37
7.1.50.0110.01718.18
7.1.40.0060.01917.84
7.1.30.0060.01717.89
7.1.20.0080.01717.66
7.1.10.0060.01617.79
7.1.00.0080.02917.96
7.0.330.0050.01517.53
7.0.320.0050.02217.47
7.0.310.0030.02117.52
7.0.300.0050.01717.33
7.0.290.0000.02217.49
7.0.280.0080.01517.39
7.0.270.0060.02317.48
7.0.260.0080.01617.49
7.0.250.0050.01917.49
7.0.240.0060.01817.50
7.0.230.0050.02017.59
7.0.220.0020.02217.49
7.0.210.0070.02417.39
7.0.200.0020.02217.97
7.0.190.0050.02117.52
7.0.180.0070.01617.42
7.0.170.0060.01817.36
7.0.160.0050.01717.48
7.0.150.0090.01317.54
7.0.140.0030.01015.54
7.0.130.0090.00815.33
7.0.120.0050.01015.53
7.0.110.0010.01215.38
7.0.100.0050.00715.55
7.0.90.0090.02517.31
7.0.80.0110.03317.23
7.0.70.0270.02817.24
7.0.60.0290.03117.26
7.0.50.0110.03017.47
7.0.40.0110.02716.05
7.0.30.0100.03016.13
7.0.20.0180.03716.31
7.0.10.0310.04116.34
7.0.00.0170.04916.27
5.6.400.0070.03317.43
5.6.390.0030.03017.32
5.6.380.0050.03517.24
5.6.370.0030.03217.00
5.6.360.0100.02317.36
5.6.350.0080.03317.45
5.6.340.0120.02317.35
5.6.330.0070.03717.21
5.6.320.0030.02917.41
5.6.310.0070.03217.36
5.6.300.0060.03117.08
5.6.290.0100.02817.34
5.6.280.0050.03017.30
5.6.270.0050.03217.24
5.6.260.0030.03017.27
5.6.250.0090.02717.21
5.6.240.0020.03817.46
5.6.230.0080.05019.35
5.6.220.0120.04819.44
5.6.210.0110.05319.31
5.6.200.0100.04619.51
5.6.190.0100.04619.63
5.6.180.0100.04719.54
5.6.170.0130.04919.40
5.6.160.0100.04219.43
5.6.150.0090.05619.51
5.6.140.0070.05919.40
5.6.130.0110.04719.63
5.6.120.0120.06019.48
5.6.110.0130.04519.54
5.6.100.0090.04919.39
5.6.90.0080.05019.50
5.6.80.0110.05119.16
5.6.70.0140.04819.34
5.6.60.0110.05019.21
5.6.50.0100.04319.41
5.6.40.0090.05219.20
5.6.30.0080.04719.26
5.6.20.0100.04719.28
5.6.10.0110.04619.23
5.6.00.0140.04319.24

preferences:
27.31 ms | 403 KiB | 5 Q