diff options
author | Levi Morrison <levim@php.net> | 2015-01-08 23:40:36 +0300 |
---|---|---|
committer | Levi Morrison <levim@php.net> | 2015-01-27 11:49:56 -0700 |
commit | c8576c5a46508ce87f7d2eb2442e6a9283b6a1ce (patch) | |
tree | 65a6b0195b60631537af97e7acd726aec127c732 /Zend/tests/return_types/inheritance001.phpt | |
parent | 0290571ccfb3a440599ca009e97f2879bb1d09f0 (diff) | |
download | php-git-c8576c5a46508ce87f7d2eb2442e6a9283b6a1ce.tar.gz |
Implement return types
RFC is documented here: https://wiki.php.net/rfc/return_types
Diffstat (limited to 'Zend/tests/return_types/inheritance001.phpt')
-rw-r--r-- | Zend/tests/return_types/inheritance001.phpt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Zend/tests/return_types/inheritance001.phpt b/Zend/tests/return_types/inheritance001.phpt new file mode 100644 index 0000000000..ce33d97995 --- /dev/null +++ b/Zend/tests/return_types/inheritance001.phpt @@ -0,0 +1,16 @@ +--TEST-- +Return type covariance; extends class + +--FILE-- +<?php + +class A { + function foo(): A {} +} + +class B extends A { + function foo(): StdClass {} +} + +--EXPECTF-- +Fatal error: Declaration of B::foo() must be compatible with A::foo(): A in %s on line %d |