帮酷LOGO
0 0 评论
  • 显示原文与译文双语对照的内容
文章标签:FUNC  Functionality  函数  equal  COM  等效  functional  PHP  
Provides the functionality to compare PHP values for equality.

  • 源代码名称:comparator
  • 源代码网址:http://www.github.com/sebastianbergmann/comparator
  • comparator源代码文档
  • comparator源代码下载
  • Git URL:
    git://www.github.com/sebastianbergmann/comparator.git
  • Git Clone代码到本地:
    git clone http://www.github.com/sebastianbergmann/comparator
  • Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/sebastianbergmann/comparator
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
  • Build Status

    比较器

    这个组件提供了比较PHP值相等性的功能。

    安装

    你可以使用 Composer 将这里库作为本地项目添加到项目中:

    
    composer require sebastian/comparator
    
    
    
    

    如果在开发期间只需要这个库,例如运行你的项目套件测试,那么你应该将它作为开发时间依赖项添加:

    
    composer require --dev sebastian/comparator
    
    
    
    

    用法

    <?phpuseSebastianBergmannComparatorFactory;useSebastianBergmannComparatorComparisonFailure;$date1=newDateTime('2013-03-29 04:13:35', newDateTimeZone('America/New_York'));$date2=newDateTime('2013-03-29 03:13:35', newDateTimeZone('America/Chicago'));$factory=newFactory;$comparator=$factory->getComparatorFor($date1, $date2);try {$comparator->assertEquals($date1, $date2);print"Dates match";} catch (ComparisonFailure$failure) {print"Dates don't match";}


    文章标签:COM  PHP  FUNC  函数  functional  Functionality  equal  等效  

    Copyright © 2011 HelpLib All rights reserved.    知识分享协议 京ICP备05059198号-3  |  如果智培  |  酷兔英语