/** * @param string $property_name * * @return mixed|null */ function __get($property_name) { $value = null; Util::push_class($this); if ($this->has_method($property_name)) { $value = $this->call_method($property_name); } else { if ($this->has_object_property($property_name)) { $value = $this->get_object_value($property_name); } else { if ($this->parent->has_object_property($property_name)) { $value = $this->parent->get_object_value($property_name); } else { $class_name = implode(', ', array_unique(Util::class_stack())); if (empty($class_name)) { $class_name = get_class($this); } Util::log_error("There is no property \"{$property_name}\" in any of these class(es): {$class_name}."); } } } Util::pop_class(); return $value; }