com php-src: Added tests: Zend/tests/type_declarations/typed _properties_042.phpt Zend/tests/type_declaratio ns/typed_properties_043.phpt
| From: | Bob Weinand | Date: | Tue, 24 May 2016 11:56:10 +0000 |
| Subject: | com php-src: Added tests: Zend/tests/type_declarations/typed _properties_042.phpt Zend/tests/type_declaratio ns/typed_properties_043.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95546@lists.php.net to get a copy of this message | ||
Commit: 88def3f76e6258ed21e802a02631ce3cdc2f486d
Author: Dmitry Stogov <dmitry@zend.com> Tue, 24 May 2016 14:56:10 +0300
Parents: e5f9ada308a1c2c75bf0a2487740b4d945b42e07
Branches: typed_ref_properties
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=88def3f76e6258ed21e802a02631ce3cdc2f486d
Log:
Added tests
Changed paths:
A Zend/tests/type_declarations/typed_properties_042.phpt
A Zend/tests/type_declarations/typed_properties_043.phpt
Diff:
diff --git a/Zend/tests/type_declarations/typed_properties_042.phpt
b/Zend/tests/type_declarations/typed_properties_042.phpt
new file mode 100644
index 0000000..fdaeab6
--- /dev/null
+++ b/Zend/tests/type_declarations/typed_properties_042.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Proper source duplication on assignment to typed property
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.protect_memory=1
+--FILE--
+<?php
+class Foo {
+ public int $bar;
+}
+
+$foo = new Foo();
+
+for ($i = 0; $i < 5; $i++) {
+ $foo->bar = "5";
+ var_dump($foo->bar);
+}
+?>
+--EXPECT--
+int(5)
+int(5)
+int(5)
+int(5)
+int(5)
\ No newline at end of file
diff --git a/Zend/tests/type_declarations/typed_properties_043.phpt
b/Zend/tests/type_declarations/typed_properties_043.phpt
new file mode 100644
index 0000000..ef07d1a
--- /dev/null
+++ b/Zend/tests/type_declarations/typed_properties_043.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Proper source duplication on assignment to typed property
+--INI--
+opcache.enable=0
+opcache.enable_cli=0
+--FILE--
+<?php
+class Foo {
+ public int $bar;
+}
+
+$foo = new Foo();
+
+for ($i = 0; $i < 5; $i++) {
+ $foo->bar = "5";
+ var_dump($foo->bar);
+}
+?>
+--EXPECT--
+int(5)
+int(5)
+int(5)
+int(5)
+int(5)
\ No newline at end of file