FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=14222&edit=1

ID: 14222
Updated by: hm2k@php.net
Reported By: aschwin at hotelspecials dot nl
Summary: Undefined index / offset problem in Type.php
-Status: Open
+Status: Feedback
Type: Bug
Package: PHP_DocBlockGenerator
Operating System: CentOS 4.6 Final
Package Version: 1.1.1
PHP Version: 5.2.6
Roadmap Versions:
New Comment:

-Status: Open
+Status: Feedback
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PEAR.





Previous Comments:
------------------------------------------------------------------------

[2008-06-24 06:38:37] unomi

Description:
------------
When running docblockgen on one of our files, it suddenly prompted (via
Xdebug), that an index is undefined. It all happens in the guessReturn
function, where $var['value'] sometimes is not defined, so a Undefined
index: 'value' occurs.

Another one is in the function isAVar where the $id gets incremented
during the if-statements. But if all the statements fail, the 'else'
false back at the end has to deal with an $id that has been incremented.
But then a Undefined offset: 1 occurs.

Expected result:
----------------
Sorry, I can't provide you with an example, but the description should
be explainatory. The only thing I can give you that type 319
(T_ENDWHILE) of the tokens didn't had a 'value' index.

Actual result:
--------------
Sorry, I can't provide an actual result either. The functions mentioned
are flawed and should be fixed. That's all that I can say. An extra
check on the 'value' index should be sufficient and in the function
isAVar there should be a default current value for $tokens[$id]. After
that the $id gets incremented, but the 'else' fallback statement depends
on what was current before the if statements. Like:

$cur = $tokens[$id];

if (++$id stuff etc.) {
elseif (++$id stuff etc.) {
elseif (++$id stuff etc.) {
else {
$var = $cur;
}

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 9, '10 at 8:20p
activeAug 9, '10 at 8:20p
posts1
users1
websitepear.php.net

1 user in discussion

Hm2k: 1 post

People

Translate

site design / logo © 2022 Grokbase