php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67200 Creation of $parent psuedo-variable
Submitted: 2014-05-04 05:47 UTC Modified: 2014-05-04 05:52 UTC
From: todd at toddcrane dot com Assigned:
Status: Wont fix Package: Unknown/Other Function
PHP Version: Irrelevant OS: Ubuntu 12.04
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
45 - 33 = ?
Subscribe to this entry?

 
 [2014-05-04 05:47 UTC] todd at toddcrane dot com
Description:
------------
I am requesting a pseudo variable be created to reference an instance's parent instance. For example, within an instance of class 'team' there are instances of class 'players' created. This will allow public methods and properties belonging to the 'team' instance to be called from one of the 'players' instance.

Test script:
---------------
http://pastebin.com/eLBnx1dY


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-05-04 05:52 UTC] requinix@php.net
-Status: Open +Status: Wont fix
 [2014-05-04 05:52 UTC] requinix@php.net
The concept of "an instance's parent instance" is completely dependent on your code and the application. It would make no sense for PHP itself to implement something like that.

Make player's constructor take a parameter for the "parent" team. Problem solved.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 21:01:29 2024 UTC