php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5383 isset() can no longer be used to check if functions exist
Submitted: 2000-07-05 17:21 UTC Modified: 2000-07-06 09:58 UTC
From: ivo at ibuildings dot nl Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.0 OS: Linux (Red Hat 6.2)
Private report: No CVE-ID: None
 [2000-07-05 17:21 UTC] ivo at ibuildings dot nl
This worked in PHP3:

if (isset($myobj->somefunction))
{ 
  $myobj->somefunction();
}

it no longer works in PHP4.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-05 19:15 UTC] stas at cvs dot php dot net
Please use function_exists instead
 [2000-07-05 20:22 UTC] ivo at ibuildings dot nl
I tried like *everything* but I can't get function_exists() to work with classes.. only with regular functions.. or is there something special I should put in the function_exists parameter?
 [2000-07-06 09:58 UTC] stas at cvs dot php dot net
Ah, classes. Then use:
bool method_exists(object object, string method)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 09:00:01 2026 UTC