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
+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
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
> &
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
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
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:
>
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
;)
>
> 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
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