I'm trying to decide if it's appropriate to use a class for declaring a set of ~20 public functions:
if (!class_exists('example')) {
class example {
# Declare ~20 functions (methods), all of
# which are public. (There's nothing else
# in the class.)
public static function one() { /* ... */ }
public static function two() { /* ... */ }
# ...
} # class
}
making the methods available as:
example::one();
example::two();
What pros/cons are there to the above approach vs. simply doing this:
if (!defined('EXAMPLE_LOADED')) {
define('EXAMPLE_LOADED', true);
function example_one() { /* ... */ }
function example_two() { /* ... */ }
# ...
}
making the functions available as:
example_one();
example_two();
EDIT - related performance tests: