#35846 [Opn->Bgs]: var_export() generate invalid code
| From: | vrana@php.net | Date: | Tue, 03 Jan 2006 17:14:33 +0000 |
| Subject: | #35846 [Opn->Bgs]: var_export() generate invalid code | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969371419@lists.php.net to get a copy of this message | ||
ID: 35846
Updated by: vrana@php.net
Reported By: xing at mac dot com
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: centos 4.2
PHP Version: 5.1.2RC1
New Comment:
Meaning of __set_state() is explained in var_export() documentation.
Previous Comments:
------------------------------------------------------------------------
[2005-12-30 10:47:36] derick@php.net
I don't think this is documented though...
------------------------------------------------------------------------
[2005-12-30 06:45:39] sniper@php.net
There is no such function in PHP that can handle fatal errors any other
way than as a fatal error.
------------------------------------------------------------------------
[2005-12-30 02:00:57] xing at mac dot com
Description:
------------
invalid php code from var_export contrary to documentation claims.
Reproduce code:
---------------
<?
class query_result {
public $affected_rows = 0;
public $num_rows = 0;
public $insert_id = 0;
public $result = array(); //pdo result
public $pointer = 0;
}
$test = array(
"test" => new query_result()
);
$dump = var_export($test, TRUE);
file_put_contents("test.txt","<? ". $dump . "?>");
include("test.txt");
die();
?>
Expected result:
----------------
no php error
Actual result:
--------------
PHP Fatal error: Call to undefinied query_result::__set_state() in
test.txt line 3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35846&edit=1