Req #60050 [Opn->Nab]: var_export should not add space at end of line

From: Date: Mon, 16 Mar 2015 07:41:51 +0000
Subject: Req #60050 [Opn->Nab]: var_export should not add space at end of line
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191412@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60050&edit=1 ID: 60050 Updated by: demon@php.net Reported by: jerome at despatis dot com Summary: var_export should not add space at end of line -Status: Open +Status: Not a bug Type: Feature/Change Request Package: *General Issues Operating System: Ubuntu - Linux PHP Version: 5.3.8 Block user comment: N Private report: N New Comment: I don't think it's a bug and seems the patch will produce a lot of BC breaks. Thanks. Previous Comments: ------------------------------------------------------------------------ [2011-10-13 08:45:32] jerome at despatis dot com Description: ------------ With an array that contains an array, the var_export adds an extra space at end of line => It forces post treatment to suppress those extra spaces, before saving output to a file As spaces at end of line is not a recommended practice... Test script: --------------- <?php $test = array('string' =>array('foo')); var_export($test); ?> Expected result: ---------------- array ( 'string' =>// <= the line should end with '=>', and not with a space e.g '=> ' array ( 0 => 'foo', ), ) Actual result: -------------- array ( 'string' => // <= there's a space after the '=>' symbol array ( 0 => 'foo', ), ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60050&edit=1

« previous php.bugs (#191412) next »