Doc #69878 [Com]: Undocumented change in imagejpeg behavior
| From: | teo8976 at gmail dot com | Date: | Thu, 18 Jun 2015 17:27:36 +0000 |
| Subject: | Doc #69878 [Com]: Undocumented change in imagejpeg behavior | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12448@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
Comment by: teo8976 at gmail dot com
Reported by: teo8976 at gmail dot com
Summary: Undocumented change in imagejpeg behavior
Status: Open
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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