Performance: "or" PHP
source link: https://www.codesd.com/item/performance-or-php.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Performance: "or" PHP
This question already has an answer here:
- What is the difference between single-quoted and double-quoted strings in PHP? 10 answers
I'm working on a big project in php and I need to make sure it's all fast. So I'm wondering: what is faster to use, " or ' ? (Eg: $_SESSION['example']
or $_SESSION["example"]
)
You shouldn't even care about this. It makes no real difference. No practical impact.
http://nikic.github.io/2012/01/09/Disproving-the-Single-Quotes-Performance-Myth.html
https://speakerdeck.com/dshafik/phpaustralia-2015-php-under-the-hood
Lets use the same benchmark data from the post by Mark Smit:
For a real speed benchmarks between quotes you can look at http://www.phpbench.com/
Q: Is a there a difference in using double (") and single (') quotes for strings. Call 1'000x
A: In today's versions of PHP it looks like this argument has been satisfied on both sides of the line. Lets all join together in harmony in this one!
Related Articles
How does a list of directories affect the performance of php?
Ajax call in cakePhp does not perform the php requested in the controller
Implicit filter / order / limit performance in php (for + if) vs SQL clauses
How do I minimize HTML for performance using PHP
How to perform the php file system in the transaction?
mysql performance for php calls
Poor performance in PHP. With large files, memory blows! How to refactor?
How do I perform a PHP action based on the date and time?
FTP Performance with PHP and Symfony Finder
Some questions about the performance of PHP objects
What is the performance of PHP?
Performance of PHP page after URL rewriting
Performance of PHP documentation
Performance benchmark: PHP generated content VS. javascript and DOM on AJAX
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK