3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Item { private $notifier; public function __construct(callable $notifier) { $this->notifier = $notifier; } public function setTtl($time) { call_user_func($this->notifier, $time); } } class Pool { private $ttls = []; public function getItem($id) { return new Item(function ($ttl) use ($id) { $this->ttls[$id] = $ttl; }); } public function getTtl($id) { return $this->ttls[$id]; } } $pool = new Pool; $item = $pool->getItem('foo'); $item->setTtl(60); echo $pool->getTtl('foo');

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.0150.00316.50
8.3.50.0130.00721.88
8.3.40.0110.00418.99
8.3.30.0120.00318.57
8.3.20.0040.00420.20
8.3.10.0040.00423.73
8.3.00.0000.00819.91
8.2.180.0040.01116.50
8.2.170.0090.01222.96
8.2.160.0070.00720.43
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0060.00319.02
8.2.120.0000.00826.35
8.2.110.0040.00422.25
8.2.100.0090.00318.16
8.2.90.0080.00019.20
8.2.80.0000.00817.97
8.2.70.0080.00017.63
8.2.60.0030.00618.04
8.2.50.0090.00018.07
8.2.40.0000.00822.21
8.2.30.0040.00420.69
8.2.20.0040.00417.63
8.2.10.0000.00818.01
8.2.00.0040.00418.13
8.1.280.0070.01325.92
8.1.270.0040.00420.19
8.1.260.0080.00028.09
8.1.250.0000.00728.09
8.1.240.0030.00623.84
8.1.230.0040.00719.16
8.1.220.0040.00417.77
8.1.210.0110.00018.77
8.1.200.0070.00317.35
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0030.00618.50
8.1.160.0000.00720.70
8.1.150.0000.00718.90
8.1.140.0000.00919.53
8.1.130.0070.00017.72
8.1.120.0040.00417.47
8.1.110.0050.00317.45
8.1.100.0020.00517.39
8.1.90.0030.00617.46
8.1.80.0040.00417.45
8.1.70.0000.00717.39
8.1.60.0070.00317.59
8.1.50.0000.00817.57
8.1.40.0000.00817.59
8.1.30.0000.00817.69
8.1.20.0040.00417.69
8.1.10.0040.00417.63
8.1.00.0050.00317.50
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0070.00018.35
8.0.270.0000.00717.26
8.0.260.0030.00317.27
8.0.250.0040.00416.94
8.0.240.0030.00617.07
8.0.230.0030.00316.96
8.0.220.0040.00416.86
8.0.210.0040.00417.00
8.0.200.0030.00316.91
8.0.190.0080.00016.93
8.0.180.0040.00416.98
8.0.170.0040.00716.98
8.0.160.0030.00317.02
8.0.150.0040.00416.94
8.0.140.0000.00816.80
8.0.130.0060.00013.43
8.0.120.0000.00816.93
8.0.110.0000.00717.03
8.0.100.0050.00216.99
8.0.90.0000.00716.76
8.0.80.0060.00916.91
8.0.70.0040.00417.00
8.0.60.0040.00416.86
8.0.50.0000.00716.89
8.0.30.0130.00617.18
8.0.20.0140.00417.40
8.0.10.0050.00317.11
8.0.00.0080.00916.78
7.4.330.0050.00016.78
7.4.320.0030.00316.46
7.4.300.0070.00016.50
7.4.290.0000.00616.51
7.4.280.0000.00916.43
7.4.270.0040.00416.53
7.4.260.0000.00716.64
7.4.250.0040.00416.48
7.4.240.0040.00316.49
7.4.230.0000.00716.68
7.4.220.0060.01316.66
7.4.210.0120.00316.63
7.4.200.0000.00716.49
7.4.160.0090.00616.34
7.4.150.0040.01217.40
7.4.140.0100.00917.86
7.4.130.0100.00716.62
7.4.120.0090.00916.43
7.4.110.0140.00316.31
7.4.100.0060.01316.55
7.4.90.0110.00616.52
7.4.80.0090.00919.39
7.4.70.0030.01316.61
7.4.60.0150.00616.48
7.4.50.0060.01016.43
7.4.40.0100.00616.54
7.4.30.0100.00616.30
7.4.00.0030.01015.18
7.3.330.0040.00413.33
7.3.320.0000.00513.23
7.3.310.0000.00716.36
7.3.300.0000.00716.38
7.3.290.0070.01116.33
7.3.280.0060.00916.39
7.3.270.0070.01017.40
7.3.260.0180.00316.43
7.3.250.0110.00816.45
7.3.240.0110.00516.51
7.3.230.0070.01516.61
7.3.210.0120.00316.43
7.3.200.0080.00816.43
7.3.190.0060.01016.34
7.3.180.0100.01016.49
7.3.170.0110.00516.36
7.3.160.0120.00916.45
7.3.10.0060.00716.80
7.3.00.0040.00616.77
7.2.330.0040.01416.55
7.2.320.0150.00916.85
7.2.310.0070.01416.67
7.2.300.0130.00416.80
7.2.290.0090.00916.68
7.2.130.0050.00616.72
7.2.120.0050.00816.85
7.2.110.0090.00516.74
7.2.100.0050.00716.97
7.2.90.0030.00616.92
7.2.80.0090.00516.81
7.2.70.0060.00316.95
7.2.60.0050.00716.90
7.2.50.0060.00516.84
7.2.40.0040.00816.98
7.2.30.0070.00716.91
7.2.20.0060.00616.95
7.2.10.0000.01317.01
7.2.00.0050.01017.74
7.1.250.0040.00815.74
7.1.100.0040.00817.96
7.1.70.0030.00317.05
7.1.60.0090.01619.52
7.1.50.0110.01416.93
7.1.00.0000.08022.45
7.0.200.0040.00815.06
7.0.60.0070.06720.00
7.0.50.0000.04317.75
7.0.40.0000.08020.05
7.0.30.0330.06020.06
7.0.20.0330.07720.18
7.0.10.0100.08720.08
7.0.00.0070.08320.06
5.6.280.0070.03321.16
5.6.210.0100.07720.68
5.6.200.0030.07318.29
5.6.190.0030.07720.58
5.6.180.0200.04020.64
5.6.170.0230.07720.54
5.6.160.0130.05720.41
5.6.150.0000.07318.29
5.6.140.0030.05318.28
5.6.130.0030.04018.17
5.6.120.0100.08021.00
5.6.110.0130.06020.98
5.6.100.0230.04321.01
5.6.90.0030.05720.94
5.6.80.0100.08320.44
5.5.350.0170.07720.40
5.5.340.0100.03318.01
5.5.330.0170.07320.46
5.5.320.0500.04020.36
5.5.310.0230.04320.36
5.5.300.0100.07317.94
5.5.290.0130.07017.94
5.5.280.0070.08320.82
5.5.270.0170.07720.89
5.5.260.0030.04720.89
5.5.250.0100.03320.61
5.5.240.0400.05320.08

preferences:
31.49 ms | 401 KiB | 5 Q