You are here: Indirect object access in php4 « PHP Programming Language « IT news, forums, messages
Indirect object access in php4

Posted by Zioth on 10/11/80 11:39

class A {
function Get() {return $this;}
}
$obj = new A();


In php5, the following statement is valid:
$x = $obj->Get()->Get();

In php4, I get the following error:
parse error, unexpected T_OBJECT_OPERATOR

I know I can do this:
$x = $obj->Get();
$y = $x->Get();

but I'd rather not. Is there a simple, one-line way to do indirect
object references in php4?

And yes, I know my example is silly. My real problem is for more
complicated cases, where multiple classes are involved.

 

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

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