Re: [PHP-DEV] json_encode()

2008-12-16 Thread Ilia Alshanetsky
The proposed solution (basic types flag) is probably the lesser evil, but I still feel were are taking things to far and current operation is correct. On 16-Dec-08, at 6:57 AM, Scott MacVicar wrote: Richard Quadling wrote: 2008/12/15 mike : On Mon, Dec 15, 2008 at 9:50 AM, Rasmus Lerdorf

[PHP-DEV] Re: json_encode()

2008-12-16 Thread Karsten Dambekalns
Hi. On 15.12.2008 18:50 Uhr, Rasmus Lerdorf wrote: Ok, so as promised I ran some of the options we have that came up last week by Douglas Crockford. 1. Document the fact that if you want to strictly conform to the JSON spec and be sure your json_encode output will work in various JSON p

Re: [PHP-DEV] json_encode()

2008-12-16 Thread Stan Vassilev | FM
1. Document the fact that if you want to strictly conform to the JSON spec and be sure your json_encode output will work in various JSON parsers, you have to pass it a PHP array or object. +1 Regards, Stan Vassilev -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe,

Re: [PHP-DEV] json_encode()

2008-12-16 Thread Pierre Joye
On Mon, Dec 15, 2008 at 6:50 PM, Rasmus Lerdorf wrote: > Ok, so as promised I ran some of the options we have that came up last > week by Douglas Crockford. > > 1. Document the fact that if you want to strictly conform to the JSON > spec and be sure your json_encode output will work in various J

Re: [PHP-DEV] json_encode()

2008-12-16 Thread Robin Burchell
Settings which change behaviour like that aren't really all that fun for third party/portable applications developers, e.g. forum software and the likes. magic_quotes_gpc and others are good examples of this. Going back to Rasmus' mail based on his discussion with Douglas, I think that option #1 (

Re: [PHP-DEV] json_encode()

2008-12-16 Thread troels knak-nielsen
On Tue, Dec 16, 2008 at 3:06 PM, Richard Quadling wrote: > Would it be at all possible to have an ini setting json.strict_encode = On > > So, my code doesn't change, but I can activate it globally. > Essentially I don't want to shoot myself. I don't want to take the > safety off. I think we have

Re: [PHP-DEV] json_encode()

2008-12-16 Thread Richard Quadling
2008/12/16 Scott MacVicar : > Richard Quadling wrote: >> 2008/12/15 mike : >>> On Mon, Dec 15, 2008 at 9:50 AM, Rasmus Lerdorf wrote: >>> 1. Document the fact that if you want to strictly conform to the JSON spec and be sure your json_encode output will work in various JSON pars

Re: [PHP-DEV] json_encode()

2008-12-16 Thread Ionut Gabriel Stan
On 12/16/2008 14:23, Alexey Zakhlestin wrote: On Tue, Dec 16, 2008 at 3:20 PM, troels knak-nielsen wrote: On Tue, Dec 16, 2008 at 12:57 PM, Scott MacVicar wrote: For now I'll be leaving it as is and adding a JSON_STRICT_ENCODE parameter to the options flag. So you can use json_encode($var,

Re: [PHP-DEV] json_encode()

2008-12-16 Thread Alexey Zakhlestin
On Tue, Dec 16, 2008 at 3:20 PM, troels knak-nielsen wrote: > On Tue, Dec 16, 2008 at 12:57 PM, Scott MacVicar wrote: >> For now I'll be leaving it as is and adding a JSON_STRICT_ENCODE >> parameter to the options flag. So you can use >> >> json_encode($var, JSON_STRICT_ENCODE); >> > > I'm really

Re: [PHP-DEV] json_encode()

2008-12-16 Thread Scott MacVicar
troels knak-nielsen wrote: > On Tue, Dec 16, 2008 at 12:57 PM, Scott MacVicar wrote: >> For now I'll be leaving it as is and adding a JSON_STRICT_ENCODE >> parameter to the options flag. So you can use >> >> json_encode($var, JSON_STRICT_ENCODE); >> > > I'm really not a fan of named constants to

Re: [PHP-DEV] json_encode()

2008-12-16 Thread troels knak-nielsen
On Tue, Dec 16, 2008 at 12:57 PM, Scott MacVicar wrote: > For now I'll be leaving it as is and adding a JSON_STRICT_ENCODE > parameter to the options flag. So you can use > > json_encode($var, JSON_STRICT_ENCODE); > I'm really not a fan of named constants to change the semantics of a function lik

Re: [PHP-DEV] json_encode()

2008-12-16 Thread Scott MacVicar
Richard Quadling wrote: > 2008/12/15 mike : >> On Mon, Dec 15, 2008 at 9:50 AM, Rasmus Lerdorf wrote: >> >>> 1. Document the fact that if you want to strictly conform to the JSON >>> spec and be sure your json_encode output will work in various JSON >>> parsers, you have to pass it a PHP array

Re: [PHP-DEV] json_encode()

2008-12-16 Thread Richard Quadling
2008/12/15 mike : > On Mon, Dec 15, 2008 at 9:50 AM, Rasmus Lerdorf wrote: > >> 1. Document the fact that if you want to strictly conform to the JSON >> spec and be sure your json_encode output will work in various JSON >> parsers, you have to pass it a PHP array or object. > > Instead of json

Re: [PHP-DEV] Re: Any news/ideas on http://bugs.php.net/bug.php?id=46326

2008-12-16 Thread Richard Quadling
2008/12/16 Pierre Joye : > On Tue, Dec 16, 2008 at 11:20 AM, Richard Quadling > wrote: > >> Jessie. Hopefully my bug and test code will show the problem. I'm >> using 5.2.8 with no problem. This is very much a 5.3.x problem. One >> which is stopping me from doing any sort of testing of my code on

Re: [PHP-DEV] Re: Any news/ideas on http://bugs.php.net/bug.php?id=46326

2008-12-16 Thread Pierre Joye
On Tue, Dec 16, 2008 at 11:20 AM, Richard Quadling wrote: > Jessie. Hopefully my bug and test code will show the problem. I'm > using 5.2.8 with no problem. This is very much a 5.3.x problem. One > which is stopping me from doing any sort of testing of my code on > 5.3.x. Putting it simply, 5.3.a

[PHP-DEV] Re: Any news/ideas on http://bugs.php.net/bug.php?id=46326

2008-12-16 Thread Richard Quadling
2008/12/13 Jessie Hernandez : > Richard Quadling wrote: >> >> Hi. >> >> I'm looking to test 5.3, but I stumble at the first hurdle as the ini >> file is not being read. >> >> Windows XP Pro SP3 and Windows Server 2005/2008. >> >> 2008-12-12 15:45:36 D:\Personal >> Files\Downloads\Software\Programmi