For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > January 2006 > #35846 [Bgs->Opn]: var_export() generate invalid code









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #35846 [Bgs->Opn]: var_export() generate invalid code
derick@php.net

2006-01-09, 8:02 pm

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com