|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63837 Privater abstract functions
Submitted: 2012-12-22 19:47 UTC Modified: 2013-01-26 11:12 UTC
From: larry at ldrutlege dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.4.10 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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: larry at ldrutlege dot com
New email:
PHP Version: OS:


 [2012-12-22 19:47 UTC] larry at ldrutlege dot com
From the page

"Abstract private methods were supported between PHP 5.0.0 and PHP 5.0.4, but were then disallowed on the grounds that the behaviours of private and abstract are mutually exclusive."

This was true in PHP 5.3 and earlier since any method declared abstract private could not be accessed outside the declaring class and so the definition was without function.

In PHP 5.4 and later however, traits may have access to private methods of a class and so an abstract private definition may have a purpose. For instance, traits may have need of helper methods which may be needed only by the trait's methods and nowhere else. In those cases, an abstract private method may be the appropriate declaration to place in the trait to ensure the helper method is defined in the using class.

Abstract private methods however remain useless except within traits, so within traits is the only place they need to be permitted.

And as an aside, the word "behaviors" is misspelled on that page.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-22 19:51 UTC] larry at ldrutlege dot com
Actually not misspelled per se, but spelled according to British spelling whereas the English site seems to primarily use American spelling.
 [2013-01-26 11:12 UTC]
-Status: Open +Status: Not a bug
 [2013-01-26 11:12 UTC]
The page referenced concerns migration from 5.0 to 5.1

None of this is relevant.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 00:01:28 2024 UTC