Bug #61126 [Opn->Nab]: associative array syntax

2012-02-18 Thread nikic
Edit report at https://bugs.php.net/bug.php?id=61126&edit=1

 ID: 61126
 Updated by: ni...@php.net
 Reported by:cornelius dot howl at gmail dot com
 Summary:associative array syntax
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:*General Issues
 Operating System:   Any
 PHP Version:5.4.0RC7
 Block user comment: N
 Private report: N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You access an undefined index so you obviously get a notice, nothing will 
change about that.

If you want, you can define a function like

function getWithDefault(&$var, $default = null) {
return isset($var) ? $var : $default;
}
$abc = getWithDefault($def['abc'], 'ghi');


Previous Comments:

[2012-02-17 17:54:01] cornelius dot howl at gmail dot com

Description:

When using undefined $args['method'] this should not throw an error, instead, 
it 
should return undef or null.

In Perl or Ruby, Python, we usually write:

   $value = $hash{key} || 'default value';

But in PHP, we have to write such code, that's such inefficient:

   $value = isset($hash['key']) ? $hash['key'] : 'default';

Yes, we can use '@', but the '@' makes PHP runs more slower.

It will be better if we can have the following syntax:

   $value = $hash['key'] || 'default value';

so that if you have multiple hashes:

   $value = $hash['key'] || $hash2['key'] || $hash3['key'] || 'last value';

then we don't have to write:

   $value = isset($hash['key']) ? $hash['key'] : isset($hash2['key']) ? 
$hash2['key'] : $hash2['key']  # whatever



Thanks







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61126&edit=1


Bug #61097 [Asn]: Memory leak in xmlrpc functions copying zvals

2012-02-18 Thread nikic
Edit report at https://bugs.php.net/bug.php?id=61097&edit=1

 ID: 61097
 Updated by: ni...@php.net
 Reported by:ni...@php.net
 Summary:Memory leak in xmlrpc functions copying zvals
 Status: Assigned
 Type:   Bug
 Package:XMLRPC-EPI related
 PHP Version:5.4.0RC7
-Assigned To:laruence
+Assigned To:nikic
 Block user comment: N
 Private report: N

 New Comment:

Leaving open til after 5.4 merge.


Previous Comments:

[2012-02-18 14:58:16] ni...@php.net

Automatic comment from SVN on behalf of nikic
Revision: http://svn.php.net/viewvc/?view=revision&revision=323331
Log: Fix bug #61097 Memory leak in xmlrpc functions copying zvals

Needs to be merged to 5.4.


[2012-02-15 18:20:01] ni...@php.net

The following patch has been added/updated:

Patch Name: xmlrpc.patch
Revision:   1329330001
URL:
https://bugs.php.net/patch-display.php?bug=61097&patch=xmlrpc.patch&revision=1329330001


[2012-02-15 18:11:16] ni...@php.net

Description:

This will produce a leak in both functions:

$method = 'abc';
xmlrpc_server_register_introspection_callback(xmlrpc_server_create(), $method);
xmlrpc_server_register_method(xmlrpc_server_create(), 'abc', $method);







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61097&edit=1


Bug #61130 [Fbk->Opn]: --with-iconv pulls in /usr/include

2012-02-18 Thread fscan at chilicode dot com
Edit report at https://bugs.php.net/bug.php?id=61130&edit=1

 ID: 61130
 User updated by:fscan at chilicode dot com
 Reported by:fscan at chilicode dot com
 Summary:--with-iconv pulls in /usr/include
-Status: Feedback
+Status: Open
 Type:   Bug
 Package:Compile Failure
 Operating System:   linux
 PHP Version:5.3.10
 Block user comment: N
 Private report: N

 New Comment:

CC=arm-none-linux-gnueabi-gcc ./configure --disable-all --with-iconv=/tmp


checking for iconv support... yes
configure: error: Please reinstall the iconv library.

config.log:
configure:46880: checking for iconv support


Previous Comments:

[2012-02-18 01:23:44] ras...@php.net

How about if you set it to a path where there is no iconv installed?

eg. --with-iconv=/tmp


[2012-02-18 01:16:56] fscan at chilicode dot com

Description:

I'm cross compiling php for arm and want to use the glibc internal iconv 
implentation. when i specify --with-iconv configure pulls in the system 
/usr/include and the compilation fails.



Test script:
---
CC=arm-none-linux-gnueabi-gcc ./configure --disable-all --with-iconv
make


Expected result:

build succeeds


Actual result:
--
build fails because of incompatible asm directives from include files in 
/usr/include.
also, many warnings of including /usr/include path in cross compilation.







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61130&edit=1


[PHP-BUG] Bug #61135 [NEW]: gregoriantojd() returns incorrect date for some dates

2012-02-18 Thread t dot m dot guymer at thomasguymer dot co dot uk
From: 
Operating system: Linux
PHP version:  5.3.10
Package:  *Calendar problems
Bug Type: Bug
Bug description:gregoriantojd() returns incorrect date for some dates

Description:

I am using gregoriantojd() to return the Julian date for some months in the
year 2011. It gives the correct answer for 10 of the months, but August and
September just get returned as "0".

Test script:
---
echo "The 1st of January 2011 is " . gregoriantojd(01, 01, 2011) .
PHP_EOL;
echo "The 1st of February 2011 is " . gregoriantojd(02, 01, 2011) .
PHP_EOL;
echo "The 1st of March 2011 is " . gregoriantojd(03, 01, 2011) . PHP_EOL;
echo "The 1st of April 2011 is " . gregoriantojd(04, 01, 2011) . PHP_EOL;
echo "The 1st of May 2011 is " . gregoriantojd(05, 01, 2011) . PHP_EOL;
echo "The 1st of June 2011 is " . gregoriantojd(06, 01, 2011) . PHP_EOL;
echo "The 1st of July 2011 is " . gregoriantojd(07, 01, 2011) . PHP_EOL;
echo "The 1st of August 2011 is " . gregoriantojd(08, 01, 2011) . PHP_EOL;
echo "The 1st of September 2011 is " . gregoriantojd(09, 01, 2011) .
PHP_EOL;
echo "The 1st of October 2011 is " . gregoriantojd(10, 01, 2011) .
PHP_EOL;
echo "The 1st of November 2011 is " . gregoriantojd(11, 01, 2011) .
PHP_EOL;
echo "The 1st of December 2011 is " . gregoriantojd(12, 01, 2011) .
PHP_EOL;

Expected result:

The 1st of January 2011 is 2455563
The 1st of February 2011 is 2455594
The 1st of March 2011 is 2455622
The 1st of April 2011 is 2455653
The 1st of May 2011 is 2455683
The 1st of June 2011 is 2455714
The 1st of July 2011 is 2455744
The 1st of August 2011 is 2455775
The 1st of September 2011 is 2455805
The 1st of October 2011 is 2455836
The 1st of November 2011 is 2455867
The 1st of December 2011 is 2455897

Actual result:
--
The 1st of January 2011 is 2455563
The 1st of February 2011 is 2455594
The 1st of March 2011 is 2455622
The 1st of April 2011 is 2455653
The 1st of May 2011 is 2455683
The 1st of June 2011 is 2455714
The 1st of July 2011 is 2455744
The 1st of August 2011 is 0
The 1st of September 2011 is 0
The 1st of October 2011 is 2455836
The 1st of November 2011 is 2455867
The 1st of December 2011 is 2455897

-- 
Edit bug report at https://bugs.php.net/bug.php?id=61135&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61135&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61135&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=61135&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61135&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=61135&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61135&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=61135&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=61135&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=61135&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=61135&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=61135&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=61135&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=61135&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61135&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=61135&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=61135&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=61135&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=61135&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=61135&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=61135&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=61135&r=mysqlcfg



Bug #48908 [Com]: Cannot query smalldatetime type columns

2012-02-18 Thread blyxx86 at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=48908&edit=1

 ID: 48908
 Comment by: blyxx86 at gmail dot com
 Reported by:aaron at aarondm dot com
 Summary:Cannot query smalldatetime type columns
 Status: Open
 Type:   Bug
 Package:MSSQL related
 Operating System:   ArchLinux
 PHP Version:5.2.10
 Block user comment: N
 Private report: N

 New Comment:

Also get this in PHP Version 5.3.2-1ubuntu4.14.

Adding 
mssql.datetimeconvert = Off
to php.ini does allow it to work.


Previous Comments:

[2011-09-14 17:40:11] me at abiusx dot com

As described in http://php.net/manual/es/function.mssql-query.php comments,

Adding
mssql.datetimeconvert = Off
in php.ini fixes the issue!


[2011-06-30 04:55:10] Fr33z3m4n at gmx dot net

Same Problem and is reproducable.

Debian 2.6.26-26lenny1
PHP Version 5.3.6-12
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
   with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH


[2010-07-20 11:51:29] tom dot lawton at kondor dot co dot uk

PHP 5.2.4 / ubuntu 8.10LTS has this bug and is reproducable.

Suhosin patch reports canary mismatch if a query returns smalldatetime.

Apache does not trigger 500, nor does PHP report any error to the page - it 
dies silently.


[2010-01-07 12:36:21] undicizeri at gmail dot com

Same bug here.
I'm using Ubuntu with php 5.2.6 and debian with php 5.2.12.


[2009-12-21 11:22:41] php at mike2k dot com

Sample query/workaround:

old: SELECT acct_itm.cre_dtm AS cre_dtm
new: SELECT CONVERT(varchar(10),acct_itm.cre_dtm,120) AS cre_dtm

Not the most ideal. Might be a bug in the FreeTDS driver and not something PHP 
can handle but has to pass upstream.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=48908


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=48908&edit=1


Bug #61135 [Com]: gregoriantojd() returns incorrect date for some dates

2012-02-18 Thread carloschilazo at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=61135&edit=1

 ID: 61135
 Comment by: carloschilazo at gmail dot com
 Reported by:t dot m dot guymer at thomasguymer dot co dot uk
 Summary:gregoriantojd() returns incorrect date for some
 dates
 Status: Open
 Type:   Bug
 Package:*Calendar problems
 Operating System:   Linux
 PHP Version:5.3.10
 Block user comment: N
 Private report: N

 New Comment:

Confirmed, working on a fix right now, will upload it shortly


Previous Comments:

[2012-02-18 17:26:41] t dot m dot guymer at thomasguymer dot co dot uk

Description:

I am using gregoriantojd() to return the Julian date for some months in the 
year 2011. It gives the correct answer for 10 of the months, but August and 
September just get returned as "0".

Test script:
---
echo "The 1st of January 2011 is " . gregoriantojd(01, 01, 2011) . PHP_EOL;
echo "The 1st of February 2011 is " . gregoriantojd(02, 01, 2011) . PHP_EOL;
echo "The 1st of March 2011 is " . gregoriantojd(03, 01, 2011) . PHP_EOL;
echo "The 1st of April 2011 is " . gregoriantojd(04, 01, 2011) . PHP_EOL;
echo "The 1st of May 2011 is " . gregoriantojd(05, 01, 2011) . PHP_EOL;
echo "The 1st of June 2011 is " . gregoriantojd(06, 01, 2011) . PHP_EOL;
echo "The 1st of July 2011 is " . gregoriantojd(07, 01, 2011) . PHP_EOL;
echo "The 1st of August 2011 is " . gregoriantojd(08, 01, 2011) . PHP_EOL;
echo "The 1st of September 2011 is " . gregoriantojd(09, 01, 2011) . PHP_EOL;
echo "The 1st of October 2011 is " . gregoriantojd(10, 01, 2011) . PHP_EOL;
echo "The 1st of November 2011 is " . gregoriantojd(11, 01, 2011) . PHP_EOL;
echo "The 1st of December 2011 is " . gregoriantojd(12, 01, 2011) . PHP_EOL;

Expected result:

The 1st of January 2011 is 2455563
The 1st of February 2011 is 2455594
The 1st of March 2011 is 2455622
The 1st of April 2011 is 2455653
The 1st of May 2011 is 2455683
The 1st of June 2011 is 2455714
The 1st of July 2011 is 2455744
The 1st of August 2011 is 2455775
The 1st of September 2011 is 2455805
The 1st of October 2011 is 2455836
The 1st of November 2011 is 2455867
The 1st of December 2011 is 2455897

Actual result:
--
The 1st of January 2011 is 2455563
The 1st of February 2011 is 2455594
The 1st of March 2011 is 2455622
The 1st of April 2011 is 2455653
The 1st of May 2011 is 2455683
The 1st of June 2011 is 2455714
The 1st of July 2011 is 2455744
The 1st of August 2011 is 0
The 1st of September 2011 is 0
The 1st of October 2011 is 2455836
The 1st of November 2011 is 2455867
The 1st of December 2011 is 2455897






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61135&edit=1


Bug #61135 [Opn->Nab]: gregoriantojd() returns incorrect date for some dates

2012-02-18 Thread rasmus
Edit report at https://bugs.php.net/bug.php?id=61135&edit=1

 ID: 61135
 Updated by: ras...@php.net
 Reported by:t dot m dot guymer at thomasguymer dot co dot uk
 Summary:gregoriantojd() returns incorrect date for some
 dates
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:*Calendar problems
 Operating System:   Linux
 PHP Version:5.3.10
 Block user comment: N
 Private report: N

 New Comment:

There is no bug here. A leading zero denotes an octal value. 08 and 09 are not 
valid octals.


Previous Comments:

[2012-02-19 04:40:18] carloschilazo at gmail dot com

Confirmed, working on a fix right now, will upload it shortly


[2012-02-18 17:26:41] t dot m dot guymer at thomasguymer dot co dot uk

Description:

I am using gregoriantojd() to return the Julian date for some months in the 
year 2011. It gives the correct answer for 10 of the months, but August and 
September just get returned as "0".

Test script:
---
echo "The 1st of January 2011 is " . gregoriantojd(01, 01, 2011) . PHP_EOL;
echo "The 1st of February 2011 is " . gregoriantojd(02, 01, 2011) . PHP_EOL;
echo "The 1st of March 2011 is " . gregoriantojd(03, 01, 2011) . PHP_EOL;
echo "The 1st of April 2011 is " . gregoriantojd(04, 01, 2011) . PHP_EOL;
echo "The 1st of May 2011 is " . gregoriantojd(05, 01, 2011) . PHP_EOL;
echo "The 1st of June 2011 is " . gregoriantojd(06, 01, 2011) . PHP_EOL;
echo "The 1st of July 2011 is " . gregoriantojd(07, 01, 2011) . PHP_EOL;
echo "The 1st of August 2011 is " . gregoriantojd(08, 01, 2011) . PHP_EOL;
echo "The 1st of September 2011 is " . gregoriantojd(09, 01, 2011) . PHP_EOL;
echo "The 1st of October 2011 is " . gregoriantojd(10, 01, 2011) . PHP_EOL;
echo "The 1st of November 2011 is " . gregoriantojd(11, 01, 2011) . PHP_EOL;
echo "The 1st of December 2011 is " . gregoriantojd(12, 01, 2011) . PHP_EOL;

Expected result:

The 1st of January 2011 is 2455563
The 1st of February 2011 is 2455594
The 1st of March 2011 is 2455622
The 1st of April 2011 is 2455653
The 1st of May 2011 is 2455683
The 1st of June 2011 is 2455714
The 1st of July 2011 is 2455744
The 1st of August 2011 is 2455775
The 1st of September 2011 is 2455805
The 1st of October 2011 is 2455836
The 1st of November 2011 is 2455867
The 1st of December 2011 is 2455897

Actual result:
--
The 1st of January 2011 is 2455563
The 1st of February 2011 is 2455594
The 1st of March 2011 is 2455622
The 1st of April 2011 is 2455653
The 1st of May 2011 is 2455683
The 1st of June 2011 is 2455714
The 1st of July 2011 is 2455744
The 1st of August 2011 is 0
The 1st of September 2011 is 0
The 1st of October 2011 is 2455836
The 1st of November 2011 is 2455867
The 1st of December 2011 is 2455897






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61135&edit=1


[PHP-BUG] Bug #61137 [NEW]: missing mysql_stmt_get_result()

2012-02-18 Thread yohg...@php.net
From: yohgaki
Operating system: Linux
PHP version:  5.3.10
Package:  MySQLi related
Bug Type: Bug
Bug description:missing mysql_stmt_get_result()

Description:

Not researched why this happens, but somehow a function is missing in PHP
5.3.10, 
but not 5.4.

The manual says mysqli_stmt_get_result() is available from PHP 5.3.0, but
it is 
missing.

http://jp2.php.net/manual/en/mysqli-stmt.get-result.php

msyqli_stmt::get_result() also seems missing.



Test script:
---
[yohgaki@dev php-5.3.10]$ ./configure --with-mysqli && make -j 9
[yohgaki@dev php-5.3.10]$ ./sapi/cli/php -r
"print_r(get_defined_functions());" | grep mysqli_stmt_get
[239] => mysqli_stmt_get_warnings


Expected result:

This is PHP 5.4 svn result.

[yohgaki@dev php-src-5.4]$ ./sapi/cli/php -r
"print_r(get_defined_functions());" 
| grep mysqli_stmt_get
[246] => mysqli_stmt_get_result
[247] => mysqli_stmt_get_warnings


Actual result:
--
[yohgaki@dev php-5.3.10]$ ./sapi/cli/php -r
"print_r(get_defined_functions());" | 
grep mysqli_stmt_get
[239] => mysqli_stmt_get_warnings

-- 
Edit bug report at https://bugs.php.net/bug.php?id=61137&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61137&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61137&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=61137&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61137&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=61137&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61137&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=61137&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=61137&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=61137&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=61137&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=61137&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=61137&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=61137&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61137&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=61137&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=61137&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=61137&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=61137&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=61137&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=61137&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=61137&r=mysqlcfg



Bug #61137 [Opn->Nab]: missing mysql_stmt_get_result()

2012-02-18 Thread rasmus
Edit report at https://bugs.php.net/bug.php?id=61137&edit=1

 ID: 61137
 Updated by: ras...@php.net
 Reported by:yohg...@php.net
 Summary:missing mysql_stmt_get_result()
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:MySQLi related
 Operating System:   Linux
 PHP Version:5.3.10
 Block user comment: N
 Private report: N

 New Comment:

The manual also says these functions are only available if you are using the 
mysqlnd client library. Nyiur case you didn't use mysqlnd for your 5.3 build 
and 
in 5.4 we default to mysqlnd unless you specify otherwise. That's why you are 
seeing the difference.


Previous Comments:

[2012-02-19 04:48:05] yohg...@php.net

Description:

Not researched why this happens, but somehow a function is missing in PHP 
5.3.10, 
but not 5.4.

The manual says mysqli_stmt_get_result() is available from PHP 5.3.0, but it is 
missing.

http://jp2.php.net/manual/en/mysqli-stmt.get-result.php

msyqli_stmt::get_result() also seems missing.



Test script:
---
[yohgaki@dev php-5.3.10]$ ./configure --with-mysqli && make -j 9
[yohgaki@dev php-5.3.10]$ ./sapi/cli/php -r "print_r(get_defined_functions());" 
| grep mysqli_stmt_get
[239] => mysqli_stmt_get_warnings


Expected result:

This is PHP 5.4 svn result.

[yohgaki@dev php-src-5.4]$ ./sapi/cli/php -r 
"print_r(get_defined_functions());" 
| grep mysqli_stmt_get
[246] => mysqli_stmt_get_result
[247] => mysqli_stmt_get_warnings


Actual result:
--
[yohgaki@dev php-5.3.10]$ ./sapi/cli/php -r "print_r(get_defined_functions());" 
| 
grep mysqli_stmt_get
[239] => mysqli_stmt_get_warnings






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61137&edit=1


[PHP-BUG] Bug #61138 [NEW]: convert object

2012-02-18 Thread uginroot at gmail dot com
From: 
Operating system: Windows 7
PHP version:  5.3.10
Package:  Class/Object related
Bug Type: Bug
Bug description:convert object

Description:

$product = json_decode('{"name":"Anton","1":"is not null"}');
print_r($product);
var_dump($product->name);
var_dump($product->{'1'});
$product = (array)$product;
print_r($product);
var_dump($product['name']);
var_dump($product['1']);

Test script:
---
name);
var_dump($product->{'1'});
$product = (array)$product;
print_r($product);
var_dump($product['name']);
var_dump($product['1']);

Expected result:

stdClass Object
(
[name] => Anton
[1] => is not null
)
string(5) "Anton"
string(11) "is not null"
Array
(
[name] => Anton
[1] => is not null
)
string(5) "Anton"
string(11) "is not null"

Actual result:
--
stdClass Object
(
[name] => Anton
[1] => is not null
)
string(5) "Anton"
string(11) "is not null"
Array
(
[name] => Anton
[1] => is not null
)
string(5) "Anton"
NULL

-- 
Edit bug report at https://bugs.php.net/bug.php?id=61138&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61138&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61138&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=61138&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61138&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=61138&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61138&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=61138&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=61138&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=61138&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=61138&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=61138&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=61138&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=61138&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61138&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=61138&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=61138&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=61138&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=61138&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=61138&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=61138&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=61138&r=mysqlcfg



Bug #61138 [Opn->Nab]: convert object

2012-02-18 Thread aharvey
Edit report at https://bugs.php.net/bug.php?id=61138&edit=1

 ID: 61138
 Updated by: ahar...@php.net
 Reported by:uginroot at gmail dot com
 Summary:convert object
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:Class/Object related
 Operating System:   Windows 7
 PHP Version:5.3.10
 Block user comment: N
 Private report: N

 New Comment:

As documented at http://au2.php.net/manual/en/language.types.array.php, integer 
properties in objects that are cast to an array are inaccessible.


Previous Comments:

[2012-02-19 05:57:34] uginroot at gmail dot com

Description:

$product = json_decode('{"name":"Anton","1":"is not null"}');
print_r($product);
var_dump($product->name);
var_dump($product->{'1'});
$product = (array)$product;
print_r($product);
var_dump($product['name']);
var_dump($product['1']);

Test script:
---
name);
var_dump($product->{'1'});
$product = (array)$product;
print_r($product);
var_dump($product['name']);
var_dump($product['1']);

Expected result:

stdClass Object
(
[name] => Anton
[1] => is not null
)
string(5) "Anton"
string(11) "is not null"
Array
(
[name] => Anton
[1] => is not null
)
string(5) "Anton"
string(11) "is not null"

Actual result:
--
stdClass Object
(
[name] => Anton
[1] => is not null
)
string(5) "Anton"
string(11) "is not null"
Array
(
[name] => Anton
[1] => is not null
)
string(5) "Anton"
NULL






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61138&edit=1