- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
function extCreateObject( $name, $p ) {
$p = array_values( $p );
switch ( count( $p ) ) {
case 0:
return new $name;
case 1:
return new $name( $p[0] );
case 2:
return new $name( $p[0], $p[1] );
case 3:
return new $name( $p[0], $p[1], $p[2] );
case 4:
return new $name( $p[0], $p[1], $p[2], $p[3] );
case 5:
return new $name( $p[0], $p[1], $p[2], $p[3], $p[4] );
case 6:
return new $name( $p[0], $p[1], $p[2], $p[3], $p[4], $p[5] );
default:
wfDebugDieBacktrace( "Too many arguments to constructor in extCreateObject" );
}
}