/** * Stream constructor. * * @param resource $context */ public function __construct($context) { if (!is_resource($context) || get_resource_type($context) !== 'stream') { throw new InvalidArgumentException("Failed to create socket: Passed resource is not a valid stream " . "resource"); } parent::__construct($context); }
public function __construct($mode = null, $maxMemory = null) { $context = 'php://temp'; if ($maxMemory) { $context .= "/maxmemory:{$maxMemory}"; } parent::__construct($context, $mode); }
public function __construct() { parent::__construct('php://input', 'rb'); }
public function __construct($mode = null) { parent::__construct('php://memory', $mode); }
public function __construct() { parent::__construct('php://output', 'wb'); }