php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19318 get_defined_functions() not returning all available functions
Submitted: 2002-09-09 10:42 UTC Modified: 2002-09-10 08:01 UTC
From: marcuscorrea at yahoo dot com Assigned:
Status: Closed Package: PHP options/info functions
PHP Version: 4.2.2 OS: Win ME + Apache (local)
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: marcuscorrea at yahoo dot com
New email:
PHP Version: OS:

 

 [2002-09-09 10:42 UTC] marcuscorrea at yahoo dot com
get_defined_functions() does not return all internal functions available in release 4.2.2.

I used

$arr = get_defined_functions();
print_r($arr);

and got the list allright. However, if I search for any 'domxml_' or 'exif_' strings in my output, for instance, I do not find any.

Regards,

Marcus

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-09 10:44 UTC] kalowsky@php.net
Did you install said libraries?
 [2002-09-09 10:50 UTC] marcuscorrea at yahoo dot com
No, I have not.

If installing said libraries influences the output, it would be good if this was informed in the documentation.

In the documentation of a related function, namely function_exists(), it says:

"Note that a function name may exist even if the function itself is unusable due to configuration or compiling options (...)".

I just assumed this to be true for get_defined_functions() as well.

Sorry.

Marcus
 [2002-09-09 10:50 UTC] sniper@php.net
You need to enable the extensions for the functions to exist. Not a bug. 

 [2002-09-10 04:10 UTC] hholzgra@php.net
as a sidenote:

the comment on functions_exists() is about functions
like ImageGIF() that might be available when an extension
loaded (GD Image extension in this case) but can't do
anything useful because a precondition for this function
is not met

in this case ImageGif() will just return false and emmit a warning (at least it did once, it might be not available at all now in this case)

if a function is not available at all (due to a missing extension or due to an extension selectively registering functions) then both get_defined_functions() and function_exists() will not know about it ...

so both reflection functions tell you about *callable*
functions, not functional ones and especialy not about
those theoreticly available *if* you had some extension loaded which you haven't


 [2002-09-10 08:01 UTC] marcuscorrea at yahoo dot com
Thank you! I guess it is a matter of making the documentation clearer.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC