Thursday, February 08, 2007

PHP parameter passing

PHP seems to adopt some Java concepts/rules, especially in OOP, such as handling objects/instances.
Normally, php data is passed by value. In PHP5, php data of primitive data types like int, float, etc is still passed by value. But the object is passed by reference. Saying that "the object is passed by reference" is not totally true. Actually, the object handle is still passed by value.
This is exactly the same case as that in Java.
PHP also has features like method pointer, which is introduced by C/C++.
Hope php keep its good performance while using some advanced programming ideas.

No comments: