Skip to content

Attributes declared as "TARGET_METHOD" on "__invoke" methods not working for PHP 8.1.6 - PHP 8.1.9 and Symfony 6.2.x-dev #47851

Closed
@michaljusiega

Description

@michaljusiega

Symfony version(s) affected

6.2.x-dev

Description

According to changes implemented in #46001 after bumping from Symfony 6.1 to 6.2.x-dev in my private project I got new unexpected error about using Route attribute on __invoke method.

I wrote example: https://3v4l.org/jpWc5 and it looks like there was a PHP bug in according versions.

Edit: seems this issue was occurred already: #46916 but was not fixed yet.

root@a08e989193a2:/var/www/internal# php -v 
PHP 8.1.9 (cli) (built: Aug 23 2022 14:03:17) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.9, Copyright (c), by Zend Technologies
    with Xdebug v3.1.5, Copyright (c) 2002-2022, by Derick Rethans
    with blackfire v1.81.0~linux-x64-non_zts81, https://blackfire.io, by Blackfire

Actually I don't test it on newest version of PHP, but on 3v4l.org looks like that was actually fixed.

How to reproduce

https://3v4l.org/jpWc5

Possible Solution

Let's extends definition of flags in all attributes contains Attribute::TARGET_METHOD to Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION ?

Or shall we block installing Symfony when end-user has PHP 8.1.6 - PHP 8.1.9?

Additional Context

obraz

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions