Am 03.02.2014 11:56 schrieb "Yasuo Ohgaki" <[email protected]>:
>
> We may extend declare() more. For example, loaded extensions.
>
> declare(module='pgsql,openssl');
>
> With opcache loaded extension check may be completely skipped.
I like this.
It would be even more useful to me - kind of a more structured #ifdef - if
A) it would work at the block level, not failing, but eliding the block:
declare(module='redis') {
use redis server
}
(instead of a class_exists check with the associated runtime overhead, both
in execution time and opcache memory usage
B) it would support testing for constants
declare(const='ADMIN_SERVER') { ... }
declare(const_false='DEVELOPMENT_SERVER') { ... }
which would really be a plus for us, using MINIT time constants provided by
the defcon extension (http://github.com/infusion/PHP-Defcon)
best regards
Patrick