Re: Question about Classes

From: Date: Wed, 30 Oct 2002 22:34:22 +0000
Subject: Re: Question about Classes
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-90346@lists.php.net to get a copy of this message
This works only with ZE2. -- M.CHAILLAN Nicolas nicos@php.net www.WorldAKT.com Hébergement de sites internets. "Juerg Zgraggen" <j.a.z@bluewin.ch> a écrit dans le message de news: 20021030214933.61190.qmail@pb1.pair.com... > hi > > i made a class in PHP. id like to define public and private function for > that class like in C++. is this possible? the public and private inside the > class does not work... why? > > thanx, jürg zgraggen > > /* My Class*/ > class bz_ClassX > { > var $nNumber; > var $strDescription; > var $strModul; > > // public: ??? does not work > function bz_ClassX() > { > $this->bz_reset(); > } > function bz_print() > { > echo "<b>Return-Object</b><br>"; > echo "<table>"; > echo "<tr><td>Modul:</td><td>" . $this->strModul . > "</td></tr>"; > echo "<tr><td>Method:</td><td>" . $this->strMethod . > "</td></tr>"; > echo "<tr><td>Number:</td><td>" . $this->nNumber . > "</td></tr>"; > echo "<tr><td>Description:</td><td>" . > $this->strDescription . > "</td></tr>"; > echo "</table>"; > } > function bz_clear() > { > $this->bz_reset(); > } > > // private: ??? does not work > function bz_reset() > { > $this->strModul = "Unknown"; > $this->strMethod = "Unknown"; > $this->nNumber = 0; > $this->strDescription = "Unknown"; > } > } > > > >

« previous php.dev (#90346) next »