3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); class SessionSaveHandler { public function __construct() { session_set_save_handler( array($this, 'open'), array($this, 'close'), array($this, 'read'), array($this, 'write'), array($this, 'destroy'), array($this, 'gc') ); register_shutdown_function('session_write_close'); } public function open($savePath, $sessionName) { return true; } public function close() { return true; } public function read($id) { global $memcachedConnection; return $memcachedConnection->get($id); } public function write($id, $data) { global $memcachedConnection; $memcachedConnection->set($id, $data, 3600); } public function destroy($id) { global $memcachedConnection; $memcachedConnection->delete($id); return true; } public function gc($maxlifetime) { return true; } } $sessionHandler = new SessionSaveHandler();

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.0070.00716.49
8.3.50.0130.00322.92
8.3.40.0120.00318.80
8.3.30.0100.00719.04
8.3.20.0040.00420.29
8.3.10.0040.00423.66
8.3.00.0040.00419.51
8.2.180.0100.00616.50
8.2.170.0070.00722.96
8.2.160.0100.00320.53
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00321.04
8.2.110.0000.01022.06
8.2.100.0040.00719.57
8.2.90.0030.00519.16
8.2.80.0040.00417.97
8.2.70.0070.00317.38
8.2.60.0040.00717.93
8.2.50.0040.00418.07
8.2.40.0040.00418.34
8.2.30.0040.00418.16
8.2.20.0040.00417.77
8.2.10.0050.00318.10
8.2.00.0040.00417.66
8.1.280.0080.00825.92
8.1.270.0040.00424.00
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00323.86
8.1.230.0110.00019.22
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0040.00417.48
8.1.190.0040.00417.36
8.1.180.0000.00818.10
8.1.170.0100.00018.64
8.1.160.0000.00722.11
8.1.150.0040.00418.82
8.1.140.0040.00417.45
8.1.130.0000.00817.77
8.1.120.0040.00417.49
8.1.110.0080.00017.55
8.1.100.0000.00817.50
8.1.90.0040.00417.48
8.1.80.0030.00517.50
8.1.70.0040.00417.41
8.1.60.0060.00317.67
8.1.50.0080.00017.49
8.1.40.0030.00617.54
8.1.30.0030.00517.66
8.1.20.0050.00517.67
8.1.10.0030.00517.59
8.1.00.0080.00017.47
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0070.00018.55
8.0.270.0040.00417.26
8.0.260.0080.00017.30
8.0.250.0040.00317.02
8.0.240.0030.00617.05
8.0.230.0000.00816.97
8.0.220.0030.00317.03
8.0.210.0040.00417.00
8.0.200.0000.00617.04
8.0.190.0030.00617.09
8.0.180.0040.00417.05
8.0.170.0040.00417.04
8.0.160.0000.00716.87
8.0.150.0040.00417.00
8.0.140.0070.00016.98
8.0.130.0040.00213.39
8.0.120.0000.00817.00
8.0.110.0040.00416.85
8.0.100.0000.00917.05
8.0.90.0040.00417.00
8.0.80.0090.00816.98
8.0.70.0050.00216.88
8.0.60.0000.00817.06
8.0.50.0040.00416.85
8.0.30.0110.00817.13
8.0.20.0110.00817.40
8.0.10.0080.00016.91
8.0.00.0130.00716.66
7.4.330.0030.00315.00
7.4.320.0000.00716.57
7.4.300.0000.00716.69
7.4.290.0000.00716.64
7.4.280.0000.00716.63
7.4.270.0000.00716.64
7.4.260.0000.00716.42
7.4.250.0070.00016.49
7.4.240.0020.00516.52
7.4.230.0030.00416.64
7.4.220.0060.01216.67
7.4.210.0000.01516.59
7.4.200.0000.00716.45
7.4.160.0130.00316.56
7.4.150.0100.00717.40
7.4.140.0120.00617.86
7.4.130.0160.00516.62
7.4.120.0080.00916.59
7.4.110.0070.01516.74
7.4.100.0090.00916.64
7.4.90.0130.00316.66
7.4.80.0110.00519.39
7.4.70.0110.00616.76
7.4.60.0150.00416.53
7.4.50.0060.00316.55
7.4.40.0080.00816.38
7.4.30.0090.00616.34
7.4.00.0130.00315.01
7.3.330.0000.00713.20
7.3.320.0050.00013.23
7.3.310.0030.00616.35
7.3.300.0000.00716.42
7.3.290.0060.00916.43
7.3.280.0070.00916.36
7.3.270.0090.00917.40
7.3.260.0070.01316.34
7.3.250.0090.00816.53
7.3.240.0070.01316.33
7.3.230.0130.00316.57
7.3.210.0060.01216.27
7.3.200.0040.01219.39
7.3.190.0140.00316.37
7.3.180.0060.01316.32
7.3.170.0090.00916.56
7.3.160.0130.00316.40
7.2.330.0090.01216.84
7.2.320.0130.00616.41
7.2.310.0130.00316.48
7.2.300.0070.01116.70
7.2.290.0000.01716.47
7.2.60.0130.00316.16
7.2.00.0000.01119.32
7.1.200.0060.00315.77
7.1.100.0000.01218.07
7.1.70.0030.00616.68
7.1.60.0040.02119.40
7.1.50.0090.01216.79
7.1.00.0100.06722.30
7.0.200.0000.00716.61
7.0.140.0100.06722.00
7.0.60.0070.08019.84
7.0.50.0100.03717.98
7.0.40.0100.04720.26
7.0.30.0270.05320.25
7.0.20.0270.07320.24
7.0.10.0100.05020.33
7.0.00.0030.04020.23
5.6.280.0030.07321.11
5.6.210.0130.07320.46
5.6.200.0070.04018.25
5.6.190.0100.04720.50
5.6.180.0130.06320.39
5.6.170.0130.04320.44
5.6.160.0100.09020.55
5.6.150.0100.05018.19
5.6.140.0100.07718.26
5.6.130.0200.06718.11
5.6.120.0100.06321.13
5.6.110.0070.09021.05
5.6.100.0070.07320.98
5.6.90.0030.04721.05
5.6.80.0100.05720.45
5.5.350.0170.03720.34
5.5.340.0070.06318.02
5.5.330.0070.08720.21
5.5.320.3100.03320.34
5.5.310.0370.03720.23
5.5.300.0130.03717.98
5.5.290.0000.06718.08
5.5.280.0100.08320.98
5.5.270.0130.08020.95
5.5.260.0100.06320.96
5.5.250.0100.07020.59
5.5.240.0200.06720.30
5.4.450.0330.06019.63
5.4.440.0130.06019.63
5.4.430.0070.05719.56
5.4.420.0070.06719.56
5.4.410.0100.05319.35
5.4.400.0100.05319.23
5.4.390.0030.06019.13
5.4.380.0170.05318.77
5.4.370.0170.05318.57
5.4.360.0170.04018.56
5.4.350.0040.04612.04
5.4.340.0070.04912.03
5.4.320.0060.03712.52
5.4.310.0040.04012.51
5.4.300.0080.03312.52
5.4.290.0060.03812.51
5.4.280.0080.03312.41
5.4.270.0060.03912.41
5.4.260.0080.03512.41
5.4.250.0050.03812.41
5.4.240.0060.03612.41
5.4.230.0100.03312.40
5.4.220.0040.04012.40
5.4.210.0060.03512.40
5.4.200.0060.03712.41
5.4.190.0080.03412.40
5.4.180.0070.03612.40
5.4.170.0070.03512.41
5.4.160.0050.03612.41
5.4.150.0030.03812.40
5.4.140.0030.03912.09
5.4.130.0070.03312.08
5.4.120.0030.03712.04
5.4.110.0060.03612.03
5.4.100.0060.03612.02
5.4.90.0070.03712.03
5.4.80.0070.03912.02
5.4.70.0030.03612.03
5.4.60.0030.03712.02
5.4.50.0100.03012.03
5.4.40.0080.03212.01
5.4.30.0050.03512.01
5.4.20.0030.03812.01
5.4.10.0060.03412.00
5.4.00.0050.03711.50
5.3.290.0040.04212.80
5.3.280.0060.03712.71
5.3.270.0050.04012.73
5.3.260.0070.03712.72
5.3.250.0070.03512.72
5.3.240.0060.03612.72
5.3.230.0050.03812.71
5.3.220.0070.03612.68
5.3.210.0060.03912.68
5.3.200.0080.03412.68
5.3.190.0060.03712.68
5.3.180.0070.03512.68
5.3.170.0060.04112.67
5.3.160.0070.03812.68
5.3.150.0060.03612.68
5.3.140.0050.03812.66
5.3.130.0090.03612.66
5.3.120.0040.04112.66
5.3.110.0040.04212.65
5.3.100.0080.03912.14
5.3.90.0040.03812.12
5.3.80.0060.03612.11
5.3.70.0080.03612.12
5.3.60.0080.03412.10
5.3.50.0070.03512.05
5.3.40.0090.03512.05
5.3.30.0110.04112.00
5.3.20.0030.04011.79
5.3.10.0070.03411.75
5.3.00.0070.03511.74
5.2.170.0020.0379.25
5.2.160.0070.0279.25
5.2.150.0060.0299.25
5.2.140.0070.0299.25
5.2.130.0030.0309.20
5.2.120.0040.0299.20
5.2.110.0010.0339.21
5.2.100.0050.0289.21
5.2.90.0050.0289.20
5.2.80.0020.0329.20
5.2.70.0050.0299.20
5.2.60.0060.0299.15
5.2.50.0090.0259.12
5.2.40.0020.0329.10
5.2.30.0050.0309.07
5.2.20.0800.03710.90
5.2.10.0870.04310.85
5.2.00.1430.04310.66
5.1.60.0930.03310.06
5.1.50.1200.03010.00
5.1.40.1470.0379.83
5.1.30.0770.02710.48
5.1.20.0270.04710.21
5.1.10.0430.0509.92
5.1.00.0470.03310.06
5.0.50.0270.0308.54
5.0.40.0130.0278.53
5.0.30.0270.0408.34
5.0.20.0830.0278.22
5.0.10.0770.0308.26
5.0.00.0470.0408.18
4.4.90.0030.0154.78
4.4.80.0030.0154.76
4.4.70.0050.0134.76
4.4.60.0040.0144.75
4.4.50.0030.0144.77
4.4.40.0040.0234.71
4.4.30.0070.0144.76
4.4.20.0030.0154.85
4.4.10.0060.0124.85
4.4.00.0010.0264.76
4.3.110.0040.0144.67
4.3.100.0010.0164.67
4.3.90.0010.0164.64
4.3.80.0010.0264.58
4.3.70.0040.0124.63
4.3.60.0020.0204.63
4.3.50.0010.0174.62
4.3.40.0020.0244.54
4.3.30.0010.0163.30
4.3.20.0020.0153.28
4.3.10.0010.0163.23
4.3.00.0000.0237.13

preferences:
41.58 ms | 401 KiB | 5 Q