php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #43102 Request for type hinting of class properties
Submitted: 2007-10-24 20:59 UTC Modified: 2018-05-05 19:03 UTC
Votes:29
Avg. Score:4.7 ± 0.6
Reproduced:24 of 24 (100.0%)
Same Version:14 (58.3%)
Same OS:19 (79.2%)
From: fjas at free dot fr Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.2.4 OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fjas at free dot fr
New email:
PHP Version: OS:

 

 [2007-10-24 20:59 UTC] fjas at free dot fr
Description:
------------
PHP5 allows to type hint function parameters.
I like the possibility to have the choice, between type hinting, or not.

But it would be so nice to have the same optional behaviour with class properties...
Is it logical to allow type hinting for parameters, and not for properties ???


Expected result:
----------------
Class B {
 (...)
}

Class A {
 public B $b
 (...)
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-05 19:03 UTC] requinix@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2018-05-05 19:03 UTC] requinix@php.net
Considered and declined. https://wiki.php.net/rfc/typed-properties
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 04:01:30 2024 UTC