Creating a rather simple custom CMS on my client’s server, everything seems ok until I start testing out some of my ready made proprietary PHP classes. The problem is that I make things in PHP5 and all the classes are in PHP5 format.
Quickly searched and scanned through some old tutorials for PHP4 about creating classes. It’s some radical changes indeed. Just to soothe your possible frustrations when migrating PHP5 classes into a PHP4 platform:
- PHP4 classes don’t have scope operators such as private, public or protected.
- PHP4 constructional function should be the same name with that of the class. __construction won’t work.
- Class variables in PHP4 classes are declared with the keyword ‘var’ rather than private or public.
I thought I might write this down for those who are rewriting PHP5 classes for obsolete implementations of PHP such as PHP4.