Skip to content

[VarExporter] Make example work #16349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 30, 2021

Conversation

antalaron
Copy link
Contributor

The exported php file is not a valid php as it does not contain the opening tag and has no return and closing semicolon. So the require won't work as expected.

@javiereguiluz
Copy link
Member

You are right! I just tested this in my own app and <?php and ; are not included by default.

I've confirmed it with VarExporter tests, which also add those manually. See https://github.com/symfony/symfony/blob/cef3d5ade2565b9c8bbe101645c86e07f1a69a30/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php#L92

Thanks Antal and congrats on your first Symfony Docs contribution 🎉

@javiereguiluz javiereguiluz merged commit 569b773 into symfony:4.4 Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants