mixed PHP_Compat::loadConstant (
mixed $constant
)
Charge une constante ou un tableau de constantes.
Le nom ou un tableau de noms de constantes à charger
mixed
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';
?>
This function should be called statically.