Doc #51732 [Asn->Csd]: Fileinfo __construct with explicit magic file

From: Date: Tue, 04 May 2010 09:12:09 +0000
Subject: Doc #51732 [Asn->Csd]: Fileinfo __construct with explicit magic file
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4303@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51732&edit=1 ID: 51732 Updated by: pajoye@php.net Reported by: franssen dot roland at gmail dot com Summary: Fileinfo __construct with explicit magic file -Status: Assigned +Status: Closed Type: Documentation Problem Package: Filesystem function related Operating System: WINNT PHP Version: 5.3SVN-2010-05-03 (SVN) Assigned To: kalle New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2010-05-04 11:10:40] pajoye@php.net Automatic comment from SVN on behalf of pajoye Revision: http://svn.php.net/viewvc/?view=revision&revision=298948 Log: - Fix #51732, improve the doc about NULL/empty string ------------------------------------------------------------------------ [2010-05-04 10:52:38] pajoye@php.net However please add a note in the documentation to avoid any kind of confusions :) ------------------------------------------------------------------------ [2010-05-04 10:51:11] pajoye@php.net Fixed in svn. Kalle, it allows to set default value to NULL like: function foo($v=NULL) { $fileInfo = new finfo(FILEINFO_MIME, $v); } without having to test for $v. Other PHP functions act like that. ------------------------------------------------------------------------ [2010-05-04 10:49:00] pajoye@php.net Automatic comment from SVN on behalf of pajoye Revision: http://svn.php.net/viewvc/?view=revision&revision=298947 Log: - Fixed bug #51732, Fileinfo __construct or open does not work with NULL ------------------------------------------------------------------------ [2010-05-04 10:01:13] kalle@php.net Why are you trying to instanciate with the second parameter to the default value when its optional? Many functions depends internally on if 2 arguments were sent, if so then no matter of the value of that specific parameter. In this case NULL is simply a placeholder. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=51732 -- Edit this bug report at http://bugs.php.net/bug.php?id=51732&edit=1

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