2

Performance: "or" PHP

 2 years ago
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.
neoserver,ios ssh client

Performance: "or" PHP

advertisements

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?

Very simple question this time, basically I have a group of folders and some of them contain files that I would like to autoload whenever I run my sites script. However I do not want to have to specify what files to autoload because I want the proces

Ajax call in cakePhp does not perform the php requested in the controller

I was handed a project written with cakePhp framework and needed to add some additional function. I tried to follow the existing syntax but somehow couldn't get the new function to work. The original view file has the following script portion (after

Implicit filter / order / limit performance in php (for + if) vs SQL clauses

I'm working with wordpress, and it has a nice database interface, it is very useful to do a lot of somewhat simple queries. I wanted to use this interface but it doesn't allow me to do some special filtering. Then I thought I could return a resultset

How do I minimize HTML for performance using PHP

I'm somewhat new to the concept of minimization, but it seems simple enough. I understand how libraries like jQuery can benefit from minimization, but my question is whether or not it should be extended to HTML and CSS (I've seen CSS resets minimize

How to perform the php file system in the transaction?

How to perform php filesystem with transaction? I know it can not but wondering people usually how to solve this problem? Each time user upload file, will insert db and store file (move_uploaded_file) into right place, need to create a new folder con

mysql performance for php calls

I have multiple php functions for my code and each function tries to setup mysql connection, send queries and closes mysql connection. Is this a good design or should I set up one connection from a master function and then pass the variables to each

Poor performance in PHP. With large files, memory blows! How to refactor?

I have a function that strips out lines from files. I'm handling with large files(more than 100Mb). I have the PHP Memory with 256MB but the function that handles with the strip out of lines blows up with a 100MB CSV File. What the function must do i

How do I perform a PHP action based on the date and time?

I want to let my server send me e-mails with birthday reminders based on a birthday calendar in a database on the server at my web hosting provider's. I know how to send e-mails from PHP, but only as an action after a button click on the client side.

FTP Performance with PHP and Symfony Finder

I am developing an application that needs to list and download a bunch of files from a remote FTP directory. For this I am using the Symfony Finder component, which is built on top of SPL iterators like RecursiveDirectoryIterator. My problem is that

Some questions about the performance of PHP objects

Right now since I am new to using Objects in PHP I feel like in my head, I think of a PHP object as being something big and bulky. This makes me want to use them less often, I feel Like I am taking really simple code and really over-complicating it b

What is the performance of PHP?

This is a follow up to a recent post I've seen which suggests that PHP performance is poor: "PHP. IS. ALWAYS. THE. BOTTLENECK. My server farms, let me show you them! PHP Overall Performance" followed by: "PHP performance is frickin' abysmal

Performance of PHP page after URL rewriting

I have written a rewrite rule for my page http://localhost/project/new.php?action=login like RewriteRule ^([a-z]+)/([a-z]+) $1.php?action=$2 Now my file is can be accessed at http://localhost/project/new/login which is the exactly the same thing i wa

Performance of PHP documentation

I plan to add a (detailed) documentation to my PHP code (essentially autoloaded classes). Do you think there could be a loss of performance due to drastically increased file size, or is it anecdotic ? ThanksIf performance is a concern, use APC so you

Performance benchmark: PHP generated content VS. javascript and DOM on AJAX

For the following pretty straightforward task: query a list of products from a DB and present it on a webpage, consider 2 setups: Setup1: PHP script queries. All content is built on the server and the entire page is served back to the client. Setup2:

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK