php - Set and merge 'in-place': could it cause problems?
Get the solution ↓↓↓I have a static member variable and I set its values like so:
private static $HTML_FILTER = [
'div' => ['aria' => 1]
];
public function __construct($allowed_html) {
// Is the below dangerous?
MyClass::$HTML_FILTER = array_merge_recursive(allowed_html, MyClass::$HTML_FILTER);
// Should I instead do
$temp = array_merge_recursive(allowed_html, MyClass::$HTML_FILTER);
MyClass::$HTML_FILTER = $temp;
}
Essentially I am interrogating a static array right before I (over)write it. Would this cause issues on certain versions of PHP or all?
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: illuminate\http\exceptions\posttoolargeexception
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.