Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Yaf_Application::__constructYaf_Application::execute>
^Yaf_ApplicationLast updated: Mon, 26 Oct 2026

Yaf_Application::environ

(Yaf >=1.0.0)

Yaf_Application::environ — Retrieve the environment

Description

public function Yaf_Application::environ(): ?string

Retrieve the environment name of the application, which is defined by the yaf.environ directive (or the environ constructor parameter), and defaults to "product".

Parameters

This function has no parameters.

Return Values

The environment name of the application.

Examples

Example #1 Yaf_Application::environ() example

<?php
$config = array(
    "application" => array(
        "directory" => realpath(dirname(__FILE__)) . "/application",
    ),
);

/** Yaf_Application */
$application = new Yaf_Application($config);
print_r($application->environ());
?>

The above example will output something similar to:

product

<Yaf_Application::__constructYaf_Application::execute>
^Yaf_ApplicationLast updated: Mon, 26 Oct 2026