3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class SensitiveValue implements \Serializable { private $value; /** * @param mixed $value */ final public function __construct($value) { $this->value = $value; } /** * @return mixed */ public function peek() { return $this->value; } /** * @return mixed */ public function get() { $value = $this->value; $this->erase(); return $value; } public function erase() { $this->value = null; } /** * {@inheritDoc} */ public function serialize() { return; } /** * {@inheritDoc} */ public function unserialize($serialized) { } /** * {@inheritDoc} */ public function __toString() { return ''; } /** * {@inheritDoc} */ public function __clone() { throw new \Exception('It is not permitted to clone this object.'); } } $value = new SensitiveValue(new \DateTime()); $time = $value->get(); echo $value->get()->format('Y-m-d');

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.40.0110.00419.04
8.3.30.0150.00318.88
8.3.20.0050.00220.21
8.3.10.0080.00023.59
8.3.00.0080.00019.51
8.2.170.0140.00322.96
8.2.160.0110.00420.47
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0030.00617.63
8.2.120.0080.00026.35
8.2.110.0090.00019.30
8.2.100.0080.00318.05
8.2.90.0060.00319.30
8.2.80.0030.00618.00
8.2.70.0050.00317.88
8.2.60.0000.00818.03
8.2.50.0040.00418.07
8.2.40.0000.00819.42
8.2.30.0030.00320.64
8.2.20.0030.00617.94
8.2.10.0040.00417.99
8.2.00.0000.00718.03
8.1.270.0060.00323.99
8.1.260.0070.00028.09
8.1.250.0030.00528.09
8.1.240.0070.00322.51
8.1.230.0040.00817.66
8.1.220.0040.00417.91
8.1.210.0000.00918.77
8.1.200.0040.00417.48
8.1.190.0000.00917.38
8.1.180.0000.00818.10
8.1.170.0000.00818.66
8.1.160.0040.00422.08
8.1.150.0040.00418.96
8.1.140.0000.00819.63
8.1.130.0030.00617.79
8.1.120.0040.00417.55
8.1.110.0040.00417.56
8.1.100.0060.00317.68
8.1.90.0000.00817.64
8.1.80.0080.00017.61
8.1.70.0000.00717.54
8.1.60.0040.00417.70
8.1.50.0050.00517.71
8.1.40.0000.00817.54
8.1.30.0080.00417.70
8.1.20.0040.00417.76
8.1.10.0030.00617.68
8.1.00.0000.00717.78
8.0.300.0050.00318.77
8.0.290.0040.00416.88
8.0.280.0030.00318.53
8.0.270.0030.00317.41
8.0.260.0000.00617.34
8.0.250.0030.00317.11
8.0.240.0070.00417.20
8.0.230.0030.00317.27
8.0.220.0000.00717.15
8.0.210.0040.00417.09
8.0.200.0000.00617.14
8.0.190.0070.00017.11
8.0.180.0040.00417.11
8.0.170.0080.00017.14
8.0.160.0070.00017.13
8.0.150.0030.00317.20
8.0.140.0070.00017.07
8.0.130.0030.00313.54
8.0.120.0050.00317.17
8.0.110.0000.00917.09
8.0.100.0070.00016.99
8.0.90.0030.00517.17
8.0.80.0100.01017.04
8.0.70.0000.00817.00
8.0.60.0000.00917.10
8.0.50.0080.00017.03
8.0.30.0060.01217.37
8.0.20.0080.01017.40
8.0.10.0050.00217.29
8.0.00.0060.00916.90
7.4.330.0000.00616.66
7.4.320.0070.00016.77
7.4.300.0000.00616.73
7.4.290.0000.00616.64
7.4.280.0060.00316.75
7.4.270.0000.00716.68
7.4.260.0000.00716.74
7.4.250.0040.00416.60
7.4.240.0000.00716.61
7.4.230.0030.00316.56
7.4.220.0060.01916.58
7.4.210.0110.00716.69
7.4.200.0040.00416.86
7.4.160.0090.00616.75
7.4.150.0140.00317.40
7.4.140.0120.00917.86
7.4.130.0120.00616.81
7.4.120.0110.01116.75
7.4.110.0140.00316.84
7.4.100.0090.01016.63
7.4.90.0060.01116.72
7.4.80.0150.00319.39
7.4.70.0110.00616.71
7.4.60.0130.01016.63
7.4.50.0000.01216.51
7.4.40.0180.00316.41
7.4.30.0000.01616.82
7.4.00.0040.01215.06
7.3.330.0050.00013.52
7.3.320.0060.00013.54
7.3.310.0070.00016.54
7.3.300.0000.00716.39
7.3.290.0060.00916.47
7.3.280.0100.01216.54
7.3.270.0110.00717.40
7.3.260.0120.00416.51
7.3.250.0160.00716.67
7.3.240.0090.01116.58
7.3.230.0080.00816.68
7.3.210.0120.00616.77
7.3.200.0060.01016.66
7.3.190.0030.01316.54
7.3.180.0030.01316.68
7.3.170.0130.00416.70
7.3.160.0100.00916.72
7.2.330.0070.01716.54
7.2.320.0120.00916.75
7.2.310.0040.01917.02
7.2.300.0070.01016.54
7.2.290.0030.01616.71
7.2.60.0090.00616.65
7.2.00.0030.01019.52
7.1.200.0090.00415.95
7.1.100.0030.00717.64
7.1.70.0040.00717.26
7.1.60.0100.01319.48
7.1.50.0030.01216.99
7.1.00.0000.08022.33
7.0.200.1300.00714.79
7.0.60.0000.04319.92
7.0.50.0070.08017.91
7.0.40.0130.06320.18
7.0.30.0130.04720.27
7.0.20.0270.07020.33
7.0.10.0070.08020.23
7.0.00.0030.07720.05
5.6.280.0030.04721.04
5.6.210.0170.05320.77
5.6.200.0130.04018.18
5.6.190.0070.07720.57
5.6.180.0370.06720.39
5.6.170.0230.03320.55
5.6.160.0170.07020.61
5.6.150.0100.07018.34
5.6.140.0100.05718.29
5.6.130.0130.04718.27
5.6.120.0000.04321.16
5.6.110.0070.04020.97
5.6.100.0070.06020.98
5.6.90.0100.07021.11
5.6.80.0070.07020.38
5.5.350.0330.07020.44
5.5.340.0030.04017.98
5.5.330.0070.04020.30
5.5.320.0000.06320.28
5.5.310.0170.04720.19
5.5.300.0170.07317.95
5.5.290.0030.08718.04
5.5.280.0100.08320.77
5.5.270.0070.08020.73
5.5.260.0030.08720.64
5.5.250.0130.06720.71
5.5.240.0270.06720.21

preferences:
64.07 ms | 400 KiB | 5 Q