View Single Post
Old 11-26-2007, 09:18 PM   #12 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Quote:
The reason the class-name-function was replaced by __construct() is to be more a genuine OOP language.
What about C++, that has its constructors like PHP4 as does Java, i.e. C++
Code:
classname() {}
.
Personally i think they did it just to confuse people :), or as you say the class name is hideously long.

Just as a note a destructor in C++ is
Code:
 ~classname() {}
. (not sure about Java, something in my mind is saying finalize() but don't trust that as fact coz i ain't a Java programmer :), ill have to ask my m8 about that. )

PHP4 didn't have a native destructor method, unless you bodge something together with register_shutdown_function as wildhoney said.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)

Last edited by sketchMedia : 11-27-2007 at 06:42 AM.
sketchMedia is offline  
Reply With Quote