Pogledajte određenu poruku
Staro 24. 08. 2005.   #15
noviKorisnik
Dejan Katašić
Wrote a book
 
Avatar noviKorisnik
 
Datum učlanjenja: 10.06.2005
Lokacija: Novi Sad
Poruke: 1.017
Hvala: 129
86 "Hvala" u 43 poruka
noviKorisnik će postati "faca" uskoro
Default

Upecao sam nešto :-)
PHP kôd:
<?php
class parent
{
    var 
$child;
    function 
parent ()
    {
        
$this -> child = new child ();
    }
    function 
getChild ()
    {
        return 
$this -> child;
    }
}
class 
child
{
    var 
$property;
    function 
setValue ($value)
    {
        
$this -> property $value;
    }
    function 
getValue ()
    {
        return (string) (int) (bool) 
$this -> property;
    }
}
    
$parent =   new parent ();
@   
$child  = & $parent -> getChild ();
    
$parent -> child -> setValue (1);
die (
PHP_VERSION ' : ' $child -> getValue ());
?>
Outputi su
Citat:
4.4.0 : 0
i
Citat:
4.3.11 : 1
:-)))
probajte u peticama, živo me interesuje...
noviKorisnik je offline   Odgovorite uz citat