|
Posted by Michael Fesser on 07/25/07 07:34
..oO(Sanders Kaufman)
>Jerry Stuckle wrote:
>
>> True. But it is the child class's responsibility to call the parent
>> class's constructor - which it should ALWAYS do. Other languages do it
>> automatically; PHP is lagging in this respect.
>
>In not real good about doing things just 'cause people keep saying
>"should" a lot.
You could also
* disable error_reporting while developing
* rely on register_globals
* always use @ to supress errors
* don't check return values of DB functions
* don't sanitize data before it goes into the DB
* ...
Every experienced programmer will tell you that you should not do these
things (of course you're free to ignore that). Calling a constructor in
a way it's not meant to be called is just another point on that list.
>> No, that's NOT the purpose of a constructor!
>
>But that is how it works, and doing it that way does seem to simplify
>the code.
It _might_ work, but might also open a can of worms. You're calling for
unpredictable results. If you like that, then go with your "simplified
code".
I'm out of this thread.
EOT
Micha
Navigation:
[Reply to this message]
|