Doc #71762 [Com]: Gmagick::destroy() returns bool, not Gmagick
| From: | benjamin dot morel at gmail dot com | Date: | Thu, 10 Mar 2016 18:06:32 +0000 |
| Subject: | Doc #71762 [Com]: Gmagick::destroy() returns bool, not Gmagick | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13264@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71762&edit=1
ID: 71762
Comment by: benjamin dot morel at gmail dot com
Reported by: benjamin dot morel at gmail dot com
Summary: Gmagick::destroy() returns bool, not Gmagick
Status: Open
Type: Documentation Problem
Package: gmagick
Operating System: N/A
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
I just opened a bug on GitHub, I suggest we wait for the feedback of the extension author before we
update the doc!
https://github.com/vitoc/gmagick/issues/39
Previous Comments:
------------------------------------------------------------------------
[2016-03-10 18:00:59] benjamin dot morel at gmail dot com
Indeed, then when should document it as returning Gmagick|bool, I guess.
I just tested however, and can't get it to return false, even when destroying it multiple
times:
$g = new Gmagick();
echo get_class($g->destroy()); // Gmagick
echo get_class($g->destroy()); // Gmagick
------------------------------------------------------------------------
[2016-03-10 17:50:57] cmb@php.net
It appears the proto in the sources is wrong. ::destroy() either
returns FALSE or itself, see
<https://github.com/vitoc/gmagick/blob/master/gmagick_methods.c#L762>
<https://github.com/vitoc/gmagick/blob/master/gmagick_methods.c#L769>
<https://github.com/vitoc/gmagick/blob/master/php_gmagick_macros.h#L24>
------------------------------------------------------------------------
[2016-03-10 00:22:27] benjamin dot morel at gmail dot com
Description:
------------
http://php.net/manual/en/gmagick.destroy.php
Source:
https://github.com/vitoc/gmagick/blob/master/gmagick_methods.c#L748
Equivalent in Imagick:
http://php.net/manual/en/imagick.destroy.php
Expected result:
----------------
public bool Gmagick::destroy ( void )
Actual result:
--------------
public Gmagick Gmagick::destroy ( void )
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71762&edit=1