Browse Source

php: fixed Std.is for integers out of int32 boundaries

Franco Ponticelli 12 years ago
parent
commit
d1887e4ea6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      std/php/Boot.hx

+ 1 - 1
std/php/Boot.hx

@@ -413,7 +413,7 @@ function _hx_instanceof($v, $t) {
 		case 'Array'  : return is_array($v);
 		case 'String' : return is_string($v) && !_hx_is_lambda($v);
 		case 'Bool'   : return is_bool($v);
-		case 'Int'    : return is_int($v) || (is_float($v) && intval($v) == $v && !is_nan($v));
+		case 'Int'    : return (is_int($v) || (is_float($v) && intval($v) == $v && !is_nan($v))) && abs($v) <= 0x80000000;
 		case 'Float'  : return is_float($v) || is_int($v);
 		case 'Dynamic': return true;
 		case 'Class'  : return ($v instanceof _hx_class || $v instanceof _hx_interface) && $v->__tname__ != 'Enum';