Re: [PHP-DEV] Method check - Can someone create a RFC for it?

2013-03-20 Thread Matt Pelmear
On 03/20/2013 11:43 AM, Carlos Rodrigues wrote: Like Mike emaild me, i can just change my code to something like $obj->getImage()->getUrl(), where getImage() will return a mock object with getUrl() returning an empty string. But my request here is not about this case only. Imagine you have a web

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-14 Thread Matt Pelmear
On 01/14/2013 10:12 PM, Herman Radtke wrote: If it is called "array_pluck" it should remove the data in question from the original array. (I'm not saying that is a desirable feature here, I'm just saying that makes more sense based on the meaning of the name you seem to prefer.) Why do you think

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-14 Thread Matt Pelmear
On 01/14/2013 02:19 PM, Lars Strojny wrote: Hi Ben, Am 14.01.2013 um 23:16 schrieb Pierre Joye : [...] Up to you, but I'd to suggest again to re do the vote and add the naming option, easy, clear, open. I was one of the people changing from yes to no because of the name. I like the functional

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Matt Pelmear
Hi, On 01/12/2013 07:34 AM, Ben Ramsey wrote: 2) Developers coming from other languages (Ruby, JavaScript, etc.) will instantly recognize array_pluck(). It's what they'll be looking for to do the same thing, but they won't be looking for array_column(). -Ben When I have to write JavaScri

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-11 Thread Matt Pelmear
On 01/11/2013 04:17 PM, Ben Ramsey wrote: I've opened voting for the array_column() function RFC. You can vote at https://wiki.php.net/rfc/array_column#voting Regards, Ben +1 I can't vote, but I support this RFC. This is much, much simpler to use and easier to implement than most other th

Re: [PHP-DEV] '9223372036854775807' == '9223372036854775808'

2012-04-13 Thread Matt Pelmear
On 04/13/2012 09:12 AM, Rasmus Lerdorf wrote: On 04/13/2012 09:09 AM, Stas Malyshev wrote: However I think it would make sense not to use this conversion in string comparisons when we know it's lossy - it seems to be outside of the use case for such comparisons and it seems apparent by now that

Re: [PHP-DEV] Fix for #53727 (is_subclass_of resolution with interfaces)

2011-06-29 Thread Matt Pelmear
class_implements() this is what I thought it did before reading the docs) -matt On Jun 30, 2011 12:46 AM, "David Muir" wrote: > On 30/06/11 11:13, Matt Pelmear wrote: >> Seems odd to me that is_subclass_of returns true for interfaces... I never >> realized that before. >&g

Re: [PHP-DEV] Fix for #53727 (is_subclass_of resolution with interfaces)

2011-06-29 Thread Matt Pelmear
Seems odd to me that is_subclass_of returns true for interfaces... I never realized that before. Personally I would prefer a separate method to check for interfaces, since they aren't really classes (at least in my head), but I suppose that would break BC. (I've always wanted a method for checking

[PHP-DEV] DOMNode::getAttribute()

2011-06-03 Thread Matt Pelmear
Hello, I discovered today that the DOMNode::getAttribute() function (which is undocumented on the php site) returns an empty string if the requested attribute doesn't exist in the node. >From the source: if (value == NULL) { RETURN_EMPTY_STRING(); } else {

[PHP-DEV] == Comparison type juggling

2011-04-22 Thread Matt Pelmear
I'm sure this has probably been covered here in the past, but I've been unable to find a good way to search for it, so I'll just ask. if( '2011020402421730' === '20110204024217300264' ) echo 'BAD'; else echo 'GOOD'; results in "GOOD" being echoed. However, if( '2011020402421730' == '

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-08 Thread Matt Pelmear
Hello all, First post here; been watching for a while though. IMHO: 1) Implicit isset() checks in ?: would be bad. This would not "silently improve not-so-well written code"; In fact it would make not-so-well written code more difficult to debug. I can't count the number of times I've run across c