[PHP-DOC] Bug #16227 Updated: Using internal hash position is tricky.
ID: 16227 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Documentation problem Operating System: ANY PHP Version: PHP4 only New Comment: OK, as a newbie PHP-er (experienced with Perl and Java) the documentation I've been using suggested using that example before foreach(). The foreach() behavior is free from the problem it seems, even though documentation for foreach() on php.net claims that they should be equivalent. Can anyone explain to this newbie why the (while list each) version was the "intended behavior"? Of course, having to use reset() seems kind of odd to me anyway, but I wonder what was "wrong" with my first code... PHP seems to look like it has Perl's "more than one way to do it", but only in very limited areas. (I suppose if push came to shove I could go back to using my own array walkers, but still...) Previous Comments: [2002-03-23 07:10:07] [EMAIL PROTECTED] Ok. Then this is documentation problem. (I would like to hear from Andi or Zeev, though) There should be note that internal hash position is reset if value is assigned. (Both LVALUE and RVLAUE. They are the same value anyway.) Also, reference counting side effect should be documented fully. BTW, to fix this misbihavior, we need a additional variable to keep track of hash position for each zval. (and change related codes) PHP3 does not have problem, since it does not have reference counting. [2002-03-23 06:46:24] [EMAIL PROTECTED] It's not a flaw, it's designed like this. Derick [2002-03-23 06:39:14] [EMAIL PROTECTED] Derick, foreach() does not solve this bug. ZendEngine is resetting internal hash position by an assignment. Therefore, foreach() does does not work. i.e. The issue is _not_ "Not resetting hash posisiton", but "Incorrectly resetting RVALUE hash position by an assignment". This is serious flaw in language. [2002-03-23 06:01:49] [EMAIL PROTECTED] Not a bug, but intended behavior. Use foreach(). Derick [2002-03-22 20:55:39] [EMAIL PROTECTED] BTW, I haven't check the exact behavior. Zend might be resetting internal hash position due to the assignment. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/16227 -- Edit this bug report at http://bugs.php.net/?id=16227&edit=1
[PHP-DOC] Bug #16800 Updated: problem with registration an array variable in session
ID: 16800 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Documentation problem Operating System: linux PHP Version: 4.1.2 New Comment: @ [EMAIL PROTECTED]: I hope that should be a bad joke ... I've tested the code below with 4.1.1 and it worked. (session support is broken in 4.1.2 AFAIK) $bar = array( 'something' => array( 1,2,3,4 ), 'nothing' => NULL, 'test' => true, 'test2' => array( 'x','y'=>2 ) ); session_register('bar'); Previous Comments: [2002-04-24 12:49:19] [EMAIL PROTECTED] I made it a documentation problem. The manual page for 'session_register()' should explicitly mention this. [2002-04-24 12:47:56] [EMAIL PROTECTED] arrays can't be registered in sessions. However, you can store a serialized array: $arr = serialize($array); session_register($arr); -daniel [2002-04-24 12:46:52] [EMAIL PROTECTED] The bug system is not the appropriate forum for asking support questions. For a list of a range of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php [2002-04-24 12:28:56] [EMAIL PROTECTED] I've tried to register a seesion variable $array[$i] with sessionn_register(), where $i is an integer index, but failed. In a temporary session file in my /tmp directory I found a declaration like !array[0]|, and now values. Please help! Thanks -- Edit this bug report at http://bugs.php.net/?id=16800&edit=1
[PHP-DOC] Bug #17608: array_reduce
From: [EMAIL PROTECTED] Operating system: All PHP version: 4.2.1 PHP Bug Type: Documentation problem Bug description: array_reduce [ www.php.net/manual/en/function.array-reduce.php ] >>> mixed array_reduce ( array input, mixed callback [, int initial]) <<< I think "mixed callback" should be changed to "string callback". Furthermore, it would be a good idea to describe what parameters a given callback function should have/handle. -- Edit bug report at http://bugs.php.net/?id=17608&edit=1 -- Fixed in CVS:http://bugs.php.net/fix.php?id=17608&r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=17608&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17608&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17608&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17608&r=support Expected behavior: http://bugs.php.net/fix.php?id=17608&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17608&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17608&r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=17608&r=globals
[PHP-DOC] Bug #17608 Updated: array_reduce
ID: 17608 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: All PHP Version: 4.2.1 New Comment: Ok, I've tested it and it worked as you descriebed. My fault. Previous Comments: [2002-06-05 08:30:30] [EMAIL PROTECTED] Callbacks can be arrays array($obj, "methodname") as far as I can remember, so it's right as mixed callback IMHO. Goba [2002-06-05 08:10:59] [EMAIL PROTECTED] [ www.php.net/manual/en/function.array-reduce.php ] >>> mixed array_reduce ( array input, mixed callback [, int initial]) <<< I think "mixed callback" should be changed to "string callback". Furthermore, it would be a good idea to describe what parameters a given callback function should have/handle. -- Edit this bug report at http://bugs.php.net/?id=17608&edit=1
[PHP-DOC] Bug #15537: ref.gettext.html - weird
From: [EMAIL PROTECTED] Operating system: all PHP version: 4.1.1 PHP Bug Type: Documentation problem Bug description: ref.gettext.html - weird ref.gettext.html / XXXV. Gettext: [...] dcngettext -- Plural version of dcgettext() Plural version of dcgettext dgettext -- Override the current domain dcngettext -- Plural version of dcgettext() Plural version of dgettext [...] -- Edit bug report at http://bugs.php.net/?id=15537&edit=1 -- Fixed in CVS:http://bugs.php.net/fix.php?id=15537&r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=15537&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=15537&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=15537&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=15537&r=support Expected behavior: http://bugs.php.net/fix.php?id=15537&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=15537&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=15537&r=submittedtwice
[PHP-DOC] Bug #15592: misc - exit - missing line break
From: [EMAIL PROTECTED] Operating system: All PHP version: 4.1.1 PHP Bug Type: Documentation problem Bug description: misc - exit - missing line break -> Miscellaneous functions -> exit missing líne break in description: >>> void exit ( [string status])void exit ( int status) <<< (http://www.php.net/manual/en/function.exit.php) -- Edit bug report at http://bugs.php.net/?id=15592&edit=1 -- Fixed in CVS:http://bugs.php.net/fix.php?id=15592&r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=15592&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=15592&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=15592&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=15592&r=support Expected behavior: http://bugs.php.net/fix.php?id=15592&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=15592&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=15592&r=submittedtwice