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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 11:01:29 2025 UTC