1

After upgrading to a new version of PHP (from 5.4.7 to 5.6.3) my Laravel Blade templates do not evaluate PHP code anymore.

For example I may have a file test.blade.php:

<? if(TRUE) echo "I am "?> {{1==1}}

Instead of outputting "I am true" the blade part is evaluated but the PHP code is not resulting in the following rendered output:

<? if(TRUE) echo "I am "?> true

I know there are specific Blade tags for control statements but this is merely an example. Does anyone know what's going on here? I don't really feel like rewriting all blade views to be PHP-less.

1 Answer 1

2

Shorttags are disabled by default in later PHP versions. Can't believe I missed that!

Sign up to request clarification or add additional context in comments.

1 Comment

Good catch! There is always some details we usually forget

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.