Explorar el Código

[php] don't throw on division by zero

Alexander Kuzmenko hace 7 años
padre
commit
e991967d7c
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  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) {
 					if (Global.error_reporting() & errno == 0) {
 						return false;
 						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);
 					throw new ErrorException(errstr, 0, errno, errfile, errline);
 				}
 				}
 			);
 			);