[
https://issues.apache.org/jira/browse/LOG4PHP-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12729419#action_12729419
]
Christian Grobmeier commented on LOG4PHP-53:
--------------------------------------------
As of PHP5, not the whole object structure is copied when using an object as
method param.
"As of PHP5, an object variable doesn't contain the object itself as value
anymore. It only contains an object identifier which allows object accessors to
find the actual object"
Its just creating a new object identifier (without recreating the object) of
you pass an object in a method.
This is quite the same way as java does it. Considering that "passing by
reference" in the PHP4 way isn't brought into PHP as standard behaviour but
more as an add on and considering that I got sometimes bus errors with
different PHP compilations I think its worth not to use references any more for
objects.
As for the array passing I agree, this looks like still like the best solution
since arrays are not objects. But for objects, I think removing references are
fine.
Looking in Log4PHP I cannot find much array-reference passings. Speaking of bus
errors, they occured only with objects, not on arrays.
Thanks for having a look at this too!
> Remove references
> -----------------
>
> Key: LOG4PHP-53
> URL: https://issues.apache.org/jira/browse/LOG4PHP-53
> Project: Log4php
> Issue Type: Improvement
> Components: Code
> Affects Versions: 2.0
> Reporter: Christian Grobmeier
> Fix For: 2.0
>
>
> According to this:
> http://www.php.net/manual/en/language.oop5.references.php
> PHP treats variable passing like in Java now. This would mean that only
> object identifiers are passed around, not the object copied. Having that
> beeing that, we can remove the incosistent & references from the code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.