|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-12-30 15:13 UTC] cmb@php.net
-Status: Open
+Status: Suspended
-Package: Feature/Change Request
+Package: *General Issues
[2016-12-30 15:13 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ Currently it is possible to specify class types for function arguments. It would be very helpful to also add an ability to set types for function return values, variables (local and global) and especially for class members. In general - to improve types checking when it is required by programmer, it will help to eliminate hidden errors that are sometimes hard to find now. For example: class Foo { private Foo $next; function Foo getNext() { return $this->next; } } class Bar { private Foo $foo; function doo(Foo $prevFoo) { Foo $newFoo = $prevFoo->getNext(); $this->foo = $newFoo; } }