Home » PHP » PHP_Compat » Bug #9042
Various uninitialized variables
Details
| Submitted | 2006-10-15 10:27 UTC |
|---|---|
| From | jo at durchholz dot org |
| Assigned | aidan |
| Status | Closed |
| Package | PHP_Compat |
| PHP Version | Irrelevant |
| OS | Any |
| Roadmaps | 1.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)