當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IntlTestHelper::require64Bit方法代碼示例

本文整理匯總了PHP中Symfony\Component\Intl\Util\IntlTestHelper::require64Bit方法的典型用法代碼示例。如果您正苦於以下問題:PHP IntlTestHelper::require64Bit方法的具體用法?PHP IntlTestHelper::require64Bit怎麽用?PHP IntlTestHelper::require64Bit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\Intl\Util\IntlTestHelper的用法示例。


在下文中一共展示了IntlTestHelper::require64Bit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testParseTypeInt64With64BitIntegerInPhp64Bit

 /**
  * If PHP is compiled in 64bit mode, the returned value for a 64bit integer are 32bit integer numbers.
  */
 public function testParseTypeInt64With64BitIntegerInPhp64Bit()
 {
     IntlTestHelper::require64Bit($this);
     $formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
     $parsedValue = $formatter->parse('2,147,483,648', NumberFormatter::TYPE_INT64);
     $this->assertInternalType('integer', $parsedValue);
     // Bug #59597 was fixed on PHP 5.3.14 and 5.4.4
     // A 32 bit integer was being generated instead of a 64 bit integer
     if (version_compare(PHP_VERSION, '5.3.14', '<') || version_compare(PHP_VERSION, '5.4.0', '>=') && version_compare(PHP_VERSION, '5.4.4', '<')) {
         $this->assertEquals(-2147483648, $parsedValue, '->parse() TYPE_INT64 does not use true 64 bit integers, using only the 32 bit range (PHP < 5.3.14 and PHP < 5.4.4).');
     } else {
         $this->assertEquals(2147483648, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).');
     }
     $parsedValue = $formatter->parse('-2,147,483,649', NumberFormatter::TYPE_INT64);
     $this->assertInternalType('integer', $parsedValue);
     // Bug #59597 was fixed on PHP 5.3.14 and 5.4.4
     // A 32 bit integer was being generated instead of a 64 bit integer
     if (version_compare(PHP_VERSION, '5.3.14', '<') || version_compare(PHP_VERSION, '5.4.0', '>=') && version_compare(PHP_VERSION, '5.4.4', '<')) {
         $this->assertEquals(2147483647, $parsedValue, '->parse() TYPE_INT64 does not use true 64 bit integers, using only the 32 bit range  (PHP < 5.3.14 and PHP < 5.4.4).');
     } else {
         $this->assertEquals(-2147483649, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).');
     }
 }
開發者ID:iker24,項目名稱:prueba,代碼行數:26,代碼來源:AbstractNumberFormatterTest.php

示例2: testParseTypeInt64With64BitIntegerInPhp64Bit

 /**
  * If PHP is compiled in 64bit mode, the returned value for a 64bit integer are 32bit integer numbers.
  */
 public function testParseTypeInt64With64BitIntegerInPhp64Bit()
 {
     IntlTestHelper::require64Bit($this);
     $formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
     $parsedValue = $formatter->parse('2,147,483,648', NumberFormatter::TYPE_INT64);
     $this->assertInternalType('integer', $parsedValue);
     $this->assertEquals(2147483648, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).');
     $parsedValue = $formatter->parse('-2,147,483,649', NumberFormatter::TYPE_INT64);
     $this->assertInternalType('integer', $parsedValue);
     $this->assertEquals(-2147483649, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).');
 }
開發者ID:ayoah,項目名稱:symfony,代碼行數:14,代碼來源:AbstractNumberFormatterTest.php


注:本文中的Symfony\Component\Intl\Util\IntlTestHelper::require64Bit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。