Reply to Re: [PHP] Java - toString() <-> php - ?

Your name:

Reply:


Posted by Rory Browne on 10/04/03 11:23

Um - did you read my last email regarding var_dump var_export and print_r

Did you try them?

Do they do what you want?

On 8/2/05, Adi Zebic <adi@beeznest.net> wrote:
> Rory Browne a écrit :
> > I haven't a monkies what that code(your java) does, and I don't have
> > time to analyse it(in expensive cybercafe), but you may want to
> > consider www.php.net/print-r www.php.net/var-dump and
> > www.php.net/var-export
> >
> > I think they may do what you want without using the toString method,
> > which for what you're describing is basicly an ugly hack.
> >
> > One more thing: Enlighten me: What exactly do you mean by "live
> > evolution" in your php/java context.
>
> If in php context you have class, say, A:
>
> class A
> {
>
> var $t1;
> var $t2;
> var $t3;
>
> //After, you have object contructor of type A
> //we have something like this
>
> function A ($var1, $var2, $var3)
> {
> $this -> t1 = $var1;
> $this -> t2 = $var2;
> $this -> t3 = $var3;
> }
>
> ....some other code
> }
>
> //than in some other class we have something like this:
>
> class someOtherClass
> {
> $aConstructor = new A(1,2,3);
> //values of t1, t2 and t3 are 1,2 and 3 now
> }
>
> Right? yes.
>
> How you can you do something like this inside of "someOtherClass"
>
> print ($aConstructor);
>
> to finally have some nice output like
> Value of t1 is 1;
> Value of t2 is 2;
> Value of T3 is 3;
>
> or just:
>
> 1
> 2
> 3
>
> Without creating functions like getValues()
>
> function getValues()
> {
> print ($this -> t1);
> print ($this -> t2);
> print ($this -> t3);
> }
>
> and after explicit invoke function:
>
> $aConstructor -> getValues();
>
> So, what I want is
> this: print ($aConstructor);
>
> and not this:
>
> $aContructor -> getValues();
>
> Am I clear :-)
>
>
> ADI
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Back to original 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

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