Skip to content

[Dependency Injection] PHPDumper Problems in PHP8 on Linux #39528

Closed
@nanasess

Description

@nanasess

Symfony version(s) affected: 4.4.15

Description

On Linux, the code generated by PHPDumper looks like the following and causes a Fatal Error in PHP8.

<?php

include_once\dirname(__DIR__, 4).'/vendor/doctrine/persistence/lib/Doctrine/Persistence/ObjectManager.php';
include_once \dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManagerInterface.php';
include_once \dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php';
class EntityManager_9a5be93 extends \Doctrine\ORM\EntityManager implements \ProxyManager\Proxy\VirtualProxyInterface
{
!!  PHP Fatal error:  Uncaught Error: Call to undefined function include_once\dirname() in /path/to/var/cache/prod/ContainerIHdxD6S/EntityManager_9a5be93.php:3

On a macOS, the following code is generated and works fine.

<?php
include_once \dirname(__DIR__, 4).'/vendor/doctrine/persistence/lib/Doctrine/Persistence/ObjectManager.php';
include_once \dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManagerInterface.php';
include_once \dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php';

class EntityManager_9a5be93 extends \Doctrine\ORM\EntityManager implements \ProxyManager\Proxy\VirtualProxyInterface
{

How to reproduce

Run cache:clear --no-warmup on Ubuntu 18.04.

Possible Solution

Generates the same code as on a macOS.

Additional context

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