Edit report at https://bugs.php.net/bug.php?id=54925&edit=1
ID: 54925 Updated by: srina...@php.net Reported by: michel dot henaut at everyware dot ch Summary: build php on solaris for 64 bits -Status: Assigned +Status: Feedback Type: Bug Package: *General Issues Operating System: solaris PHP Version: 5.2.17 Assigned To: srinatar Block user comment: N Private report: N New Comment: I am not able to reproduce this behavior on both sparc as well as x86 platforms ? I am using Oracle Solaris Studio 12.2 (formerly Sun Studio compiler) [sn123202@zod]'php-5.3.6'>cc -V cc: Sun C 5.10 SunOS_sparc Patch 141861-07 2010/12/09 usage: cc [ options] files. Use 'cc -flags' for details Possible, you are running into a compiler bug to me. In any case, you are using a really older version of compiler. So, you might wanna consider upgrading or installing latest compiler patches. So, if some thing fixes by using -m64 -O but reproduces with -m64 - is most likely a compiler issue. this is, -m64 doesn't do much but rather than expands the compiler flags to build on 64-bit platform. I would like to close this bug as not a valid bug Previous Comments: ------------------------------------------------------------------------ [2011-07-15 11:37:20] d...@php.net assigning this to people working at oracle. ------------------------------------------------------------------------ [2011-05-27 07:39:20] eugene at zhegan dot in Same here. PHP 5.3.6. # cc -V cc: Sun C 5.10 SunOS_i386 2009/06/03 Same workaround does help (thanks, Michael, by the way). ------------------------------------------------------------------------ [2011-05-25 14:31:09] michel dot henaut at everyware dot ch Description: ------------ Build php on solaris with Sun compiler: The default build for 64 bits, i.e. CFLAGS='-m64' produces strange results. Rebuilding all with CFLAGS='-m64 -O -xs -xstrconst -zlazyload' seems to work. To reproduce it: $obj[0]['data'][0]['Usr'] = 0.009035; echo json_encode($obj); with just CFLAGS='-m64' [{"data":[{"Usr":INF}]}] with CFLAGS='-m64 -O -xs -xstrconst -zlazyload' [{"data":[{"Usr":0.009035}]}] which is correct. may be a problem in main/snprintf.c and in main/spprintf.c regards Test script: --------------- $obj[0]['data'][0]['Usr'] = 0.009035; echo json_encode($obj); Expected result: ---------------- [{"data":[{"Usr":0.009035}]}] Actual result: -------------- [{"data":[{"Usr":INF}]}] ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=54925&edit=1