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

From: Date: Tue, 20 Jan 2015 14:41:57 +0000
Subject: Bug #51362 [Nab]: var_export() second argument ignored on recursion fatal error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190076@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
 User updated by:    daan at react dot com
 Reported by:        daan at react dot com
 Summary:            var_export() second argument ignored on recursion
                     fatal error
 Status:             Not a bug
 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:

It seems to have been fixed in the version after I reported it: (5.2.14) - http://3v4l.org/UUcqM


Previous Comments:
------------------------------------------------------------------------
[2015-01-19 23:12:08] derick@php.net

Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

I can not reproduce this with PHP 5.2.18 (or PHP 5.3.29 or later).

------------------------------------------------------------------------
[2012-01-13 12:03:12] dduniec at go2 dot pl

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.

------------------------------------------------------------------------
[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 (#190076) next »