Re: [PHP-DEV] leak()

2002-11-19 Thread Juerg Zgraggen
thanx, regards, jürg



"Derick Rethans" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Tue, 19 Nov 2002, Juerg Zgraggen wrote:
>
> > hi derick
> > thanx for answering...
> >
> > do i understand it right? this function is used for generating a memory
leak
> > which you want to test?
>
> Yes it is.
>
> > and whats about this function emalloc() ... i did not find it on
php.net. i
> > suppose it is used to alloc memory?
>
> It's the Zend memory manager version of C's malloc(); this version will
> dump errors when the script ends and it was not freed. This mechanism
> can be tested with the PHP leak() function.
>
> Derick
>
> --
>
> --
-
>  Derick Rethans   http://derickrethans.nl/
>  JDI Media Solutions
> --[ if you hold a unix shell to your ear, do you hear the
c? ]-
>



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] leak()

2002-11-19 Thread Juerg Zgraggen
hi derick
thanx for answering...
do i understand it right? this function is used for generating a memory leak
which you want to test?
and whats about this function emalloc() ... i did not find it on php.net. i
suppose it is used to alloc memory?
regards, jürg zgraggen




"Derick Rethans" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Tue, 19 Nov 2002, Juerg Zgraggen wrote:
>
> > hi
> >
> > does anybody know how the function leak() works?
> > can anybody explain?
>
> It leaks memory, by only running an emalloc without a free:
>
> /* {{{ proto void leak(int num_bytes=3)
>Cause an intentional memory leak, for testing/debugging purposes */
> ZEND_FUNCTION(leak)
> {
> int leakbytes=3;
> zval **leak;
>
> if (ZEND_NUM_ARGS()>=1) {
> if (zend_get_parameters_ex(1, &leak)==SUCCESS) {
> convert_to_long_ex(leak);
> leakbytes = (*leak)->value.lval;
> }
> }
>
> emalloc(leakbytes);
> }
> /* }}} */
>
> Derick
>
> --
>
> --
-
>  Derick Rethans   http://derickrethans.nl/
>  JDI Media Solutions
> --[ if you hold a unix shell to your ear, do you hear the
c? ]-
>



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] leak()

2002-11-19 Thread Juerg Zgraggen
hi

does anybody know how the function leak() works?
can anybody explain?

thanx, regards,
jürg zgraggen



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Question about Classes

2002-10-30 Thread Juerg Zgraggen
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 "Return-Object";
   echo "";
   echo "Modul:" . $this->strModul . "";
   echo "Method:" . $this->strMethod . "";
   echo "Number:" . $this->nNumber . "";
   echo "Description:" . $this->strDescription .
"";
   echo "";
  }
  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";
  }
 }





-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php