Re: [PHP-DEV] Re: Bug with static property access

2011-10-05 Thread Dan Birken
This does seem strange. To me the error message looks fine, but it is weird that "MethodOne" works while "MethodTwo" doesn't. Seems like both should fail in a perfect world. However, this seems like a situation where bad code is tickling some weird corner case in PHP, not a situation where PHP i

Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)

2011-05-31 Thread Dan Birken
+1 To be honest, ['a': 'b'] or ['a' => 'b'] is so much better than array('a' => 'b') for general use I don't even care which one is picked, as long as one of them is picked. -Dan On Tue, May 31, 2011 at 3:43 PM, Marcel Esser wrote: > From the perspective of someone that's just trying to get stu

Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)

2011-05-31 Thread Dan Birken
st* JSON syntax. It just seems simpler that: array(1, 2) equals [1, 2] array(1 => 2) equals [1 => 2] -Dan On Tue, May 31, 2011 at 2:42 PM, Rasmus wrote: > On 05/31/2011 02:34 PM, Dan Birken wrote: > > It is worth noting that point you bring up is one that is present in PHP > &

Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)

2011-05-31 Thread Dan Birken
It is worth noting that point you bring up is one that is present in PHP currently: php > print_r(json_decode(json_encode(array('a' => 'b'; stdClass Object ( [a] => b ) php > print_r(json_decode(json_encode(array('a', 'b'; Array ( [0] => a [1] => b ) -Dan On Tue, May 31, 201

Re: [PHP-DEV] Adding a more logical string slicing function to PHP

2011-03-31 Thread Dan Birken
On a somewhat related note (and going back a little to my original patch), languages like python and ruby allow slicing on array/string objects with $string_or_array[start:end] syntax. I think this would be really useful syntax in PHP as well (and would of course make the initial patch I submitted

Re: [PHP-DEV] Adding a more logical string slicing function to PHP

2011-03-30 Thread Dan Birken
d, I would pick str_slice. -Dan On Wed, Mar 30, 2011 at 3:35 PM, Jevon Wright wrote: > If substr() really was so bad, then surely we'd see userland > implementations of str_slice() in every project? > > Jevon > > On Wed, Mar 30, 2011 at 7:06 PM, Dan Birken wrote: >

Re: [PHP-DEV] Adding a more logical string slicing function to PHP

2011-03-30 Thread Dan Birken
The example I picked in my patch was a little contrived, however I do think it is a useful benefit for functions to work in ways people expect, even in edge cases. There are a lot of people out there who do not know the difference between == and ===, and I think the fact that str_slice() has one l

Re: [PHP-DEV] Adding a more logical string slicing function to PHP

2011-03-30 Thread Dan Birken
;) > > Seriously...it behaves the same as implementations in other languages as > long as values are positive, right? how is that counter-intuitive? How do > other languages handle negative values? > > Am 30.03.2011 08:06, schrieb Dan Birken: > > My apologizes if I am brin

[PHP-DEV] Adding a more logical string slicing function to PHP

2011-03-29 Thread Dan Birken
My apologizes if I am bringing up a topic that has been discussed before, this is my first time wading into the PHP developers lists and I couldn't find anything particularly relevant with the search. Here is a bug I submitted over the weekend ( http://bugs.php.net/bug.php?id=54387) with an attach