Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Dec 2009 at 15:50 UTC
Updated:
12 Feb 2010 at 19:40 UTC
This patch implements a workaround for a known bug in var_export() which fails to export stdClass objects correctly:
http://bugs.php.net/bug.php?id=48016&edit=1
You can see the #fail for yourself:
$foo = array(
'object' => (object) (array(
'foo' => 'bar',
)),
);
$foo = var_export($foo, TRUE);
eval('$foo = '. $foo .';');
This workaround casts using (object) rather than the missing __set_state() method and only targets stdClass objects.
First noticed on #655362: Exporting object variables causes PHP fatal errors..
| Comment | File | Size | Author |
|---|---|---|---|
| ctools_var_export_stdclass.patch | 956 bytes | yhahn |
Comments
Comment #1
merlinofchaos commentedMakes sense. Committed!