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($serialized['class']::__set_state($serialized['state'])); echo PHP_EOL.PHP_EOL.PHP_EOL; } if (is_callable(array($serialized['class'], '__wakeup'))) { echo "Called: __wakeup()".PHP_EOL; $serialized['class']->__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.0120.00316.75
8.3.50.0190.00821.46
8.3.40.0040.01119.01
8.3.30.0090.00619.09
8.3.20.0040.00420.29
8.3.10.0000.00921.70
8.3.00.0030.00523.78
8.2.180.0120.00318.68
8.2.170.0110.00422.96
8.2.160.0070.00720.47
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0080.00020.98
8.2.120.0030.00626.35
8.2.110.0060.00321.24
8.2.100.0130.00018.30
8.2.90.0060.00319.47
8.2.80.0030.00517.97
8.2.70.0060.00317.87
8.2.60.0000.00818.15
8.2.50.0000.00818.09
8.2.40.0040.00422.40
8.2.30.0040.00419.79
8.2.20.0040.00418.03
8.2.10.0000.00718.35
8.2.00.0000.00718.36
8.1.280.0110.00725.92
8.1.270.0110.00322.32
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0030.00623.96
8.1.230.0060.00618.02
8.1.220.0040.00417.89
8.1.210.0030.00618.77
8.1.200.0090.00017.63
8.1.190.0040.00417.47
8.1.180.0030.00618.10
8.1.170.0000.00818.86
8.1.160.0000.00721.03
8.1.150.0070.00019.11
8.1.140.0040.00419.80
8.1.130.0100.00017.96
8.1.120.0080.00017.79
8.1.110.0000.00717.80
8.1.100.0040.00417.82
8.1.90.0060.00317.82
8.1.80.0060.00317.83
8.1.70.0030.00617.86
8.1.60.0040.00417.88
8.1.50.0000.00817.85
8.1.40.0090.00017.83
8.1.30.0060.00318.00
8.1.20.0000.00817.92
8.1.10.0000.00717.91
8.1.00.0000.00717.90
8.0.300.0040.00419.09
8.0.290.0000.00717.00
8.0.280.0000.00718.71
8.0.270.0070.00017.16
8.0.260.0000.00717.30
8.0.250.0000.00817.29
8.0.240.0080.00017.36
8.0.230.0070.00017.35
8.0.220.0040.00417.19
8.0.210.0000.00817.21
8.0.200.0030.00317.25
8.0.190.0040.00417.30
8.0.180.0000.00717.30
8.0.170.0070.00017.19
8.0.160.0000.00717.29
8.0.150.0040.00417.29
8.0.140.0050.00217.19
8.0.130.0060.00313.70
8.0.120.0000.00817.25
8.0.110.0040.00417.29
8.0.100.0030.00517.15
8.0.90.0030.00617.16
8.0.80.0120.00417.13
8.0.70.0030.00717.15
8.0.60.0040.00417.13
8.0.50.0050.00317.10
8.0.30.0070.01217.43
8.0.20.0140.00917.54
8.0.10.0080.00017.47
8.0.00.0070.01417.12
7.4.330.0000.00516.96
7.4.320.0080.00016.82
7.4.300.0000.00716.89
7.4.290.0070.00016.93
7.4.280.0080.00016.93
7.4.270.0000.00816.70
7.4.260.0030.00316.73
7.4.250.0050.00316.86
7.4.240.0000.00716.95
7.4.230.0070.00016.79
7.4.220.0130.00716.93
7.4.210.0050.01216.83
7.4.200.0000.00816.68
7.4.160.0100.00616.81
7.4.150.0160.00417.40
7.4.140.0030.01617.86
7.4.130.0070.01816.55
7.4.120.0100.00616.80
7.4.110.0120.00616.67
7.4.100.0040.01516.89
7.4.90.0120.00616.84
7.4.80.0150.00919.39
7.4.70.0090.00916.71
7.4.60.0130.00316.96
7.4.50.0100.00716.82
7.4.40.0120.00916.94
7.4.30.0060.01216.77
7.4.00.0100.00815.36
7.3.330.0030.00313.52
7.3.320.0000.00613.47
7.3.310.0050.00216.62
7.3.300.0040.00416.64
7.3.290.0000.00716.51
7.3.280.0080.01016.51
7.3.270.0180.01117.40
7.3.260.0040.01416.79
7.3.240.0140.00416.79
7.3.230.0040.01416.80
7.3.210.0100.00716.66
7.3.200.0190.00319.39
7.3.190.0100.00716.73
7.3.180.0090.01016.75
7.3.170.0140.00716.58
7.3.160.0110.00716.71
7.3.120.0030.01315.28
7.3.110.0110.00615.28
7.3.100.0060.01015.28
7.3.90.0090.00615.28
7.3.80.0080.00815.28
7.3.70.0070.00715.28
7.3.60.0060.00915.28
7.3.50.0000.00915.28
7.3.40.0060.00615.39
7.3.30.0090.00315.28
7.3.20.0030.00916.98
7.3.10.0070.00717.00
7.3.00.0040.01216.83
7.2.330.0090.01017.03
7.2.320.0040.01516.84
7.2.310.0160.00316.87
7.2.300.0070.01016.66
7.2.290.0070.01116.78
7.2.250.0070.01315.28
7.2.240.0070.01415.49
7.2.230.0060.00615.66
7.2.220.0100.00315.51
7.2.210.0000.01715.38
7.2.200.0090.00015.32
7.2.190.0090.00915.28
7.2.180.0060.00615.28
7.2.170.0090.00615.57
7.2.60.0030.01217.34
7.2.00.0030.00919.90
7.1.330.0120.00315.97
7.1.320.0100.00316.04
7.1.310.0100.00316.26
7.1.300.0070.00716.11
7.1.290.0060.00615.86
7.1.280.0030.01016.11
7.1.270.0000.01216.05
7.1.260.0090.00616.02
7.1.200.0110.00015.67
7.1.100.0030.00618.53
7.1.70.0030.00517.46
7.1.60.0100.01619.40
7.1.50.0100.01317.17
7.1.00.0030.07722.45
7.0.200.0540.00014.67
7.0.60.0370.06019.88
7.0.50.0170.06317.83
7.0.40.0070.08720.06
7.0.30.0400.06020.02
7.0.20.0400.07320.08
7.0.10.0170.07719.97
7.0.00.0130.08319.99
5.6.280.0030.07020.87
5.6.210.0070.04320.57
5.6.200.0030.06018.21
5.6.190.0170.08020.49
5.6.180.0300.07020.43
5.6.170.0370.04020.55
5.6.160.0030.06020.50
5.6.150.0030.05718.19
5.6.140.0030.08718.08
5.6.130.0070.04018.11
5.6.120.0070.04020.97
5.6.110.0070.08020.98
5.6.100.0130.07321.07
5.6.90.0000.08021.10
5.6.80.0100.04320.38
5.5.350.0270.07020.41
5.5.340.0070.07017.98
5.5.330.0030.05020.23
5.5.320.0300.07320.29
5.5.310.0170.04020.29
5.5.300.0030.07717.98
5.5.290.0100.07717.98
5.5.280.0030.04020.80
5.5.270.0130.07720.73
5.5.260.0070.05720.80
5.5.250.0070.08320.61
5.5.240.0270.07020.34

preferences:
65.78 ms | 401 KiB | 5 Q