<?php class A { private $_locations = array(); public $test = array(); private $_test = array(); public function getResult() { var_dump($this->_locations = true); // works var_dump($this->_locations = "test"); // works var_dump($this->_locations = array()); // works var_dump($this->_locations = array("test")); // produces a critical error var_dump($this->_locations = array("test" => "test")); // produces a critical error var_dump($this->_locations[] = "test"); // produces a critical error var_dump($this->_locations["test"] = "test"); // produces a critical error var_dump($test = array("test" => "test")); // works var_dump($this->test = array()); // works var_dump($this->test = array("test")); // works var_dump($this->_test = array()); // works var_dump($this->_test = array("test")); // works } } $obj = new A(); $obj->getResult();
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`