You are here: Re: [PHP] Java - toString() <-> php - ? « PHP « IT news, forums, messages
Re: [PHP] Java - toString() <-> php - ?

Posted by Rory Browne on 08/02/05 18:49

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.

On 8/2/05, Adi Zebic <adi@beeznest.net> wrote:
> To print "state" of object in Java I can define toString() function and
> then I can do something like this:
>
> Java exemple:
> *************************************
> import java.io.*;
> import java.util.*;
>
> public class ReadTextFromFile
> {
> private static String line;
> private static String Fable = new String ("");
> private static String NomFable;
> private static int cptLine = 0;
> private static int nbrPersonnes = 0;
> private static String nomPersonnes = new String ("");
> private static ArrayList AListe = new ArrayList(nbrPersonnes);
>
> //**********************************************************************************
> public String toString()
> {
> return getClass().getName()
> + " [ Nom de la fable: "+ NomFable
> + " <==> Nombre de personnes dans dialogue: " + nbrPersonnes
> + " ] "
> ;
> }
> ***********************************************************************************
>
> Is there similar kind of function in php that help us to print the state
> of object in his "life evolution"?
>
> Thanks
>
>
> ADI
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

 

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

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