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
 [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-2019 The PHP Group
All rights reserved.
Last updated: Fri May 24 21:01:26 2019 UTC