You are here: Change Object Type « PHP « IT news, forums, messages
Change Object Type

Posted by Marc Serra on 10/30/01 11:14

hi,
i'm looking for a solution to change the object's class.

i got a class and a derived class like this: (just for example,
completly stupid ^^)

class Ex{
var a;
var b;
}

class Ex2 extends Ex{
var c;
}

i want to create an object Ex and after change the object class to Ex2
to complete him like this:
$ex = new Ex();
$ex->a = 1;
$ex->b = 2;

$ex2 = (Ex2)$ex; /// here i want to convert object Ex to object Ex2
$ex2->c = 5;

Can someone help me? I know it's possible to do this in JAVA but it is
possible to do the same in PHP ?

thx in advance,
Marc.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация