From bd775b2b0dc8c5836ef110cf308bcd48dc48634b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Pe=CC=81rez?= <jaime.perez@uninett.no>
Date: Mon, 3 Oct 2016 16:05:11 +0200
Subject: [PATCH] bugfix: Avoid masked errors in PHP 7.

ParseError errors in PHP 7 have a code of 0, which will always be masked. Avoid that by forcing error codes of 0 to be E_ERROR instead.
---
 www/_include.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/_include.php b/www/_include.php
index b5f506fa4..22972aff4 100644
--- a/www/_include.php
+++ b/www/_include.php
@@ -46,7 +46,8 @@ function SimpleSAML_exception_handler($exception)
         $e->show();
     } else {
         if (class_exists('Error') && $exception instanceof Error) {
-            $errno = $exception->getCode();
+            $code = $exception->getCode();
+            $errno = ($code > 0) ? $code : E_ERROR;
             $errstr = $exception->getMessage();
             $errfile = $exception->getFile();
             $errline = $exception->getLine();
-- 
GitLab