|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-06-28 14:57 UTC] salathe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: salathe
[2015-06-28 15:04 UTC] salathe@php.net
[2015-06-28 15:05 UTC] salathe@php.net
-Status: Assigned
+Status: Closed
[2015-06-28 15:05 UTC] salathe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 12:00:01 2026 UTC |
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 ```