summaryrefslogtreecommitdiff
path: root/Zend/tests/magic_methods_001.phpt
blob: 412702ded555e2c5cd1966a637a6e6d7b56702a3 (plain)
1
2
3
4
5
6
7
8
9
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
42
43
44
45
46
47
48
49
--TEST--
Testing several magic methods
--FILE--
<?php

class foo {
	function __unset($a) {
		print "unset\n";
		var_dump($a);
	}

	public function __call($a, $b) {
		print "call\n";
		var_dump($a);
	}
	function __clone() {
		print "clone\n";
	}
	static public function __callstatic($a, $b) {
		print "callstatic\n";
	}

	public function __tostring() {
		return 'foo';
	}
}


$a = new foo;

$a->sdfdsa();

$a::test();

clone $a;

var_dump((string)$a);

unset($a->a);

?>
--EXPECT--
call
string(6) "sdfdsa"
callstatic
clone
string(3) "foo"
unset
string(1) "a"