好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

PHP if和or效率对比

实例说明,大家去测试一下吧这里我测试了的结果是or 比if效率要高一些哦,代码如下:

<?php   $t1  = microtime();  while ( $i <=10000){        if (!defined( 'APP_PATH' ));       // 0.011059         // defined('APP_PATH') OR 1;   // 0.009398         $i ++;   }       $t2  = microtime();   echo   $t2  -  $t1 ;   ?>  //例2   <?php   $t1  = microtime();       while ( $i <=1000000){        if (!defined( 'APP_PATH' ));       //0.20043         // defined('APP_PATH') OR 1;   //0.107475         $i ++;   }       $t2  = microtime();   echo   $t2  -  $t1 ;   ?>   

查看更多关于PHP if和or效率对比的详细内容...

  阅读:44次