Open velkymx opened 7 years ago
Any answer? I have similar problem...
@Pantela777 Kohana is no longer maintained, so there will be no PHP7 support.
But to fix your problem if you want to update the core yourself, change the exception in the elseif to return false instead maybe.
On 16 Oct. 2017 8:43 am, "Alex Belov" notifications@github.com wrote:
Any answer? I have similar problem...
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kohana/core/issues/703#issuecomment-336743788, or mute the thread https://github.com/notifications/unsubscribe-auth/ADtzk-g_wBUQP-_enAlzxfJ0vxPnhW6Kks5ssnxlgaJpZM4L0i5O .
I fixed this by changing the catch in the __toString function in system/classes/Kohana/View.php to
catch (Throwable $e)
in PHP7, fatal and recoverable errors extend a new Error class instead of of the Exception class. I found the explanation on this blog: https://www.aurigait.com/blog/fatal-error-handling-in-php-7/
-- Edited to change catch (Error $e) to catch (Throwable $e) since ErrorExcecptions were causing the toString problem with catch Error. https://trowski.com/2015/06/24/throwable-exceptions-and-errors-in-php7/
ErrorException [ Fatal Error ]: Method View::__toString() must not throw an exception, caught ParseError: syntax error, unexpected 'else' (T_ELSE)