- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
protected function CreateClass($className, $params) {
switch (count($params)) {
case 0:
return new $className();
break;
case 1:
return new $className($params[0]);
break;
case 2:
return new $className($params[0], $params[1]);
break;
case 3:
return new $className($params[0], $params[1], $params[2]);
break;
case 4:
return new $className($params[0], $params[1], $params[2], $params[3]);
break;
case 5:
return new $className($params[0], $params[1], $params[2], $params[3], $params[4]);
break;
case 6:
return new $className($params[0], $params[1], $params[2], $params[3], $params[4], $params[5]);
break;
case 7:
return new $className($params[0], $params[1], $params[2], $params[3], $params[4], $params[5], $params[6]);
break;
case 8:
return new $className($params[0], $params[1], $params[2], $params[3], $params[4], $params[5], $params[6], $params[7]);
break;
case 9:
return new $className($params[0], $params[1], $params[2], $params[3], $params[4], $params[5], $params[6], $params[7], $params[8]);
break;
case 10:
return new $className($params[0], $params[1], $params[2], $params[3], $params[4], $params[5], $params[6], $params[7], $params[8], $params[9]);
break;
default:
echo "Too many arguments";
return null;
break;
}
}