#29885 [NEW]: recursive functions on get_defined_vars() in PHP5
| From: | nospamplease at veganismus dot ch | Date: | Sun, 29 Aug 2004 21:42:54 +0000 |
| Subject: | #29885 [NEW]: recursive functions on get_defined_vars() in PHP5 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-65424@lists.php.net to get a copy of this message | ||
From: nospamplease at veganismus dot ch
Operating system: WinXP
PHP version: 5.0.1
PHP Bug Type: *General Issues
Bug description: recursive functions on get_defined_vars() in PHP5
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 bug report at http://bugs.php.net/?id=29885&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29885&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29885&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29885&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=29885&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29885&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29885&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29885&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29885&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29885&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29885&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29885&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29885&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29885&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29885&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29885&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29885&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29885&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29885&r=float