11-30-2009, 08:48 PM
|
#12 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
Assuming it wouldn't be easier to just rename the function for different uses (don't overload if you don't have to), if you were determined to use the same name you could always use a switch.
You could alternatively use count() on $args, or place your code where the some_funcs() are... same theory applies to overloading for the purposes of dealing with different objects,
php Code:
function fake_overload ( $obj ) { if ( ! is_object( $obj ) ) return; $reflect = new ReflectionClass ( $obj ); switch ( $reflect-> getName() ) { case 'first_object': ...
|
|
|
|