class Overload {
public function __call($method, $arg) {
if($method == 'test') {
if (is_object($arg[0])) {
$this->testObject($arg[0]);
} else if (is_array($arg[0])) {
$this->testArray($arg[0]);
} else {
$this->testScalar($arg[0]);
}
}
}
function testObject($arg) {
echo $arg->test().'<br />';
}
function testArray($arg) {
echo implode(',',$arg).'<br />';
}
function testScalar($arg) {
echo $arg.'<br />';
}
}
$ov = new Overload;
$ov->test(new A());
$ov->test(array(1,2,3));
$ov->test('cat');
class A {
function test() {
return 'object';
}
}
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 30 |
아우겐나이스
|
21년 전 | 4050 | |
| 29 |
아우겐나이스
|
21년 전 | 4437 | |
| 28 |
아우겐나이스
|
21년 전 | 3466 | |
| 27 | 21년 전 | 5835 | ||
| 26 | 21년 전 | 3113 | ||
| 25 | 21년 전 | 6085 | ||
| 24 | 18년 전 | 3649 | ||
| 23 | 21년 전 | 3640 | ||
| 22 | 21년 전 | 4247 | ||
| 21 | 21년 전 | 3818 | ||
| 20 | 21년 전 | 4225 | ||
| 19 | 21년 전 | 6678 | ||
| 18 | 21년 전 | 4733 | ||
| 17 | 21년 전 | 6990 | ||
| 16 | 21년 전 | 4170 | ||
| 15 | 21년 전 | 2635 | ||
| 14 | 21년 전 | 4977 | ||
| 13 | 21년 전 | 3400 | ||
| 12 |
Recluse
|
21년 전 | 3881 | |
| 11 |
아우겐나이스
|
21년 전 | 3568 | |
| 10 |
Recluse
|
21년 전 | 3392 | |
| 9 | 21년 전 | 3994 | ||
| 8 | 21년 전 | 5173 | ||
| 7 | 21년 전 | 4762 | ||
| 6 | 21년 전 | 5687 | ||
| 5 | 21년 전 | 4115 | ||
| 4 | 21년 전 | 4842 | ||
| 3 | 21년 전 | 4740 | ||
| 2 | 21년 전 | 3244 | ||
| 1 | 22년 전 | 4342 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기