Doc #69956 [NEW]: SplTempFileObject::__construct() arguments

From: Date: Sun, 28 Jun 2015 13:49:42 +0000
Subject: Doc #69956 [NEW]: SplTempFileObject::__construct() arguments
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12483@lists.php.net to get a copy of this message
From: phansys at gmail dot com Operating system: Irrelevant PHP version: Irrelevant Package: Documentation problem Bug Type: Documentation Problem Bug description:SplTempFileObject::__construct() arguments 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 bug report at https://bugs.php.net/bug.php?id=69956&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69956&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69956&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69956&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69956&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69956&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69956&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69956&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69956&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69956&r=support Expected behavior: https://bugs.php.net/fix.php?id=69956&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69956&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69956&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69956&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69956&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69956&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69956&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69956&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69956&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69956&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69956&r=mysqlcfg

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