Re: Declare minimum PHP version required?

From: Date: Mon, 03 Feb 2014 11:28:27 +0000
Subject: Re: Declare minimum PHP version required?
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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


Thread (50 messages)

« previous php.internals (#72081) next »