-
-
Notifications
You must be signed in to change notification settings - Fork 938
Closed
Description
Bug report
I'm using api-platform and they have recently started to include php8 only files and guard their uses via PHP_VERSION_ID checks. For example:
which then conditionally includes:
which is PHP8 only syntax, and fails with PHP 7.4.
Related downstream issue: api-platform/core#4614
Code snippet that reproduces the problem
<?php
// composer require api-platform/core phpstan/phpstan symfony/framework-bundle phpunit/phpunit symfony/http-client
declare(strict_types=1);
require_once __DIR__.'/vendor/autoload.php';
use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\Client;
class Test extends ApiTestCase
{
protected function setUp(): void
{
parent::setUp();
static::createClient();
}
}$ php7.4 ./vendor/bin/phpstan analyze a.php
------ ----------------------------------------------------------------------
Line /a.php
------ ----------------------------------------------------------------------
Internal error: syntax error, unexpected 'static' (T_STATIC)
Run PHPStan with --debug option and post the stack trace to:
https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md
------ ---------------------------------------------------------------------- Expected output
No output
Did PHPStan help you today? Did it make you happy in any way?
every day :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels