Re: alpha1 status update
| From: | Lukas Kahwe Smith | Date: | Wed, 30 Jul 2008 21:04:45 +0000 |
| Subject: | Re: alpha1 status update | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39489@lists.php.net to get a copy of this message | ||
On 30.07.2008, at 22:57, Dmitry Stogov wrote:
This was in the thread "closures questions" and later there were some votes by Stas and Marcus in favor of its removal in the "towards 5.3 alpha1" thread. Here is a comment by Christian about the topic:- remove __toString() from closures (Johannes/Dmitry)What is wrong here? What behavior do you prefer? I just missed the discussion.
regards, Lukas Kahwe Smith smith@pooteeweet.orgThere is one case which *may* cause problems: function doSomething ($callback) { if (!is_callable ($callback)) { throw new Exception (...); } // special treatment if ($callback == 'default') { ... } else { ... } } Here, the comparison of $callback with 'default' will yield a notice that $callback couldn't be converted. The comparison will fail correctly, of course, but it could cause some confusion. The correct way of comparing would obviously be using ===, that won't cause these hickups.so do we even want the toString() method?IMHO we should drop toString from Closure.