]> granicus.if.org Git - php/commitdiff
Fixed bug #27641 (Object cloning in ze1_compatibility_mode was reimplemented)
authorDmitry Stogov <dmitry@php.net>
Wed, 24 Mar 2004 13:16:07 +0000 (13:16 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 24 Mar 2004 13:16:07 +0000 (13:16 +0000)
NEWS
Zend/tests/bug27641.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 0746cf5e0bda79d98a1f1f3423ab6fa4ff101fc8..c2ff6010521fead60fb2410760c54da6d40e4d60 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ????? 2004, PHP 5 Release Candidate 2
+- Fixed bug #27641 (Object cloning in ze1_compatibility_mode was reimplemented)
+  (Dmitry, Andi)
 - Changed sqlite's OO API to studlyCaps. (Marcus)
 - Fixed bug #27646 (Cannot serialize/unserialize non-finite numeric values).
   (Marcus)
diff --git a/Zend/tests/bug27641.phpt b/Zend/tests/bug27641.phpt
new file mode 100644 (file)
index 0000000..f4042f9
--- /dev/null
@@ -0,0 +1,42 @@
+--TEST--
+Bug #27641 (zend.ze1_compatibility_mode = On causes object properties to be misreported)
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
+--FILE--
+<?php
+  class A {
+    public $a = "Default for A";
+    public $b = "Default for B";
+
+    function __construct($a, $b) {
+      $this->a = $a;
+      $this->b = $b;
+    }
+    function A() {
+      $args = func_get_args();
+      call_user_func_array(Array(&$this, '__construct'), $args);
+    }
+  }
+
+  $t = new A("New A", "New B");
+  print_r($t);
+  print_r(get_class_vars(get_class($t)));
+  print_r(get_object_vars($t));
+?>
+--EXPECTF--
+Strict Standards: Redefining already defined constructor for class A in %sbug27641.php on line %d
+A Object
+(
+    [a] => New A
+    [b] => New B
+)
+Array
+(
+    [a] => Default for A
+    [b] => Default for B
+)
+Array
+(
+    [a] => New A
+    [b] => New B
+)