Re: [RFC] Remove PHP 4 Constructors
| From: | Rowan Collins | Date: | Fri, 21 Nov 2014 16:27:52 +0000 |
| Subject: | Re: [RFC] Remove PHP 4 Constructors | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79087@lists.php.net to get a copy of this message | ||
Johannes Schlüter wrote on 21/11/2014 16:13:
Hi, On Fri, 2014-11-21 at 16:48 +0900, Yasuo Ohgaki wrote:I agree; the runtime environment is not the right scope to set such options. I do wonder if it would be useful to make more use of declare() though, which is scoped to a single file, and could be used like Perl's Pragmas. Annoyingly, unrecognised declare() options issue a warning, so you can't rely on older versions silently ignoring a new flag such as declare(compat_flags=php4_constructors); http://3v4l.org/cikUU Apparently, @ can't be used to suppress the warning, either, since the parser chokes (I guess because declare() isn't really a statement as such): http://3v4l.org/DFBfO I'm not sure it would actually make sense for this case, anyway, but some global behaviours would definitely benefit from being scoped this way e.g. suppress notices in deprecated / 3rd-party code, but show them in your own new modules, or ensure strlen is not over-ridden by mbstring in a library which needs to count bytes. Regards, -- Rowan Collins [IMSoP]How about use INI until PHP8?No. php.ini needs less settings not more. Especially not for language things. This makes a mess for creating portable code. ze1 compat mode was a fault as were other ini settings we had. Let's not go there, again.