A question about PHP memory processing

Source: Internet
Author: User
Ask a PHP memory processing problem. This post was last edited by robotguy at 15:17:38, January 1 ,.

Memory php

Assume that a variable is defined in a php file:
 

Now there are 100 people accessing this file at the same time. how many times does PHP define the $ var variable in the memory?


Reply to discussion (solution)

100 times, didn't you think of it?

File Execution: defines a variable, allocates memory, finishes execution, releases the variable, and releases the memory.

100 times, didn't you think of it?
Oh, that's it. By the way, which of the following methods can be used to define one hundred variables and an array containing 100 elements to save memory and speed? I am a newbie. I have recently debugged a program and zend studio is not very useful. I don't know how you debug the program. do you have any information about this.

You mean that one hundred variables are defined at the same time, that is, the script is executed at the same time as 100, because the memory is released at the end of the PHP script, so there is no comparability.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.