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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
22 - 14 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 18:02:40 2024 UTC