previousPHP_Compat::loadFunction (Previous) (Next) PHP_Compat::loadVersionnext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

PHP_Compat::loadConstant

PHP_Compat::loadConstant() – Chargement d'une constante ou d'un tableau de constantes

Synopsis

require_once 'PHP/Compat.php';

mixed PHP_Compat::loadConstant ( mixed $constant )

Description

Charge une constante ou un tableau de constantes.

Parameter

mixed $constant

Le nom ou un tableau de noms de constantes à charger

Return value

mixed

  • TRUE si la constante a été chargée.
  • FALSE si la constante n'a pû être chargée. Soit elle n'a pû être chargée, soit elle est déjà définie.
  • Si vous spécifiez un tableau de constantes à charger, un tableau de valeurs TRUE/FALSE est retourné.

Example

Chargement d'une constante avec la classe :

<?php
require_once 'PHP/Compat.php';

// Chargement de E_STRICT
PHP_Compat::loadConstant('E_STRICT');

// Chargement de E_STRICT et de PATH_SEPATATOR
PHP_Compat::loadConstant(array('E_STRICT''PATH_SEPARATOR'));

// Chargement le groupe de constantes STD (STDIN, STDOUT, STDERR)
PHP_Compat::loadConstant('STD');
?>

Vous pouvez également charger une constante sans utiliser la classe.

Chargement d'une constante manuellement :

<?php
require_once 'PHP/Compat/Constant/E_STRICT.php';
?>

Note

This function should be called statically.

previousPHP_Compat::loadFunction (Previous) (Next) PHP_Compat::loadVersionnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.