You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by "Christian Grobmeier (JIRA)" <ji...@apache.org> on 2009/07/03 14:32:47 UTC
[jira] Created: (LOG4PHP-53) Remove references
Remove references
-----------------
Key: LOG4PHP-53
URL: https://issues.apache.org/jira/browse/LOG4PHP-53
Project: Log4php
Issue Type: Improvement
Reporter: Christian Grobmeier
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.
[jira] Commented: (LOG4PHP-53) Remove references
Posted by "Knut Urdalen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12729415#action_12729415 ]
Knut Urdalen commented on LOG4PHP-53:
-------------------------------------
Just a note from me: Normally it's fine to remove all references, and if working with object handles it's not a problem. However if you potentially can have large amount of data as plain PHP arrays, you mostly do better by using "Pass by Reference" to not copy the whole data structure around and consume less memory. I think we should be aware of these things in a lightweight logging framework.
For the record:
* References Explained: http://www.php.net/manual/en/language.references.php
* Passing by Reference: http://www.php.net/manual/en/language.references.pass.php
> 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.
[jira] Commented: (LOG4PHP-53) Remove references
Posted by "Christian Grobmeier (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Updated: (LOG4PHP-53) Remove references
Posted by "Christian Grobmeier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-53?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Grobmeier updated LOG4PHP-53:
---------------------------------------
Component/s: Code
> 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.
[jira] Updated: (LOG4PHP-53) Remove references
Posted by "Christian Grobmeier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-53?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Grobmeier updated LOG4PHP-53:
---------------------------------------
Affects Version/s: 2.0
Fix Version/s: 2.0
> 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.
[jira] Resolved: (LOG4PHP-53) Remove references
Posted by "Christian Grobmeier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-53?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Grobmeier resolved LOG4PHP-53.
----------------------------------------
Resolution: Fixed
References removed.
For the record: Strings are not treated as objects. References for string(buffer) passing are necessary until the methods are refactored.
> 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.