Void as a str_replace() param in PHP 8

I’m trying to move my small project to PHP 8 and I’m struggling with an equivalent of str_replace() function. public function renderView($view) { $layoutContent = $this->layoutContent(); $viewContent = $this->renderOnlyView($view); return str_replace('{{content}}', ($viewContent), strval($layoutContent)); } protected function layoutContent() { ob_start(); include_once Application::$ROOT_DIR."/views/layouts/main.php"; ob_get_clean(); } protected function renderOnlyView($view) { ob_start(); include_once Application::$ROOT_DIR."/views/$view.php"; ob_get_clean(); } The problem is … Read more