# run-tests.php improvement for PHP 7.0+

- Thread: https://externals.io/message/93130
- Original archive: https://news-web.php.net/php.internals/93130
- Started by Derick Rethans on 2016-05-09T18:36:19+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #93130 — Derick Rethans — 2016-05-09T18:36:19+00:00

URL: https://externals.io/message/93130#93130

Hi!

I've recently been having some looks at issues between xdebug and 
opcache, and this meant that I need to write a test case for it.

Ages ago I added support for the "--EXTENSIONS--" section in .phpt 
files, to load extensions that the test 'depends' on. Each item would be 
added to the php invocation as a "-dextension=name.so". For opcache 
however, that needs to be "-dzend_extension=opcache.so". 

The attached patch checks for opcache in the list of extensions and then 
uses zend_extension=. I'd like to have this in PHP 7.0 and trunk - any 
objections? 

cheers,
Derick

---

## #93131 — Anatol Belski — 2016-05-09T19:22:05+00:00

URL: https://externals.io/message/93130#93131 · In reply to: #93130

Hi Derick,

> -----Original Message-----
> From: Derick Rethans [mailto:derick@php.net]
> Sent: Monday, May 9, 2016 8:36 PM
> To: PHP Developers Mailing List <internals@lists.php.net>
> Cc: Anatol Belski <ab@php.net>
> Subject: [PHP-DEV] run-tests.php improvement for PHP 7.0+
> 
> Hi!
> 
> I've recently been having some looks at issues between xdebug and opcache,
> and this meant that I need to write a test case for it.
> 
> Ages ago I added support for the "--EXTENSIONS--" section in .phpt files,
to load
> extensions that the test 'depends' on. Each item would be added to the php
> invocation as a "-dextension=name.so". For opcache however, that needs to
be
> "-dzend_extension=opcache.so".
> 
> The attached patch checks for opcache in the list of extensions and then
uses
> zend_extension=. I'd like to have this in PHP 7.0 and trunk - any
objections?
> 
IMHO fine for 7.0. Not that much zend_extension's do exist, so hardcoding
some is simpler than adding yet another section.

Regards

Anatol

---

## #93137 — Benjamin Eberlei — 2016-05-10T04:07:56+00:00

URL: https://externals.io/message/93130#93137

On Tue, May 10, 2016 at 2:51 AM, François Laupretre <francois@php.net>
wrote:

> Hi Derick,
>
>
> Le 09/05/2016 à 20:36, Derick Rethans a écrit :
>
> > […]
>
> I know there are not so many Zend extensions around, but I would
> definitely prefer a 'ZEND_EXTENSIONS' section.
>

Wouldn't this work by just using --INI-- instead?

--INI--
zend_extension=opcache.so

greetings
Benjamin


>
> Regards
>
> François

---

## #93138 — Matt Ficken — 2016-05-10T04:36:49+00:00

URL: https://externals.io/message/93130#93138 · In reply to: #93137

An INI section wouldn't have the extension directory path AND wouldn't have
the name of the SO to load. On Windows, its zend_extension=php_opcache.DLL.
Typically the same opcache, etc... feature/test should work across os
platforms.

OpCache tests can just use a SKIPIF section to be skipped unless the user
has configured OpCache to be loaded. Forcing OpCache to be loaded makes
sure that test gets run during a casual test run (somebody just running
`make test`). That's what a ZEND_EXTENSION section would do. There are
several new section types already.

If you really want to add a ZEND_EXTENSIONS section, that's fine.

It is important though to have SKIPIF code that checks for such zend
extensions being loaded:

That allows for backwards compatibility.

Also, that will avoid a mismatch with PFTT... PFTT has scenarios that can
load/configure extensions for all tests to be run, fe: run all tests with
opcache enabled or run all tests with opcache disabled. SKIPIF code would
allow such PHPTs to be skipped or not for those scenarios, otherwise there
is a mismatch in features between PFTT and run-test.php.


Regards
-M

On Mon, May 9, 2016 at 9:07 PM, Benjamin Eberlei <kontakt@beberlei.de>
wrote:

> On Tue, May 10, 2016 at 2:51 AM, François Laupretre <francois@php.net>
> wrote:
>
> > […]
>
> Wouldn't this work by just using --INI-- instead?
>
> --INI--
> zend_extension=opcache.so
>
> greetings
> Benjamin
>
>
> > […]

---

## #93140 — Benjamin Eberlei — 2016-05-10T06:13:16+00:00

URL: https://externals.io/message/93130#93140 · In reply to: #93138

On Tue, May 10, 2016 at 6:36 AM, Matt Ficken <themattficken@gmail.com>
wrote:

> An INI section wouldn't have the extension directory path AND wouldn't
> have the name of the SO to load. On Windows, its
> zend_extension=php_opcache.DLL. Typically the same opcache, etc...
> feature/test should work across os platforms.
>

ah yes of course, sorry for the noise :)

>
> OpCache tests can just use a SKIPIF section to be skipped unless the user
> has configured OpCache to be loaded. Forcing OpCache to be loaded makes
> sure that test gets run during a casual test run (somebody just running
> `make test`). That's what a ZEND_EXTENSION section would do. There are
> several new section types already.
>
> If you really want to add a ZEND_EXTENSIONS section, that's fine.
>
> It is important though to have SKIPIF code that checks for such zend
> extensions being loaded:
>
> That allows for backwards compatibility.
>
> Also, that will avoid a mismatch with PFTT... PFTT has scenarios that can
> load/configure extensions for all tests to be run, fe: run all tests with
> opcache enabled or run all tests with opcache disabled. SKIPIF code would
> allow such PHPTs to be skipped or not for those scenarios, otherwise there
> is a mismatch in features between PFTT and run-test.php.
>
>
> Regards
> -M
>
> On Mon, May 9, 2016 at 9:07 PM, Benjamin Eberlei <kontakt@beberlei.de>
> wrote:
>
> > […]

---

## #93195 — Joe Watkins — 2016-05-11T04:49:32+00:00

URL: https://externals.io/message/93130#93195 · In reply to: #93140

Morning,

    I would prefer adding a zend extensions section, there might not be
that many in zend extensions in the wild, but there are behind closed doors.

Cheers
Joe

On Tue, May 10, 2016 at 7:13 AM, Benjamin Eberlei <kontakt@beberlei.de>
wrote:

> On Tue, May 10, 2016 at 6:36 AM, Matt Ficken <themattficken@gmail.com>
> wrote:
>
> > […]
>
> ah yes of course, sorry for the noise :)
>
> > […]
> there
> > […]
> any
> > […]
