Browse Source

[php] don't throw on division by zero

Alexander Kuzmenko 7 years ago
parent
commit
e991967d7c
1 changed files with 7 additions and 0 deletions
  1. 7 0
      std/php/Boot.hx

+ 7 - 0
std/php/Boot.hx

@@ -57,6 +57,13 @@ class Boot {
 					if (Global.error_reporting() & errno == 0) {
 						return false;
 					}
+					/*
+					* Division by zero should not throw
+					* @see https://github.com/HaxeFoundation/haxe/issues/7034#issuecomment-394264544
+					*/
+					if(errno == Const.E_WARNING && errstr == 'Division by zero') {
+						return true;
+					}
 					throw new ErrorException(errstr, 0, errno, errfile, errline);
 				}
 			);