Skip to content

Error: @php directive does not work as expected in an assumed scenario #9

@nael94

Description

@nael94

Here is a quick example to describe the error:

@extends ('layout/main')

@php
  // This is php code
  $from = 10;
  $to = $from + 10;
@endphp

@section('body')
  {{ $to }}
@endsection

It is assumed to prepare the variable $to to be usable in the current viewfile, but it returns this error: Deprecated: htmlentities(): Passing null to parameter 1 ($string) of type string is deprecated in C:\xampp\htdocs\crow\vendor\corviz\crow\src\Crow.php(138) : eval()'d code on line 1

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions