#35846 [Bgs->Opn]: var_export() generate invalid code
| From: | derick@php.net | Date: | Fri, 30 Dec 2005 09:47:37 +0000 |
| Subject: | #35846 [Bgs->Opn]: var_export() generate invalid code | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969371383@lists.php.net to get a copy of this message | ||
ID: 35846
Updated by: derick@php.net
Reported By: xing at mac dot com
-Status: Bogus
+Status: Open
-Bug Type: Variables related
+Bug Type: Documentation problem
Operating System: centos 4.2
PHP Version: 5.1.2RC1
New Comment:
I don't think this is documented though...
Previous Comments:
------------------------------------------------------------------------
[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