Doc #69878 [Ver->Csd]: Undocumented change in imagejpeg behavior

From: Date: Thu, 18 Jun 2015 19:23:12 +0000
Subject: Doc #69878 [Ver->Csd]: Undocumented change in imagejpeg behavior
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12450@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69878&edit=1 ID: 69878 Updated by: cmb@php.net Reported by: teo8976 at gmail dot com Summary: Undocumented change in imagejpeg behavior -Status: Verified +Status: Closed Type: Documentation Problem Package: GD related PHP Version: Irrelevant Assigned To: cmb 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. Previous Comments: ------------------------------------------------------------------------ [2015-06-18 19:22:35] cmb@php.net Automatic comment from SVN on behalf of cmb Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=337000 Log: added changelog (fixes #69878) ------------------------------------------------------------------------ [2015-06-18 18:58:58] cmb@php.net The behavior to not accept an empty string for the $filename parameter has been changed as of PHP 5.4.0 (ZPP s→p). However, the relevant part of the documentation has already been changed nearly nine years ago[1] (i.e. long before PHP 5.4.0 has been released). [1] <https://svn.php.net/viewvc/phpdoc/en/trunk/reference/image/functions/imagejpeg.xml?r1=218723&r2=218722&pathrev=218723> ------------------------------------------------------------------------ [2015-06-18 17:27:36] teo8976 at gmail dot com I've found 2 unrelated php-based softwares (vBulletin and MyClientBase) that in old versions used imagejpeg($someimage, '', $quality); That seems a strange coincidence, which makes me suspect that either the documentation was less clear in the past about the value to use for skipping the argument, or it explicitly allowed the use of ''. Either way, this is one more reason for documenting the change in behavior. ------------------------------------------------------------------------ [2015-06-18 17:22:50] teo8976 at gmail dot com Description: ------------ --- From manual page: http://www.php.net/function.imagejpeg --- bool imagejpeg ( resource $image [, string $filename [, int $quality ]] ) "To skip this argument [$filename] in order to provide the quality parameter, use NULL." At some version between 5.2.17 and 5.4.29, the behavior has changed in the case where $filename equals ''. In 5.2.17, passing '' would yield the same result as passing NULL. In 5.4.29, passing '' results in the error message "filename cannot be empty" (as expected). Although the documentation says that the value to use is null (dunnow if it has always been stated as clearly as it is now), and even if the change in behavior is a fix to a bug, the change MUST be documented, including the exact version when the behavior has changed. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69878&edit=1

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