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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: todd at toddcrane dot com
New email:
PHP Version: OS:

 

 [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: Fri May 24 12:01:32 2024 UTC