Login   Register  
PHP Classes
elePHPant
Icontem

PHP5 Features

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Sudoku Solver  >  All threads  >  PHP5 Features  >  (Un) Subscribe thread alerts  
Subject:PHP5 Features
Summary:Help?
Messages:12
Author:William Floyd
Date:2005-09-19 02:05:45
Update:2005-09-28 11:59:40
 
  1 - 10   11 - 12  

  1. PHP5 Features   Reply   Report abuse  
Picture of William Floyd
William Floyd
2005-09-19 02:05:45
Could you relay which type of PHP5 Features we need to modify to make this work with php4? I don't expect you to list this exact coding, just kinda pass along which features will not work in less than php5 so we can look at recoding those features?
Thanks,

  2. Re: PHP5 Features   Reply   Report abuse  
Picture of Ghica van Emde Boas
Ghica van Emde Boas
2005-09-19 09:00:55 - In reply to message 1 from William Floyd
Hi,
I used PHP5 syntax throughout, like public and protected and __construct.
That will be easy to change. Then, I think you will need a few & to make sure you get references to objects instead of copies.
I think that would be all you need to make it work on PHP4.
Let me know if you have any problems!

  3. Re: PHP5 Features   Reply   Report abuse  
Picture of Praveen
Praveen
2005-09-24 05:14:06 - In reply to message 2 from Ghica van Emde Boas
I have tried to cconvert this PHP5 to PHP4 by changing the constructor to the function with the same class name, $this->solver = new Solver(); to $solver = new Solver(); and removed all the function access types but still it is giving the following error. Could you please have a look it once and let me know where I have gone wrong and if possible can you please also give PHP4 version for this.

############################
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in D:\apps\Apache2\Apache2\htdocs\Test\sudoku\Sudoku.class.php on line 23
############################

Thanks in advance
Praveen

  4. Re: PHP5 Features   Reply   Report abuse  
Picture of Ghica van Emde Boas
Ghica van Emde Boas
2005-09-24 15:12:24 - In reply to message 3 from Praveen
Hi,
I took a quick look also, it is a bit of a problem because I do not have a PHP 4 system. Anyway, just doing the changes you said is not enough. It is also necessary to assign by reference all classes. I will take a look at it this weekend, and let you know.

  5. Re: PHP5 Features   Reply   Report abuse  
Picture of Praveen
Praveen
2005-09-25 19:03:04 - In reply to message 4 from Ghica van Emde Boas
Thank you so much. I am eagerly waiting for the package. If you can make the changes for one file so that I will change the remaining files. Thank you so much...

  6. Re: PHP5 Features   Reply   Report abuse  
Picture of Ghica van Emde Boas
Ghica van Emde Boas
2005-09-26 15:05:05 - In reply to message 5 from Praveen
OK. I did a PHP4 version. It turned out to be far from trivial.
Because the package was using complex arrays of objects and a lot of foreach, using references all over did not help. Therefore I rewrote part of the package to use arrays with numbers (which indicated the number-fields in the array) instead of arrays of number-field objects.

You can find the complete set of scripts needed in the sudoku4 subdirectory.

  7. Re: PHP5 Features   Reply   Report abuse  
Picture of Praveen
Praveen
2005-09-26 18:42:35 - In reply to message 6 from Ghica van Emde Boas
Thank you so much. It is working fine. Now I will try to modify the code and work on improvements on this and let you know if I did any modifications

Thanks

  8. Re: PHP5 Features   Reply   Report abuse  
Picture of William Floyd
William Floyd
2005-09-27 04:02:48 - In reply to message 6 from Ghica van Emde Boas
Warning: main(NumberField.class.php): failed to open stream: No such file or directory in ../../sudoku/Solver.class.php on line 15.I simply renamed the file to match the above it worked! Thanks so much for taking the time and effort to help us with this.Mark<br />

  9. Re: PHP5 Features   Reply   Report abuse  
Picture of William Floyd
William Floyd
2005-09-27 04:04:24 - In reply to message 8 from William Floyd
OOPS! If possible can you edit my previous message and take out my home server's address?

THanks!

  10. Re: PHP5 Features   Reply   Report abuse  
Picture of Ghica van Emde Boas
Ghica van Emde Boas
2005-09-27 19:17:10 - In reply to message 9 from William Floyd
Hi,
I think you must ask the webmaster, Manuel Lemos to do this.
By the way, you should not have had this error message. Must be sometihng particular with your path settings?

 
  1 - 10   11 - 12