Skip to content

Code patching should insert after strict type declares #200

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

Closed
mikeymike opened this issue Jan 23, 2021 · 1 comment
Closed

Code patching should insert after strict type declares #200

mikeymike opened this issue Jan 23, 2021 · 1 comment

Comments

@mikeymike
Copy link
Member

declare(strict_types=1); is pretty much the norm now however providing a solution with this results in any before patches coming before this, e.g.

<?php

date_default_timezone_set("Europe/London");
error_reporting(E_ALL);
ini_set("display_errors", 1);
declare(strict_types=1);

This may also be an issue with transformers where the declare could end up in a try block 🤔

It doesn't AFAIK cause errors but I think strict types would be disabled if it's not the first statement.

@AydinHassan
Copy link
Member

Solved with #207

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

No branches or pull requests

2 participants