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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fgheorghe at grosan dot co dot uk
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 22:01:33 2025 UTC