[TYPO3-core] #53682, PHP 5.5.6, call-time pass-by-reference, PHP 5.6

Markus Klein klein.t3 at mfc-linz.at
Fri Dec 13 11:28:33 CET 2013


+1 on all tracks!

Kind regards
Markus

------------------------------------------------------------
Markus Klein
TYPO3 CMS Active Contributors Team Member


> -----Original Message-----
> From: typo3-team-core-bounces at lists.typo3.org [mailto:typo3-team-core-
> bounces at lists.typo3.org] On Behalf Of Helmut Hummel
> Sent: Friday, December 13, 2013 11:02 AM
> To: typo3-team-core at lists.typo3.org
> Subject: Re: [TYPO3-core] #53682, PHP 5.5.6, call-time pass-by-reference,
> PHP 5.6
> 
> Hi Markus, hi everybody
> 
> On 13.12.13 10:06, Markus Klein wrote:
> 
> > So again: A pass by reference is used to change the original variable and has
> nothing to do with the fact that objects are passed by reference.
> 
> Thanks for the detailed explanations!
> 
> To sum it up: Only "call-time pass-by-reference" is deprectated in PHP and
> this is not used in the code in question, neither the original one, nor in the
> proposed change.
> 
> However there are still two things in the existing code that bothered me for
> long, as they are not necessary and even bad practice.
> 
> 1. The reference modifier is used in the function declaration although the
> variable is expected is an object.
> 
> Although technically and internally there might be a difference having or not
> haivng it, practically it is not needed and in fact is a leftover from PHP 4 coding
> practice.
> 
> 2. The constructor being part of the interface.
> 
> This is bad because interfaces should describe the behaviour of an object and
> the constructor is an implementatin detail how the object is built.
> 
> 
> Therefore I propose the following:
> 
> 1. Get rid of the contructor method in the (ToolBarItemHook) interface 2.
> Get rid of the reference modifiers in the implementations of this interface.
> Third party code must do that too if affected by this PHP bug, but this can be
> done any time as there is not interface restriction any more 3. Rather than
> applying breaks to our object creation code by adding additional reflection
> methods[1], I propose to remove reflection for 99% of the cases
> altogether.[2] (I would be fine adding the workaround from [1] in the default
> case of the switch statement, but only if absolutely
> necessary)
> 
> All changes could also be backported to older branches, as they are non
> breaking and pretty straightforward.
> 
> What do you think?
> 
> 
> Kind regards,
> Helmut
> 
> 
> [1]https://review.typo3.org/26344
> [2]https://review.typo3.org/26363
> --
> Helmut Hummel
> Release Manager TYPO3 6.0
> TYPO3 Core Developer, TYPO3 Security Team Member
> 
> TYPO3 .... inspiring people to share!
> Get involved: typo3.org
> _______________________________________________
> Before posting to this list, please have a look to the posting rules on the
> following websites:
> 
> http://typo3.org/teams/core/core-mailinglist-rules/
> http://typo3.org/development/bug-fixing/diff-and-patch/
> _______________________________________________
> TYPO3-team-core mailing list
> TYPO3-team-core at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-team-core



More information about the TYPO3-team-core mailing list