merged branch nikic/allowIsDefinedOnMethods (PR #490)
authorFabien Potencier <fabien.potencier@gmail.com>
Sun, 30 Oct 2011 13:46:53 +0000 (14:46 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Sun, 30 Oct 2011 13:46:53 +0000 (14:46 +0100)
commitc001264a06ef5966b4ee48d91f6589b273ee41f3
treef73ae134ab6d8b14feb902e7c400dcda67e4b733
parentd7120d1bf2ba4a01754beebe94b5dc1ae84bde00
parent930330fff0748a61c88ffdb010db6455dc7d07db
merged branch nikic/allowIsDefinedOnMethods (PR #490)

Commits
-------

930330f Allow defined test and default filter on methods

Discussion
----------

Allow defined test and default filter on methods

Patch for #487.

---------------------------------------------------------------------------

by fabpot at 2011/10/30 03:45:49 -0700

Problem is when some of the arguments reference variables that do not exist (`foo.bar(bar.foobar)`). That's why I've added the check on arguments.

---------------------------------------------------------------------------

by nikic at 2011/10/30 03:58:58 -0700

@fabpot I'm not exactly sure what is the expected behavior in that case. When writing `foo.defined(undefined)|default()` I think an exception is the expected behavior (because there is an undefined variable without default, even if it is in the method arguments). With `foo.undefined(undefined)|default()` on the other hand I'm not sure. One could argue that as the method does not exist the arguments never need to be evaluated.

---------------------------------------------------------------------------

by fabpot at 2011/10/30 05:49:46 -0700

The same code is used for the `defined` test: what would be the expected behavior for `foo.defined(underfined) is defined`?