From:             manu at chasqui dot cu
Operating system: Windows Xp-Pro/Apache 1.3.24
PHP version:      4.3.3
PHP Bug Type:     Feature/Change Request
Bug description:  var-exports fails to produce valid PHP in some cases

Description:
------------
var_export fails to reproduce valid code when dumping several nested
objects.

Reproduce code:
---------------
<?php
class VE_Test
{
    var $child;
}

$ve_child = new VE_Test();
$ve_child->child = NULL;

$ve_parent = new VE_Test();
$ve_parent->child = &$ve_child;

var_export($ve_parent);
?>

Expected result:
----------------
Actually I can't make a proposal without requiring more from PHP:

with (new VE_Test()){
  child = 
    with (new VE_Test()){
       child = NULL;
    }
}

This is just a proposal, there can be other better ways.

Actual result:
--------------
class ve_test {
  var $child =
  class ve_test {
    var $child = NULL;
  };
}

Which fails to compile:
Parse error: parse error, unexpected T_CLASS in
d:\inetpub\tests\tests\php\vd.php on line 4

-- 
Edit bug report at http://bugs.php.net/?id=25837&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25837&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25837&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25837&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25837&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25837&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25837&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25837&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25837&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25837&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25837&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25837&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25837&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25837&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25837&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25837&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25837&r=float

Reply via email to