Weet iemand waarom de eerste syntax niet correct is uit onderstaand voorbeeld?
Of is dit gewoon niet mogelijk in PHP?
Of is dit gewoon niet mogelijk in PHP?
PHP:
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
| class Foo1 { function getValue() { return 'Hello, world!'; } } class Foo2 { function getValue() { return new Foo1(); } } $foo = new Foo2(); // Werkt niet echo $foo->getValue()->getValue(); // Werkt wel $temp = $foo->getValue(); echo $temp->getValue(); |
Developer Accused Of Unreadable Code Refuses To Comment