[TYPO3-core] RFC: fix feature request #568

Michael Stucki michael at typo3.org
Tue Feb 21 10:16:54 CET 2006


Hi Wolfgang,

>  I saw no reason to do so.
>  I think (or thought) I can take my own decisions to some extent.

You can, but telling me would probably help me to understand the reason for 
it. See below...

> > Remove __construct() and move it into the function t3lib_matchCondition()
> >
> > -       function t3lib_matchCondition() {
> > -               $this->__construct();
> > -       }
>
>  That's a PHP5 constructor, I don't know what's wrong with it?
>  Calling it from t3lib_matchCondition (which is a method, not a
>  function ;-)) is for PHP4 backwards compatibility .

Honestly, I didn't know that. Wondering why other "function t3lib_..." 
_methods_ don't need to be changed as well, I found the answer on a nice 
overview page about PHP 4/5 changes.

Taken from 
http://www.professionelle-softwareentwicklung-mit-php5.de/erste_auflage/oop.foundations.migration.html:

In PHP 4 the name of a constructor was always equally to the name of the 
class. In PHP 5 the constructor is now called __construct. If no such method 
is declared in a class, a method with the name of the class is searched. If 
such a method is found, it will be used as the constructor. If a method named 
__construct is found, it is used in any case (independently if there is a 
method with the name of the class).

> > Change some false checks:
> >
> > -                               if (false === $matches) {
> > +                               if ($matches===false)   {
> >
> > If there are no explicit reasons for doing so, I'm going to fix this
> > tomorrow...
>
>  I don't know what you have to "fix" here, that's a matter of
>  personal style, the Coding Guidelines say nothing about
>  (or against) it.

Maybe there is one paragraph missing in the CGL:

"If something is not described in here, then you should do it the same way it 
is done all over the rest of the code."

- michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060221/61931ffe/attachment.pgp 


More information about the TYPO3-team-core mailing list