Re: Java - toString() <-> php - ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Adi

http://www.php.net/manual/en/ref.classobj.php

Check out the link above, and I'm sure you'll find what you are looking for. 
You will find functions there called get_class & get_class_vars that I think 
you will find very helpful.

Hope this helps...

-sonu


"Adi Zebic" <adi@xxxxxxxxxxxx> wrote in message 
news:42EEC5B1.1080907@xxxxxxxxxxxxxxx
> 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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux