com php-src: Added test (memory leaks): Zend/tests/type_decla rations/typed_properties_052.phpt
| From: | Bob Weinand | Date: | Wed, 25 May 2016 10:39:38 +0000 |
| Subject: | com php-src: Added test (memory leaks): Zend/tests/type_decla rations/typed_properties_052.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95513@lists.php.net to get a copy of this message | ||
Commit: 291d4315a65e7939341a121c369ab5c935d40765
Author: Dmitry Stogov <dmitry@zend.com> Wed, 25 May 2016 13:39:38 +0300
Parents: e1017f904da8ac146fcdbd13e8f1fa02efcf4e9a
Branches: typed_ref_properties
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=291d4315a65e7939341a121c369ab5c935d40765
Log:
Added test (memory leaks)
Changed paths:
A Zend/tests/type_declarations/typed_properties_052.phpt
Diff:
diff --git a/Zend/tests/type_declarations/typed_properties_052.phpt
b/Zend/tests/type_declarations/typed_properties_052.phpt
new file mode 100644
index 0000000..418db0e
--- /dev/null
+++ b/Zend/tests/type_declarations/typed_properties_052.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Class properties declared in eval() must not leak
+--FILE--
+<?php
+
+eval(<<<'EOF'
+class A {
+ public A $a1;
+ public \B $b1;
+ public Foo\C $c1;
+ public ?A $a2;
+ public ?\B $b2;
+ public ?Foo\C $c2;
+}
+EOF
+);
+$obj = new A;
+var_dump($obj);
+?>
+--EXPECT--
+object(A)#1 (3) {
+ ["a1"]=>
+ uninitialized(A)
+ ["b1"]=>
+ uninitialized(B)
+ ["c1"]=>
+ uninitialized(Foo\C)
+ ["a2"]=>
+ NULL
+ ["b2"]=>
+ NULL
+ ["c2"]=>
+ NULL
+}