Skip to content

Conversation

@TysonAndre
Copy link
Contributor

PHP-Parser 4.3.0 failed to recognize that the match keyword could be
used as a class constant name.
4.9.0 also adds support for keywords in namespaced names.
See https://github.com/nikic/PHP-Parser/releases

So forcing regeneration of spl_iterators.stub.php failed.

PECL extensions using gen_stub.php would also be affected
by the same issue for those keywords.

// PHP 4.3.0 is not aware of the T_MATCH token
ext/spl/spl_iterators.stub.php
    public function __construct(Iterator $iterator, string $regex,
    int $mode = self::MATCH, int $flags = 0, int $preg_flags = 0) {}

Testing: I successfully regenerated stubs by setting forceRegeneration to true
and running touch **/*.stub.php; make.
The stubs did not change, as expected.

CC @nikic @kocsismate @cmb69

PHP-Parser 4.3.0 failed to recognize that the `match` keyword could be
used as a class constant name.
4.9.0 also adds support for keywords in namespaced names.
See https://github.com/nikic/PHP-Parser/releases

So forcing regeneration of spl_iterators.stub.php failed.

PECL extensions using gen_stub.php would also be affected
by the same issue.

```
ext/spl/spl_iterators.stub.php
    public function __construct(Iterator $iterator, string $regex,
    int $mode = self::MATCH, int $flags = 0, int $preg_flags = 0) {}
```

Testing: I successfully regenerated stubs by setting forceRegeneration to true
and running `touch **/*.stub.php; make`.
The stubs did not change, as expected.
@php-pulls php-pulls closed this in 4bba59d Aug 23, 2020
@kocsismate
Copy link
Member

@TysonAndre Thanks! This upgrade will also allow us to remove the hack from gen_stubs that was introduced for the mixed type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants