php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64326 Parse error on casting a bracket array to an object
Submitted: 2013-02-28 16:11 UTC Modified: 2013-10-15 11:54 UTC
From: f at worldhomes dot com Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.4.12 OS: Mac
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-02-28 16:11 UTC] 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 ] )


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-28 17:00 UTC] reeze@php.net
There is no such error, see: http://3v4l.org/Qjk0T 
PHP >= 5.4 works fine.

Are you sure you are running 5.4.12?
 [2013-02-28 17:00 UTC] reeze@php.net
-Status: Open +Status: Feedback
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 11 00:01:31 2024 UTC