PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PHP » PHP_Compat » Bug #9042

Various uninitialized variables

Details

Submitted2006-10-15 10:27 UTC
Fromjo at durchholz dot org
Assignedaidan
StatusClosed
PackagePHP_Compat
PHP VersionIrrelevant
OSAny
Roadmaps1.6.0a1

Comments

[2006-10-15 10:27 UTC] jo at durchholz dot org

Description:
------------
Here's a list of places where Eclipse found uninitialized variables, with fixes:

array_walk.php, line 41: $user_func should be $funcname.
strpbrk.php, line 43: $needle should be $char_list.

The following are not bugs, but they cause Eclipse to carp about possibly uninitialized variables since it doesn't grok assignments inside an eval() call.
I suggest replacing
eval ("\$var = ...");
with
$var = NULL;
eval ("\$var = ...");
I know this is silly, but it will make the really important warnings stand out in Eclipse and help catch uninitialized variable errors elsewhere.
The affected code lines are here:
call_user_func_array, line 73 ($retval)
constant.php, line 44 ($value)