Johannes Schlüter wrote on 21/11/2014 16:13:
Hi,

On Fri, 2014-11-21 at 16:48 +0900, Yasuo Ohgaki wrote:


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.

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]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to