[TYPO3-core] FYI24: #8826: calls to ini_set produces warnings
Dmitry Dulepov [typo3]
dmitry at typo3.org
Wed Sep 3 12:27:41 CEST 2008
Hi!
Ingo Renner wrote:
>> How do I change PHP function to throw exceptions? 8-0 file_exists()
>> produces a PHP warning if the file does not exist. Using @ prevents
>> this warning and lets the function work as expected.
>
> if(!file_exists($file)) {
> throw new FileNotFoundException();
> }
>
> No need for an @
And you will see a PHP warning with your when file does not exist. It is a known behaviour of file_exists(): if file does not exists, you will see a warning that file does not exist. No way to prevent it without @.
--
Dmitry Dulepov
TYPO3 Core team
My TYPO3 book: http://www.packtpub.com/typo3-extension-development/book
In the blog: http://typo3bloke.net/pages/book-reviews/presentation-zen-by-garr-reynolds/
More information about the TYPO3-team-core
mailing list