It doesn't introduce much overhead if you make use of conditional function definitions:
<?php
if (function_exists('apc_load_constants')) {
function define_array($key, $arr, $case_sensitive = true)
{
if (!apc_load_constants($key, $case_sensitive)) {
apc_define_constants($key, $arr, $case_sensitive);
}
}
} else {
function define_array($key, $arr, $case_sensitive = true)
{
foreach ($arr as $name => $value)
define($name, $value, $case_sensitive);
}
}
define_array('NUMBERS', Array('ONE' => 1, 'TWO' => 2, 'THREE' => 3));
?>