b4ck
0
Gerade eben ist mir etwas sehhhrr komisches aufgefallen:
erwarteter Output wäre eine notice oder error das "testtype" einen Parameter von Typ OmgType erwartet.
Output bei mir:
Getestet unter Windows (php 5.3.2) / Suse (5.3.3)
funktioniert typechecking nur mit built-in types wie array ?
// fail
hab auf beiden maschinen das ganze in symfony getestet d.h liegt wohl am error-handler vom symfony-framework.
PHP:
class OmgType {
protected $foo;
protected $bar;
}
class testclass {
public function testtype(OmgType $type) {
var_dump(is_object($type));
var_dump($type);
}
}
$testclass = new testclass();
$testclass->testtype("test");
Output bei mir:
Code:
bool(false)
string(4) "test"
Getestet unter Windows (php 5.3.2) / Suse (5.3.3)
funktioniert typechecking nur mit built-in types wie array ?
// fail
hab auf beiden maschinen das ganze in symfony getestet d.h liegt wohl am error-handler vom symfony-framework.
Zuletzt bearbeitet: