Doc #69956 [Asn->Csd]: SplTempFileObject::__construct() arguments

From: Date: Sun, 28 Jun 2015 15:05:44 +0000
Subject: Doc #69956 [Asn->Csd]: SplTempFileObject::__construct() arguments
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12485@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69956&edit=1 ID: 69956 Updated by: salathe@php.net Reported by: phansys at gmail dot com Summary: SplTempFileObject::__construct() arguments -Status: Assigned +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: Irrelevant PHP Version: Irrelevant Assigned To: salathe Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. The documentation has been updated so that SplFileObject::__construct() will not be listed under Inherited Methods for SplTempFileObject Previous Comments: ------------------------------------------------------------------------ [2015-06-28 15:04:47] salathe@php.net Automatic comment from SVN on behalf of salathe Revision: http://svn.php.net/viewvc/?view=revision&revision=337074 Log: use constructorsynopsis for SplFileObject (doc bug #69956) So that the constructor is not incorrectly listed under Inherited Methods for child classes. ------------------------------------------------------------------------ [2015-06-28 13:49:41] phansys at gmail dot com Description: ------------ Documentation tells that SplTempFileObject::__construct() inherits SplFileObject::__construct, but this isn't true since the constructor is overwrited in the class: ``` /* Methods */ public __construct ([ int $max_memory ] ) /* Inherited methods */ public SplFileObject::__construct ( string $filename [, string $open_mode = "r" [, bool $use_include_path = false [, resource $context ]]] ) ``` Since there is no access to parent's constructor, there is no way to specify the open mode for SplTempFileObject. Test script: --------------- $file = new \SplTempFileObject('php://temp', 'a+'); $file->fwrite(file_get_contents($filePath)); $file->fflush(); Expected result: ---------------- $file->isReadable(); // I would expect this to return true, but the open mode is always "w" and I haven't a way to change it. Actual result: -------------- ``` RuntimeException: SplTempFileObject::__construct() expects at most 1 parameter, 2 given ``` ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69956&edit=1

« previous php.doc.bugs (#12485) next »