Re: [PHP] Inconsistent json_decode() results

2010-05-05 Thread Michiel Sikma
On 5 May 2010 22:14, Michael Shadle wrote: > -snip- > > A. I gotcha now. Yeah I started using that just recently either > 5.2.11 or 5.2.13 (not sure which) > > You can typecast an object to an array that easily? I was unaware. > Yep, it's that easy. :-) // array(1) { // [0]=> // int(1)

Re: [PHP] Inconsistent json_decode() results

2010-05-05 Thread Michael Shadle
On Wed, May 5, 2010 at 1:11 PM, Michiel Sikma wrote: > You're right, but this is about how 5.2.10 ignores the second parameter and > always returns a class, which appears to be a bug. I'm not sure which other > versions have this same problem, but 5.2.11 has correct behavior, which > seems to sug

Re: [PHP] Inconsistent json_decode() results

2010-05-05 Thread Michiel Sikma
On 5 May 2010 20:02, Michael Shadle wrote: > 2010/5/5 Michiel Sikma : > > > By the way, if you're stuck on 5.2.10, you could simply cast the result > to > > array: > > > > var_dump((array)json_decode('{"_urls": ["a", "b"]}')); > > I don't see a "available starting in 5.x.x" notice, so I think it'

Re: [PHP] Inconsistent json_decode() results

2010-05-05 Thread Michael Shadle
2010/5/5 Michiel Sikma : > By the way, if you're stuck on 5.2.10, you could simply cast the result to > array: > > var_dump((array)json_decode('{"_urls": ["a", "b"]}')); I don't see a "available starting in 5.x.x" notice, so I think it's been there for a long time... http://www.php.net/json_deco

Re: [PHP] Inconsistent json_decode() results

2010-05-05 Thread Michiel Sikma
2010/5/5 François Beausoleil > Hello all! > > We're seeing inconsistent json decoding between PHP versions: > http://gist.github.com/390090 > > Calling json_decode() from 5.2.6 returns an associative array when asked, > while 5.2.10 always returns a stdClass. Is this a bug or a problem with my >

Re: [PHP] Inconsistent json_decode() results

2010-05-05 Thread Michiel Sikma
2010/5/5 Ali Asghar Toraby Parizy > 2010/5/5 François Beausoleil : > > Hello all! > > > > We're seeing inconsistent json decoding between PHP versions: > http://gist.github.com/390090 > > > > Calling json_decode() from 5.2.6 returns an associative array when asked, > while 5.2.10 always returns a

Re: [PHP] Inconsistent json_decode() results

2010-05-05 Thread Ali Asghar Toraby Parizy
Hi I have this problem too. I think that the version of php results this problem. I have searched later but could not find any solution. 2010/5/5 François Beausoleil : > Hello all! > > We're seeing inconsistent json decoding between PHP versions: > http://gist.github.com/390090 > > Calling json_