Req #68979 [Opn->Wfx]: var_export generates useless empty string

From: Date: Tue, 02 Oct 2018 11:09:52 +0000
Subject: Req #68979 [Opn->Wfx]: var_export generates useless empty string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217350@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68979&edit=1

 ID:                 68979
 Updated by:         yohgaki@php.net
 Reported by:        chris dot kde at gmail dot com
 Summary:            var_export generates useless empty string
-Status:             Open
+Status:             Wont fix
 Type:               Feature/Change Request
 Package:            Variables related
 Operating System:   linux
 PHP Version:        5.6.5
 Block user comment: N
 Private report:     N

 New Comment:

Indeed. Won't fix would be appropriate.


Previous Comments:
------------------------------------------------------------------------
[2018-09-23 12:41:29] cmb@php.net

> Older PHP escaped NULL to \000.

However, that was wrong since it was a single-quoted string. This
issue had been reported as bug #42272, and fixed with commit
63dcbb7[1] and dc30b00[2], which introduced the overly verbose but
correct output.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=63dcbb73f0223f98c8666cee15e73a60891e0191>
[2] <http://git.php.net/?p=php-src.git;a=commit;h=dc30b0035d098b6e982c432c8d81919524f1d9fd>

------------------------------------------------------------------------
[2015-02-27 05:15:12] yohgaki@php.net

http://3v4l.org/hsMCN

Older PHP escaped NULL to \000.

------------------------------------------------------------------------
[2015-02-03 14:37:37] chris dot kde at gmail dot com

Description:
------------
Hello,
var_export generates useless empty string in some specials cases (tested on 5.6.2)

Test script:
---------------
$data = "\0\0\0\0\0\0\0";
var_export($data);

echo "\n\n";

$data = "ok\0\0\0ab";
var_export($data);

Expected result:
----------------
"\0\0\0\0\0\0\0"

'ok' . "\0\0\0" . 'ab'

Actual result:
--------------
'' . "\0" . '' . "\0" . '' . "\0" .
'' . "\0" . '' . "\0" . '' . "\0" .
'' . "\0" . ''

'ok' . "\0" . '' . "\0" . '' . "\0" .
'ab'


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



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


Thread (4 messages)

« previous php.bugs (#217350) next »