实例说明,大家去测试一下吧这里我测试了的结果是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 ; ?>声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did26990