note 29879 added to language.types.object

From: Date: Thu, 27 Feb 2003 12:59:34 +0000
Subject: note 29879 added to language.types.object
Groups: php.notes 
Request: Send a blank email to php-notes+get-44610@lists.php.net to get a copy of this message
How I may use Class TYpe casting For example class Base { function getX() { } } class Base1 extends Base { function getX() { return 1; } } class Base2 extends Base { function getX() { return 2; } } $var = new Base1(); $var2 = (Base)$var; //!!! It not work??? Why??? -- http://www.php.net/manual/en/language.types.object.php http://master.php.net/manage/user-notes.php?action=edit+29879 http://master.php.net/manage/user-notes.php?action=delete+29879 http://master.php.net/manage/user-notes.php?action=reject+29879

« previous php.notes (#44610) next »