php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #69387 Example code for Imagick::queryFormats() is inaccurate
Submitted: 2015-04-06 18:41 UTC Modified: 2015-04-08 17:05 UTC
From: justins at journeygroup dot com Assigned:
Status: Duplicate Package: imagick (PECL)
PHP Version: 5.5.23 OS: Mac OS 10.10.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: justins at journeygroup dot com
New email:
PHP Version: OS:

 

 [2015-04-06 18:41 UTC] justins at journeygroup dot com
Description:
------------
---
From manual page: http://www.php.net/imagick.queryformats
---

The manual's example is faulty. The method Imagick::queryFormats cannot be called statically. Suggest that replacing the example with a var_dump() and an abbreviated list of expected output would be more helpful.

Test script:
---------------
Example code on: http://www.php.net/imagick.queryformats


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-07 11:33 UTC] danack@php.net
-Status: Open +Status: Feedback
 [2015-04-07 11:33 UTC] danack@php.net
What makes you say that it can't be called statically?

It appears to be working for me - http://phpimagick.com/Imagick/queryFormats
 [2015-04-07 17:09 UTC] justins at journeygroup dot com
-Status: Feedback +Status: Open
 [2015-04-07 17:09 UTC] justins at journeygroup dot com
You're right, I should have worded my initial report better. You _can_ execute the method, however its not preferred to call non-static methods with a static syntax. With strict mode it barks:

"Strict Standards: Non-static method Imagick::queryformats() should not be called statically"
 [2015-04-08 17:05 UTC] danack@php.net
-Status: Open +Status: Duplicate
 [2015-04-08 17:05 UTC] danack@php.net
Duplicate of https://bugs.php.net/bug.php?id=64945 which was fixed on 2013-09-25
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Nov 25 09:01:23 2020 UTC