Bug #64326 [Opn->Fbk]: Parse error on casting a bracket array to an object
| From: | reeze@php.net | Date: | Thu, 28 Feb 2013 17:00:36 +0000 |
| Subject: | Bug #64326 [Opn->Fbk]: Parse error on casting a bracket array to an object | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-177467@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64326&edit=1
ID: 64326
Updated by: reeze@php.net
Reported by: f at worldhomes dot com
Summary: Parse error on casting a bracket array to an object
-Status: Open
+Status: Feedback
Type: Bug
Package: *General Issues
Operating System: Mac
PHP Version: 5.4.12
Block user comment: N
Private report: N
New Comment:
There is no such error, see: http://3v4l.org/Qjk0T
PHP >= 5.4 works fine.
Are you sure you are running 5.4.12?
Previous Comments:
------------------------------------------------------------------------
[2013-02-28 16:11:03] f at worldhomes dot com
Description:
------------
This code does not work on Mac OSX Lion :
json_encode ( (object) [ 'status' => (int) $newstatus ] )
After further debugging, problem: "(object)[]" : you can not cast a bracket array
to object
Parse error: unexpected '['
Test script:
---------------
json_encode ( (object) [ 'status' => 4 ] )
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64326&edit=1