Bug #51362 [Com]: var_export() second argument ignored on recursion fatal error

From: Date: Fri, 13 Jan 2012 12:03:12 +0000
Subject: Bug #51362 [Com]: var_export() second argument ignored on recursion fatal error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-166422@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=51362&edit=1

 ID:                 51362
 Comment by:         dduniec at go2 dot pl
 Reported by:        daan at react dot com
 Summary:            var_export() second argument ignored on recursion
                     fatal error
 Status:             Assigned
 Type:               Bug
 Package:            Output Control
 Operating System:   Debian Etch
 PHP Version:        5.2.13
 Assigned To:        derick
 Block user comment: N
 Private report:     N

 New Comment:

I've just experience that error during debug on production environment. I've used 
it with debug_backtrace() var_export(debug_backtrace(), true) ... it outputs all 
information on the screen before nesting level error.


Previous Comments:
------------------------------------------------------------------------
[2010-04-13 20:37:33] neel dot basu dot z at gmail dot com

Looks like similar to http://bugs.php.net/51533

------------------------------------------------------------------------
[2010-03-23 12:40:11] daan at react dot com

Description:
------------
When calling var_export() on a recursive array, with the 'return' parameter set to true, a
partial var_exported string is echoed and then a fatal error is raised. 
A more correct handling should be to just raise the php fatal error, not output the partial string.
(sensitive data might be accidentally shown, for example)

Test script:
---------------
$recursive = array();
$recursive[] = &$recursive; 

$test = var_export($recursive, true);

Expected result:
----------------
Fatal error: Nesting level too deep - recursive dependency? in test.php on line x

Actual result:
--------------
array ( 0 => array ( 0 => array ( 0 => array ( 0 => array ( 
Fatal error: Nesting level too deep - recursive dependency? in test.php on line x


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



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=51362&edit=1


Thread (6 messages)

« previous php.bugs (#166422) next »