3 ms·
There should be a big fat warning in front of this very bad advice, and I particularly dislike the last paragraph about intercepting error handlers to cover up
by phpnode 14y ago
There should be a big fat warning in front of this very bad advice, and I particularly dislike the last paragraph about intercepting error handlers to cover up your ugly hack.Some newcomer is going to run with this idea without understanding the many, many problems it can introduce. Until 5.4 the @ operator caused dramatic slowdowns on everything it touched because PHP had to jump through hoops to suppress the errors. It's funny to see someone advocating using it for performance reasons now.
If you need a mutex, you should use a mutex.
Yet another reason not to use smarty I guess.
- ck2 14y agoDefine "dramatic slowdowns" ? added: Apparently someone on php.net agrees with you http://php.net/manual/en/language.operators.errorcontrol.php#102543 http://php.net/manual/en/language.operators.errorcontrol.php... they say it takes 1.7 times as long BUT that is only .005 ms in their example
- sandfox 14y agoThat example is amongst the worst synthetic benchmarks I have seen in a while. Also it comes from someone who is associated with piwik. A PHP project that makes wordpress look tidy, well engineered and speedy. The more deeply nested the callstack is when you supress, the bigger the performance hit (slight generalisation and slightly from memory).
- ck2 14y agoI spent 10-15 minutes poking around php internals newslist for an explanation of the php 5.4 changelog "improved performance of the (@) silence operator" without luck. It's just listed as a zend engine improvement without specifications. Someone posted here a clear example of why (in earlier php5) it generates far worse opcode: http://derickrethans.nl/five-reasons-why-the-shutop-operator-should-be-avoided.html http://derickrethans.nl/five-reasons-why-the-shutop-operator...
- notum 14y agoI'm being offered a "Serbo-Croatian" translation and the site's captcha is broken. Might be unwise to judge authority on the subject just from that, however I decided not to read the article.
- sequoia 14y agoYou are correct. It is wrong -very very wrong- to view programming advice as suspect merely because the content is offered in a language you don't speak. EDIT: I am wrong. See below.
- notum 14y agoIt's being offered in a language that does not exist. http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
- deleted 14y ago[deleted]
- mootothemax 14y agoIt's being offered in a language that does not exist. http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes Wikipedia has what appears to be quite a comprehensive article about it: http://en.wikipedia.org/wiki/Serbo-Croatian http://en.wikipedia.org/wiki/Serbo-Croatian Its scope is referred to as a "macrolanguage" here under ISO 639-3: http://www.sil.org/iso639-3/documentation.asp?id=hbs http://www.sil.org/iso639-3/documentation.asp?id=hbs
- deleted 14y ago[deleted]