Re: PHP4 vs PHP5 classes

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

 



jeff.mills@xxxxxxxxxx wrote:
Maybe setting $this->max should be done in

fetchSelectData

since that's what is causing/creating your loop.


Thanks Chris, I copied the code into the fetchSelectData function and it
seems to be working fine now!
Just need to test removing the code from the constructor to make sure its
still working, and also test that php4 is still working.

I'm just concerned that the code might also be called from somewhere else.

You've cured my headache!



Don't forget that in PHP5, the constructor named has changed. In PHP4 it called a method with the same name as the class. But, in PHP5, it looks for __construct() instead.

I workaround that I use is this:

<?php

class myClass {

  function __construct() {
  }

  function myClass() {
    $this->__construct();
  }

}

?>

With this type of construct, your classes will initialize the same between PHP4 and PHP5.

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare


--
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