com php-src: Added test (error message should be the same independently of called function): Zend/tests/type_declarations/typed_proper ties_044.phpt
| From: | Bob Weinand | Date: | Tue, 24 May 2016 12:16:25 +0000 |
| Subject: | com php-src: Added test (error message should be the same independently of called function): Zend/tests/type_declarations/typed_proper ties_044.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95538@lists.php.net to get a copy of this message | ||
Commit: 4b28b0db4bbc5296f278c7588e88acd313c083b3
Author: Dmitry Stogov <dmitry@zend.com> Tue, 24 May 2016 15:16:25 +0300
Parents: 88def3f76e6258ed21e802a02631ce3cdc2f486d
Branches: typed_ref_properties
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4b28b0db4bbc5296f278c7588e88acd313c083b3
Log:
Added test (error message should be the same independently of called function)
Changed paths:
A Zend/tests/type_declarations/typed_properties_044.phpt
Diff:
diff --git a/Zend/tests/type_declarations/typed_properties_044.phpt
b/Zend/tests/type_declarations/typed_properties_044.phpt
new file mode 100644
index 0000000..be64f74
--- /dev/null
+++ b/Zend/tests/type_declarations/typed_properties_044.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Proper source duplication on assignment to typed property
+--FILE--
+<?php
+class Foo {
+ public int $bar;
+}
+
+function foo(&$x) {
+}
+
+$f = function (&$x) {};
+
+$foo = new Foo();
+try {
+ foo($foo->bar);
+} catch (Throwable $e) {
+ echo $e->getMessage() . "\n";
+}
+try {
+ $f($foo->bar);
+} catch (Throwable $e) {
+ echo $e->getMessage() . "\n";
+}
+--EXPECT--
+Typed property Foo::$bar must not be referenced
+Typed property Foo::$bar must not be referenced