فهرست منبع

php : fix to Std.parseInt

Franco Ponticelli 14 سال پیش
والد
کامیت
334d4988c0
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      std/php/_std/Std.hx

+ 1 - 1
std/php/_std/Std.hx

@@ -43,7 +43,7 @@
 			__call__('preg_match', '/\\d+/', x, matches);
 			__call__('preg_match', '/\\d+/', x, matches);
 			return __call__("count", matches) == 0 ? null : __call__('intval', matches[0]);
 			return __call__("count", matches) == 0 ? null : __call__('intval', matches[0]);
 		} else
 		} else
-			return x.substr(0, 2).toLowerCase() == "0x" ? __php__("intval(substr($x, 2), 16)") : __php__("intval($x)");
+			return x.substr(0, 2).toLowerCase() == "0x" ? __php__("(int) hexdec(substr($x, 2))") : __php__("intval($x)");
 	}
 	}
 
 
 	public static function parseFloat( x : String ) : Float {
 	public static function parseFloat( x : String ) : Float {