[TYPO3-team-core-v5] Sniff checking for PHP open tags - problem to solve

Karsten Dambekalns karsten at typo3.org
Fri Jun 6 14:35:57 CEST 2008


Hi.

I am currently looking at the FLOW3CGL code, and found there is a sniff to check there is only one PHP open tag in a file.

The fixture for the unit test for that sniff is F3_FLOW3CGL_Checks_FileStructure_FixturesOpenTagSniff_MoreThanOne, and contains one of "<?php" and "<?". The sniff does not detect the second PHP open tag on my machine - because I have short_open_tag set to off in php.ini.

This means the tokenizer doesn't see "<?" as a tag. And it means that if short_open_tag is off, we cannot check for "<?". I suggest to change the fixture to contain to long PHP open tags and just accept the risk of missing broken code with the sniff...

What do you think?

Regards,
Karsten
-- 
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo



More information about the TYPO3-team-core-v5 mailing list