com php-src: add unset test: Zend/tests/type_declarations/typ ed_properties_009.phpt

From: Date: Mon, 07 Mar 2016 09:52:19 +0000
Subject: com php-src: add unset test: Zend/tests/type_declarations/typ ed_properties_009.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95624@lists.php.net to get a copy of this message
Commit: 48c98abf1b42a97a0e16b8ead2ce0363e9715eb7 Author: Joe Watkins <krakjoe@php.net> Mon, 7 Mar 2016 09:52:19 +0000 Parents: ab3e992dfdceb52f42b57780ff43300e25ed5ac4 Branches: typed_ref_properties Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=48c98abf1b42a97a0e16b8ead2ce0363e9715eb7 Log: add unset test Changed paths: A Zend/tests/type_declarations/typed_properties_009.phpt Diff: diff --git a/Zend/tests/type_declarations/typed_properties_009.phpt b/Zend/tests/type_declarations/typed_properties_009.phpt new file mode 100644 index 0000000..75c3521 --- /dev/null +++ b/Zend/tests/type_declarations/typed_properties_009.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test typed disallow unset +--FILE-- +<?php +class Foo { + public int $bar; +} + +$foo = new Foo(); +unset($foo->bar); +?> +--EXPECTF-- +Fatal error: Uncaught TypeError: Foo::$bar must not be unset in %s:7 +Stack trace: +#0 {main} + thrown in %s on line 7 + +

« previous php.cvs (#95624) next »