Konstruktoren von Klassen haben keinen Returnwert steht oft geschrieben.
Stimmt wohl nicht so ganz.
Getestet unter:
PHP V5.3.8 Win
PHP V5.5.5 Linux
LG jspit
Stimmt wohl nicht so ganz.
PHP-Code:
class foo{
function __construct(){
return 12345;
}
}
class bar extends foo{
function __construct(){
$parentReturn = parent::__construct();
var_dump($parentReturn);
}
}
$obj = new bar; //Ausgabe int(12345)
PHP V5.3.8 Win
PHP V5.5.5 Linux
LG jspit
Kommentar