code: public static function renderPhpTemplate($path, array $data = []) {
          \ob_start();
          \extract($data);
          $real = \realpath($path);
  
          if($real === false)
              throw new \InvalidArgumentException("Path '$path' is not valid or does not exist");
  
          include $real;
  
          return \ob_get_clean();
      }
docs: @internal
  
  @param string $path Absolute or relative path to template file
  @param array  $data Array with data visible inside file scope
  
  @return string Compiled template content
  
  @throws \InvalidArgumentException Path is not valid or does not exist