framework: [PHP 7] Exception error PHP 7
I got error in app/Exeptions/Handler.php
Just testing on PHP and don`t know where report issues about PHP 7
Error I have:
Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, instance of TypeError given, called in
This error where thrown when I make typo in controller return view(‘notices,create’); P.S. Any way Laravel good prepared for PHP7. I test for 2 week now and only this issue ))
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 35 (15 by maintainers)
Commits related to this issue
- Fix Exception error PHP 7 #9601 — committed to felipedmz/framework by felipedmz 8 years ago
Here’s my take, for laravel 4.2. Couldn’t pass the $previous parameter since Whoops also expects Exception instead of Throwable, so this limits the usefulness of the error message, but it sure beats something that looks like an internal error.
I know the combination of laravel 4.2 and php7 is unsupported, but if this patch is okay, can I PR it?
hello i got some error on php7 that may be related to this issue
Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, instance of Error given
have you seen this error?
After research look like need use “Throwable” instead or for support php5 to try { // Code that may throw an Exception or Error. } catch (Throwable $t) { // Executed only in PHP 7, will not match in PHP 5.x } catch (Exception $e) { // Executed only in PHP 5.x, will not be reached in PHP 7 }
While I’m upgrading our system to the 5.1LTS version, for the time being I catch the throwables in the
index.php
andartisan
files and re-throw them as exceptions.If using Laravel 4.2, upgrade to Laravel 4.2.20. It resolves PHP 7 issues.
i had same problem in laravel 5.1. After reading this issue, i found out i was using laravel v5.1.0 and that seemed wrong so changed
5.1.0
to5.1.*
and rancomposer update
. this solved the issue for me.