Re: constructors are callable as regular functions.
| From: | Kalle Sommer Nielsen | Date: | Thu, 02 Jul 2009 14:45:00 +0000 |
| Subject: | Re: constructors are callable as regular functions. | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-44657@lists.php.net to get a copy of this message | ||
2009/7/2 troels knak-nielsen <troelskn@gmail.com>:
> Has this been discussed before? In that case, was it decided to go
> with this behaviour or is it purely accidental? Are there perhaps some
> implementation issues in preventing the second call to __construct()?
Magic methods can always be called directly because they must be
declared public to work. I don't see a reason why to disallow it, if a
user manually executes a magic method they should be knowing what they
are doing and remember that there might be side-effects with there
code.
--
regrads,
Kalle Sommer Nielsen
kalle@php.net