3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MemcacheSessionModule /*implements \SessionHandlerInterface */ { const UNIX_PREFIX = 'unix://'; const FILE_PREFIX = 'file://'; /** * Our Memcache Pool * @var Memcache */ private $pool; public function close() { if ($this->pool instanceof Memcache) { return $this->pool->close(); } return true; } public function destroy($sessionId) { } public function gc($maxLifetime) { } public function open($savePath, $name) { $serverList = self::parseSavePath($savePath); if (!$serverList) { return false; } foreach ($serverList as $serverInfo) { } } public function read($sessionId) { } public function write($sessionId, $data) { } private static function parseSavePath($savePath) { if (empty($savePath)) { trigger_error( "Failed to parse session.save_path (empty save_path)", E_WARNING); return false; } $return = array(); $serverList = explode(',', $savePath); foreach ($serverList as $url) { // Swap unix:// to file:// for parse_url if (strtolower(substr($url, 0, strlen(self::UNIX_PREFIX))) === self::UNIX_PREFIX) { $url = self::FILE_PREFIX . substr($url, strlen(self::UNIX_PREFIX)); } $parsedUrlData = parse_url($url); var_dump($parsedUrlData); } } } $session = new MemcacheSessionModule; $session->open('unix:///var/run/memcache.sock?weight=123,tcp://127.0.0.1:11211?weight=1&persistent=1&timeout=4');

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.70.0110.00716.75
8.3.60.0100.00618.43
8.3.50.0160.00521.96
8.3.40.0150.00018.88
8.3.30.0000.01719.22
8.3.20.0000.00820.38
8.3.10.0000.00823.58
8.3.00.0070.00317.34
8.2.180.0040.01118.43
8.2.170.0120.00322.96
8.2.160.0110.00320.38
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0030.00522.00
8.2.110.0090.00319.14
8.2.100.0090.00317.72
8.2.90.0040.00418.22
8.2.80.0030.00617.97
8.2.70.0080.00017.49
8.2.60.0040.00817.93
8.2.50.0080.00018.07
8.2.40.0090.00019.88
8.2.30.0040.00418.07
8.2.20.0030.00617.63
8.2.10.0040.00417.89
8.2.00.0050.00317.66
8.1.280.0110.00625.92
8.1.270.0040.00423.97
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0040.00820.35
8.1.230.0070.00420.97
8.1.220.0040.00417.74
8.1.210.0040.00418.80
8.1.200.0000.01017.35
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0000.00918.51
8.1.160.0000.00722.04
8.1.150.0050.00318.86
8.1.140.0000.00817.47
8.1.130.0070.00017.77
8.1.120.0040.00417.46
8.1.110.0000.00817.41
8.1.100.0000.00817.37
8.1.90.0040.00417.42
8.1.80.0040.00417.34
8.1.70.0040.00417.39
8.1.60.0080.00017.55
8.1.50.0080.00017.50
8.1.40.0040.00417.39
8.1.30.0000.00817.57
8.1.20.0030.00617.63
8.1.10.0000.00817.54
8.1.00.0040.00417.41
8.0.300.0040.00420.06
8.0.290.0000.00916.63
8.0.280.0000.00718.43
8.0.270.0000.00817.13
8.0.260.0000.00617.12
8.0.250.0040.00316.93
8.0.240.0030.00317.06
8.0.230.0030.00317.02
8.0.220.0030.00316.82
8.0.210.0040.00416.95
8.0.200.0080.00016.92
8.0.190.0000.00816.98
8.0.180.0020.00516.95
8.0.170.0000.00816.96
8.0.160.0080.00016.82
8.0.150.0000.00716.81
8.0.140.0000.00716.85
8.0.130.0030.00313.42
8.0.120.0040.00416.98
8.0.110.0070.00016.97
8.0.100.0040.00416.97
8.0.90.0050.00316.99
8.0.80.0070.01016.92
8.0.70.0040.00416.82
8.0.60.0070.00016.78
8.0.50.0000.00716.91
8.0.30.0150.00416.99
8.0.20.0170.00417.40
8.0.10.0000.00717.12
8.0.00.0080.01016.97
7.4.330.0000.00515.01
7.4.320.0030.00316.60
7.4.300.0000.00716.52
7.4.290.0000.00716.61
7.4.280.0040.00416.43
7.4.270.0000.00816.56
7.4.260.0030.00316.54
7.4.250.0000.00816.61
7.4.240.0070.00016.66
7.4.230.0040.00416.73
7.4.220.0070.01116.66
7.4.210.0070.00716.51
7.4.200.0080.00016.64
7.4.160.0090.00616.68
7.4.150.0110.00717.40
7.4.140.0100.00917.86
7.4.130.0110.00716.62
7.4.120.0100.01016.55
7.4.110.0080.01216.57
7.4.100.0160.00016.70
7.4.90.0100.00716.41
7.4.80.0030.02119.39
7.4.70.0140.00316.53
7.4.60.0130.00716.62
7.4.50.0090.00016.68
7.4.40.0090.00616.60
7.4.30.0150.00416.57
7.4.00.0100.00814.95
7.3.330.0050.00013.38
7.3.320.0030.00313.28
7.3.310.0000.00816.43
7.3.300.0030.00316.29
7.3.290.0080.00616.41
7.3.280.0060.01216.44
7.3.270.0070.01117.40
7.3.260.0060.01416.26
7.3.250.0100.00816.51
7.3.240.0060.01116.39
7.3.230.0120.00316.52
7.3.210.0060.01016.53
7.3.200.0140.00319.39
7.3.190.0130.01016.52
7.3.180.0090.00616.57
7.3.170.0090.00616.42
7.3.160.0030.01316.34
7.3.120.0000.01914.99
7.3.110.0110.00714.58
7.3.100.0060.00914.87
7.3.90.0050.00514.97
7.3.80.0030.00814.85
7.3.70.0030.00914.63
7.3.60.0060.00614.75
7.3.50.0080.00414.79
7.3.40.0030.00714.80
7.3.30.0030.01314.76
7.3.20.0000.01516.39
7.3.10.0060.00716.56
7.3.00.0110.00316.67
7.2.330.0100.00716.42
7.2.320.0070.01016.71
7.2.310.0130.00416.36
7.2.300.0070.01116.56
7.2.290.0090.01216.64
7.2.250.0000.01814.72
7.2.240.0130.00714.90
7.2.230.0030.01314.65
7.2.220.0070.00315.08
7.2.210.0040.01115.04
7.2.200.0160.00014.80
7.2.190.0070.01014.67
7.2.180.0030.01414.71
7.2.170.0070.00714.96
7.2.130.0120.00416.89
7.2.120.0030.01216.91
7.2.110.0070.00316.64
7.2.100.0040.00816.93
7.2.90.0070.01016.73
7.2.80.0040.01516.86
7.2.70.0070.01016.60
7.2.60.0030.01216.85
7.2.50.0030.01016.71
7.2.40.0070.00316.69
7.2.30.0000.01416.84
7.2.20.0060.00616.84
7.2.10.0120.00416.97
7.2.00.0030.01018.14
7.1.330.0100.00315.77
7.1.320.0030.01315.52
7.1.310.0060.00315.38
7.1.300.0040.00815.64
7.1.290.0070.00315.66
7.1.280.0100.00715.62
7.1.270.0040.01215.63
7.1.260.0090.00615.39
7.1.250.0100.00315.64
7.1.200.0030.00915.58
7.1.100.0090.00318.07
7.1.70.0060.00916.99
7.1.60.0100.00719.32
7.1.50.0110.01116.90
7.1.00.0070.07322.45
7.0.200.0000.00716.82
7.0.140.0130.06021.95
7.0.60.0270.06020.09
7.0.50.0130.03017.96
7.0.40.0030.04320.24
7.0.30.0270.05020.32
7.0.20.0230.05020.21
7.0.10.0070.08720.16
7.0.00.0070.04020.20
5.6.280.0070.07020.83
5.6.210.0030.06320.76
5.6.200.0130.08018.29
5.6.190.0030.04320.52
5.6.180.0330.08320.68
5.6.170.0100.04720.46
5.6.160.0070.08320.52
5.6.150.0030.08318.25
5.6.140.0100.04718.18
5.6.130.0070.08018.14
5.6.120.0100.05721.02
5.6.110.0070.07721.15
5.6.100.0130.07020.98
5.6.90.0100.08021.04
5.6.80.0000.07720.38
5.6.70.4470.03720.42
5.5.350.0170.06020.36
5.5.340.0100.07017.96
5.5.330.0130.07720.40
5.5.320.0330.07320.31
5.5.310.0300.07320.34
5.5.300.0070.08017.94
5.5.290.0200.06317.94
5.5.280.0070.05320.86
5.5.270.0070.07320.80
5.5.260.0130.06720.78
5.5.250.0000.08720.60
5.5.240.0300.06020.20
5.4.450.0270.04719.56
5.4.440.0230.04019.16
5.4.430.0400.04719.40
5.4.420.0700.00019.68
5.4.410.0630.00019.57
5.4.400.0630.00019.03
5.4.390.0630.00019.13
5.4.380.0700.00019.05
5.4.370.0630.00018.98
5.4.360.0600.00019.24
5.4.350.0630.00019.11
5.4.340.0110.02912.02
5.4.320.0050.03712.52
5.4.310.0060.03812.51
5.4.300.0100.03312.51
5.4.290.0080.03512.51
5.4.280.0030.03812.41
5.4.270.0070.04112.40
5.4.260.0050.04312.41
5.4.250.0060.03812.41
5.4.240.0040.03812.41
5.4.230.0090.04012.40
5.4.220.0040.03912.40
5.4.210.0070.03812.39
5.4.200.0070.04012.40
5.4.190.0050.03912.39
5.4.180.0100.03412.39
5.4.170.0060.03512.41
5.4.160.0070.03612.41
5.4.150.0060.03512.40
5.4.140.0070.03512.09
5.4.130.0020.03912.07
5.4.120.0030.03912.03
5.4.110.0070.03412.02
5.4.100.0070.03312.02
5.4.90.0040.03912.03
5.4.80.0040.03912.03
5.4.70.0050.03512.02
5.4.60.0100.03012.02
5.4.50.0040.03612.02
5.4.40.0020.03812.01
5.4.30.0030.04012.00
5.4.20.0060.03612.00
5.4.10.0050.03612.00
5.4.00.0060.03711.49
5.3.290.0070.04612.80
5.3.280.0040.04012.71
5.3.270.0100.03712.73
5.3.260.0060.03912.72
5.3.250.0070.03812.72
5.3.240.0060.04512.72
5.3.230.0080.03512.71
5.3.220.0070.03612.68
5.3.210.0060.03812.68
5.3.200.0050.03712.68
5.3.190.0070.03712.68
5.3.180.0080.03512.68
5.3.170.0050.03712.67
5.3.160.0050.03712.67
5.3.150.0060.03612.67
5.3.140.0040.03712.66
5.3.130.0030.04112.65
5.3.120.0100.04312.66
5.3.110.0070.03812.66
5.3.100.0060.03612.13
5.3.90.0040.03812.11
5.3.80.0010.04112.11
5.3.70.0060.03512.11
5.3.60.0030.03812.09
5.3.50.0090.03212.04
5.3.40.0040.03812.04
5.3.30.0050.03511.99
5.3.20.0070.03411.77
5.3.10.0030.03711.74
5.3.00.0060.03611.73
5.2.170.0050.0309.24
5.2.160.0060.0289.23
5.2.150.0070.0299.23
5.2.140.0060.0309.23
5.2.130.0040.0339.19
5.2.120.0040.0299.19
5.2.110.0060.0319.20
5.2.100.0040.0299.20
5.2.90.0050.0289.19
5.2.80.0040.0309.18
5.2.70.0060.0299.18
5.2.60.0040.0309.14
5.2.50.0040.0309.11
5.2.40.0070.0279.09
5.2.30.0100.0279.06
5.2.20.0060.0279.05
5.2.10.0050.0278.95
5.2.00.0050.0278.82
5.1.60.0050.0278.11
5.1.50.0090.0248.10
5.1.40.0030.0258.08
5.1.30.0030.0268.43
5.1.20.0020.0288.45
5.1.10.0040.0268.18
5.1.00.0060.0318.18
5.0.50.0030.0266.67
5.0.40.0050.0186.53
5.0.30.0050.0296.34
5.0.20.0050.0186.30
5.0.10.0040.0196.29
5.0.00.0020.0316.28
4.4.90.0030.0144.78
4.4.80.0020.0174.75
4.4.70.0020.0164.76
4.4.60.0040.0144.75
4.4.50.0030.0184.77
4.4.40.0030.0244.71
4.4.30.0060.0124.75
4.4.20.0070.0144.85
4.4.10.0020.0194.84
4.4.00.0000.0274.76
4.3.110.0050.0134.67
4.3.100.0020.0154.67
4.3.90.0010.0164.63
4.3.80.0030.0234.58
4.3.70.0010.0154.63
4.3.60.0040.0134.63
4.3.50.0040.0144.63
4.3.40.0030.0244.54
4.3.30.0040.0173.30
4.3.20.0010.0173.28
4.3.10.0020.0163.24
4.3.00.0070.0179.86

preferences:
81.97 ms | 401 KiB | 5 Q