com php-src: another test: Zend/tests/type_declarations/typed _properties_005.phpt

From: Date: Sun, 06 Mar 2016 18:49:25 +0000
Subject: com php-src: another test: Zend/tests/type_declarations/typed _properties_005.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95634@lists.php.net to get a copy of this message
Commit: 8c51aacd1fe32c93e844928f80c3f4219666eb7f Author: Joe Watkins <krakjoe@php.net> Sun, 6 Mar 2016 18:49:25 +0000 Parents: 3dfb8c21c59d4260986b01d65dd38658aa09f138 Branches: typed_ref_properties Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8c51aacd1fe32c93e844928f80c3f4219666eb7f Log: another test Changed paths: A Zend/tests/type_declarations/typed_properties_005.phpt Diff: diff --git a/Zend/tests/type_declarations/typed_properties_005.phpt b/Zend/tests/type_declarations/typed_properties_005.phpt new file mode 100644 index 0000000..1b2d7f4 --- /dev/null +++ b/Zend/tests/type_declarations/typed_properties_005.phpt @@ -0,0 +1,20 @@ +--TEST-- +Test typed properties error condition (type mismatch object) +--FILE-- +<?php +class Dummy {} + +new class(new Dummy) { + public stdClass $std; + + public function __construct(Dummy $dummy) { + $this->std = $dummy; + } +}; +?> +--EXPECTF-- +Fatal error: Uncaught TypeError: class@anonymous::$std must be an instance of stdClass in %s:8 +Stack trace: +#0 %s(4): class@anonymous->__construct(Object(Dummy)) +#1 {main} + thrown in %s on line 8

« previous php.cvs (#95634) next »