php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #72775 C++ Style Method Overloading
Submitted: 2016-08-07 13:56 UTC Modified: 2016-08-07 14:13 UTC
From: fgheorghe at grosan dot co dot uk Assigned: cmb (profile)
Status: Duplicate Package: *General Issues
PHP Version: Next Major Version OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
18 + 11 = ?
Subscribe to this entry?

 
 [2016-08-07 13:56 UTC] fgheorghe at grosan dot co dot uk
Description:
------------
PHP made great progress by adding function return and parameter types. It would be great to push it to a new level and allow for C++ style method overloading, to enable different types of constructors, and function signatures.

Use cases:

Construct a class by a numeric id:
__construct(int $id)

Construct a class by a given string identifier:
__construct(string $name)



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-07 14:07 UTC] cmb@php.net
-Status: Open +Status: Closed -Package: PHP Language Specification +Package: *General Issues -Assigned To: +Assigned To: cmb
 [2016-08-07 14:07 UTC] cmb@php.net
Duplicate of request #69961.
 [2016-08-07 14:13 UTC] nikic@php.net
-Status: Closed +Status: Duplicate
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC