Answer the question
In order to leave comments, you need to log in
PHP: Size in memory of associative array and variables?
There was a conversation about global variables and the question of writing such variables in memory actually ripened.
Suppose we have an associative array:
$aAssoc = array(
"test" => 1,
"test1" => "2",
"test2" => "OK",
);
$test = 1;
$test1 = "2";
$test3 = "OK";
Answer the question
In order to leave comments, you need to log in
In short, the array will take more. The globality of variables does not affect memory consumption and performance.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question