[TYPO3-core] RFC: T3-speedup preg insted of ereg

Bernhard Kraft kraftb at kraftb.at
Tue Dec 27 21:24:56 CET 2005


Martin Kutschker wrote:
> Bernhard Kraft <kraftb at kraftb.at> writes on 
> Sun, 25 Dec 2005 18:07:27 +0100 (MET):
> 
> 
>>You can only check for "false" using === AFAIK.
> 
> 
> 
> No, you can compare anything you like. But the very first test is the type of the compaed elements. eg
> 
> $a = 1
> $b = "1"
> 
> $a == $b => true
> $a === $b => false

We have opposite logic :)

I didn't mean that === can get used only for the purpose of checking on true/false

but that you can ONLY check for true/false using the === operator (of course
(is_bool($a) && $a) would be equal to ($a === true) but with the ONLY method i
also meant that it is the only "single statement" method in PHP (you can do
many things by working around)


Attached is the patch of t3lib_parsehtml with all changes for NEWS.txt and Changelog.

It is taken care that problems with t3lib_parsehtml get reported in the bugtracker at
the appropriate location and I'm monitoring this issue. I will be in front of my box
everyday checking for possible problems with t3lib_parsehtml.


I made a little change to the getSubpart and substituteSubpart replacing the very complicated
preg statements with ? operator for subparts by 3 simple preg's instead. It is still faster and
in most cases (when markers with comments around are used) only the first one will get evaluated.


Stucki gave me his ok and I will apply it now.

The attached patch is for your convinience.


greets,
Bernhard
-- 
----------------------------------------------------------------------
"Freiheit ist immer auch die Freiheit des Andersdenkenden"
Rosa Luxemburg, 1871 - 1919
----------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: preg_t3lib_parsehtml_2005-12-27.diff
Type: text/x-patch
Size: 29114 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20051227/7b4aaf64/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20051227/7b4aaf64/attachment.pgp 


More information about the TYPO3-team-core mailing list