ID: 29885 Updated by: [EMAIL PROTECTED] Reported By: nospamplease at veganismus dot ch -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: WinXP PHP Version: 5.0.1 New Comment:
This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2004-08-31 07:07:34] [EMAIL PROTECTED] PHP5's get_defined_vars() return's $GLOBALS, which is a recursive array, which will cause count() to crash. Moving this as a documentation bug. ------------------------------------------------------------------------ [2004-08-29 23:42:53] nospamplease at veganismus dot ch Description: ------------ it seems that you cant use any recursive function on get_defined_vars() in PHP5. <? $arr = get_defined_vars(); echo 'Number of Defined Vars: '; echo count($arr,COUNT_RECURSIVE); ?> in PHP4 this will output some integer like "199" as expected. in PHP5 this doesnt even output any error report. I just get a "connection closed by server" message or the like. When changing line 3 to <? echo count($arr); // nonrecursive ?> it outputs something like "7" (which seems to be correct). also if i use any multi-dimensional array instead of get_defined_vars() the result will be correct. Reproduce code: --------------- <? $arr = get_defined_vars(); echo 'Number of Defined Vars: '; echo count($arr,COUNT_RECURSIVE); ?> Expected result: ---------------- Number of Defined Vars: 199 Actual result: -------------- The result is nothing (no errormessage by PHP5 or Apache2) so the acctualy displayed message depends on the browser: Modzilla: The document contains no data. Opera: connection closed by server M$IE: Page Cannot Be Displayed ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29885&edit=1