1.2.1659. time() Vs strtotime()¶
time() is actually faster than strtotime() with ‘now’ key string. This is a micro-optimisation. Relative gain is real, but small unless the function is used many times.
<?php
// Faster version
$a = time();
// Slower version
$b = strtotime('now');
?>
1.2.1659.1. Connex PHP features¶
1.2.1659.1.1. Suggestions¶
Replace strtotime() with time(). Do not change strtotime() with other value than ‘now’.
1.2.1659.1.2. Specs¶
Short name |
Performances/timeVsstrtotime |
Rulesets |
|
Exakat since |
0.8.7 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Instant (5 mins) |
Precision |
Very high |
Examples |
|
Available in |