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