3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('yesterday'); $restrict_array = array(); if (is_callable(array($start, '__sleep'))) { echo "Called: __sleep()".PHP_EOL; var_dump($restrict_array = $start->__sleep()); echo PHP_EOL.PHP_EOL.PHP_EOL; } $serialized = array( 'class' => get_class($start), 'state' => (array) $start ); if (!empty($restrict_array)) { $serialized['state'] = array_intersect_key($serialized['state'], $restrict_array); } echo "Serialized Data:".PHP_EOL; var_dump($serialized); echo PHP_EOL.PHP_EOL.PHP_EOL; unset($start); if (is_callable(array($serialized['class'], '__set_state'))) { echo "Called: __set_state()".PHP_EOL; var_dump($new_obj = $serialized['class']::__set_state($serialized['state'])); echo PHP_EOL.PHP_EOL.PHP_EOL; } if (is_callable(array($new_obj, '__wakeup'))) { echo "Called: __wakeup()".PHP_EOL; $new_obj->__wakeup(); }

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.0060.00917.13
8.3.50.0100.00617.00
8.3.40.0070.00719.34
8.3.30.0120.00319.30
8.3.20.0040.00420.45
8.3.10.0000.00922.17
8.3.00.0040.00422.10
8.2.180.0090.00618.67
8.2.170.0120.00322.96
8.2.160.0140.00020.65
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0000.00821.17
8.2.120.0070.00326.35
8.2.110.0100.00321.16
8.2.100.0080.00418.28
8.2.90.0040.00419.46
8.2.80.0050.00318.13
8.2.70.0000.00817.88
8.2.60.0000.00818.18
8.2.50.0090.00018.09
8.2.40.0060.00322.35
8.2.30.0040.00419.72
8.2.20.0040.00418.29
8.2.10.0040.00418.30
8.2.00.0050.00218.30
8.1.280.0070.01125.92
8.1.270.0130.00722.13
8.1.260.0050.00326.35
8.1.250.0030.00528.09
8.1.240.0000.00922.48
8.1.230.0120.00018.08
8.1.220.0040.00418.04
8.1.210.0030.00518.77
8.1.200.0000.00917.73
8.1.190.0040.00417.75
8.1.180.0050.00318.10
8.1.170.0040.00418.96
8.1.160.0040.00420.98
8.1.150.0000.00819.17
8.1.140.0000.00819.71
8.1.130.0030.00617.91
8.1.120.0030.00617.86
8.1.110.0030.00517.86
8.1.100.0060.00317.82
8.1.90.0070.00017.67
8.1.80.0000.00917.79
8.1.70.0060.00317.80
8.1.60.0030.00517.86
8.1.50.0040.00417.82
8.1.40.0000.00817.84
8.1.30.0030.00617.88
8.1.20.0040.00417.91
8.1.10.0020.00517.88
8.1.00.0060.00317.75
8.0.300.0090.00019.15
8.0.290.0020.00517.00
8.0.280.0040.00418.58
8.0.270.0000.00717.47
8.0.260.0000.00717.45
8.0.250.0030.00317.36
8.0.240.0030.00617.42
8.0.230.0070.00017.37
8.0.220.0030.00317.34
8.0.210.0000.00817.25
8.0.200.0040.00417.41
8.0.190.0000.00717.23
8.0.180.0000.00717.34
8.0.170.0080.00017.22
8.0.160.0040.00417.31
8.0.150.0060.00317.20
8.0.140.0040.00417.21
8.0.130.0080.00013.71
8.0.120.0000.00817.31
8.0.110.0000.00717.37
8.0.100.0050.00217.23
8.0.90.0040.00417.23
8.0.80.0060.01017.16
8.0.70.0000.00817.25
8.0.60.0040.00417.25
8.0.50.0040.00417.36
8.0.30.0050.01317.33
8.0.20.0090.01417.47
8.0.10.0000.00717.42
8.0.00.0090.01017.04
7.4.330.0050.00016.84
7.4.320.0000.00616.79
7.4.300.0070.00016.76
7.4.290.0000.00616.78
7.4.280.0000.00816.88
7.4.270.0000.00716.84
7.4.260.0070.00016.85
7.4.250.0070.00016.91
7.4.240.0040.00416.79
7.4.230.0070.00016.98
7.4.220.0040.01716.79
7.4.210.0050.01116.88
7.4.200.0030.00617.04
7.4.160.0130.00416.87
7.4.150.0120.00917.40
7.4.140.0110.00817.86
7.4.130.0090.00916.80
7.4.120.0090.00816.90
7.4.110.0060.01316.99
7.4.100.0160.00316.95
7.4.90.0110.00616.95
7.4.80.0100.01519.39
7.4.70.0140.01116.87
7.4.60.0100.01416.78
7.4.50.0090.00917.00
7.4.40.0080.01316.70
7.4.30.0080.01416.63
7.4.00.0070.01015.19
7.3.330.0050.00013.46
7.3.320.0000.00613.50
7.3.310.0000.00716.46
7.3.300.0070.00016.61
7.3.290.0070.00016.61
7.3.280.0060.00916.59
7.3.270.0220.00717.40
7.3.260.0140.00316.71
7.3.250.0080.00916.80
7.3.240.0090.00916.63
7.3.230.0190.00016.80
7.3.210.0150.00616.63
7.3.200.0070.01019.39
7.3.190.0070.01016.93
7.3.180.0090.00916.88
7.3.170.0090.00916.76
7.3.160.0040.01416.62
7.2.330.0090.01216.98
7.2.320.0000.02316.63
7.2.310.0070.01717.05
7.2.300.0100.00816.80
7.2.290.0090.00916.81
7.2.80.0040.01017.02
7.2.60.0000.01217.28
7.2.00.0030.01219.93
7.1.200.0060.00616.07
7.1.100.0000.01218.24
7.1.70.0040.00417.30
7.1.60.0150.00919.40
7.1.50.0000.02117.21
7.1.00.0030.09022.46
7.0.200.0320.01014.53
7.0.60.0400.06719.84
7.0.50.0070.06717.90
7.0.40.0070.08720.20
7.0.30.0230.07719.96
7.0.20.0200.04720.02
7.0.10.0130.07320.20
7.0.00.0100.05720.20
5.6.280.0000.04020.99
5.6.210.0070.06020.71
5.6.200.0030.08318.21
5.6.190.0030.05020.61
5.6.180.0400.07020.43
5.6.170.0370.07320.51
5.6.160.0070.05020.59
5.6.150.0070.05018.23
5.6.140.0130.07718.07
5.6.130.0130.08018.16
5.6.120.0030.04320.99
5.6.110.0070.08021.13
5.6.100.0070.06320.89
5.6.90.0170.07321.13
5.6.80.0300.05020.38
5.5.350.0230.04020.44
5.5.340.0070.05018.02
5.5.330.0030.08020.21
5.5.320.0300.07720.28
5.5.310.0230.07020.17
5.5.300.0000.08018.01
5.5.290.0100.07717.98
5.5.280.0030.04020.98
5.5.270.0070.08720.73
5.5.260.0100.08020.68
5.5.250.0170.06720.58
5.5.240.0100.05720.16

preferences:
53.16 ms | 401 KiB | 5 Q