Open AJenbo opened 1 year ago
Example:
@include('partial')
Partial:
@php use \Exception(); @endphp
Result:
Syntax error, unexpected T_USE
This happens as it's translated to:
<?php function () { use \Exception(); }
Insted all use statements should be hoisted to the top of the generated code:
<?php use \Exception(); function () { }
Workaround: use FQN in partials.
Example:
Partial:
Result:
This happens as it's translated to:
Insted all use statements should be hoisted to the top of the generated code:
Workaround: use FQN in partials.