All Questions
Tagged with php-internals memory-management
4
questions
-1
votes
2
answers
104
views
How (if possible) to optimize memory in this PHP example
I am trying to understand how PHP handles memory consumption in these two examples.
Example: 1
// foo.php
class foo{
public function __construct()
{
$a = new PDO(......
22
votes
4
answers
4k
views
How does PHP memory actually work
I've always heard and searched for new php 'good writing practice', for example: It's better (for performance) to check if array key exists than search in array, but also it seems better for memory ...
3
votes
1
answer
4k
views
Memory leak with malloc in php extension
I made a php extension which looks like:
PHP_FUNCTION(function_name)
{
...
proc_data = ( char * )malloc(length);
...
RETURN_STRINGL( proc_data, length, 1 );
}
function_name is the ...
12
votes
1
answer
4k
views
How does PHP assign and free memory for variables?
I was wondering when does PHP free the memory which is used for a variables
for example
function foo(){
$foo = 'data';
return $foo; // <- is the memory space for `$foo` emptied at this point?...