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');
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: Too few arguments to function MemcacheSessionModule::open(), 1 passed in /in/UXle0 on line 72 and exactly 2 expected in /in/UXle0:29 Stack trace: #0 /in/UXle0(72): MemcacheSessionModule->open('unix:///var/run...') #1 {main} thrown in /in/UXle0 on line 29
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
37.04 ms | 401 KiB | 8 Q