note 50830 added to function.var-export
| From: | rwruck at osu1 dot php dot net | Date: | Fri, 11 Mar 2005 00:12:27 +0000 |
| Subject: | note 50830 added to function.var-export | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86230@lists.php.net to get a copy of this message | ||
The returned representation is NOT always valid PHP code.
At least as of PHP 4.3.9, if you var_export objects as in:
<?php
class MyClass { }
echo '$var = '.var_export(array(1, new MyClass(), 2), true).';';
?>
The result will be unparsable:
$var = array (
0 => 1,
1 =>
class myclass {
},
2 => 2,
);
----
Manual Page -- http://www.php.net/manual/en/function.var-export.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50830
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50830&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50830&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50830&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50830&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50830&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50830&report=yes
Search -- http://master.php.net/manage/user-notes.php