Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 725217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:18:43+00:00 2026-05-14T06:18:43+00:00

Take the following JSON string (generated by some ExtJS code – but that’s irrelevant):

  • 0

Take the following JSON string (generated by some ExtJS code – but that’s irrelevant):

[{"action":"Setting","method":"toggle","data":["welcome-home"],"type":"rpc","tid":2},{"action":"ContentExtFeFillout","method":"todo","data":[true,0,8,false],"type":"rpc","tid":3}]

being sent to a server as a POST request and retrieved via $GLOBALS['HTTP_RAW_POST_DATA'].

Running

json_decode($GLOBALS['HTTP_RAW_POST_DATA']);

on our development machine (5.2.10-2ubuntu6.4 with Suhosin Patch 0.9.7) gives a correct print_r() output of:

Array
(
    [0] => stdClass Object
        (
            [action] => Setting
            [method] => toggle
            [data] => Array
                (
                    [0] => welcome-home
                )

            [type] => rpc
            [tid] => 2
        )

    [1] => stdClass Object
        (
            [action] => ContentExtFeFillout
            [method] => todo
            [data] => Array
                (
                    [0] => 1
                    [1] => 0
                    [2] => 8
                    [3] =>
                )

            [type] => rpc
            [tid] => 3
        )
)

Running the same code on a client’s production machine (5.2.5 with Suhosin Patch 0.9.6.2 and Zend Optimizer; SUSE Linux by the way) gives the following print_r() output:

Array
(
    [0] => stdClass Object
        (
            [action] => Setting
            [method] => toggle
            [data] => Array
                (
                    [0] => welcome-home
                )

            [type] => rpc
        )

    [1] => 2
    [2] => stdClass Object
        (
            [action] => ContentExtFeFillout
            [method] => todo
            [data] => Array
                (
                    [0] => 1
                    [1] => 0
                    [2] => 8
                    [3] => 
                )

            [type] => rpc
        )

    [3] => 3
)

Note the missing tid property which obviously has been moved into the main array as an own value – this naturally breaks all the following code.

We also downloaded a Windows PHP version 5.2.5 to check if there’s a bug in json_decode() but we get the correct output here.

Are there any known issues with json_decode() at all that could cause this odd behavior?

We’re currently totally clueless…

Thanks to all of you!

Best regards

Stefan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:18:44+00:00Added an answer on May 14, 2026 at 6:18 am

    OK guys – problem solved. Lacking any more options we persuaded the client to update the installed PHP version and guess what: it works.

    There seems to have been a subtle bug in their PHP installation (PHP, Zend Optimizer and/or Suhosin) which has been fixed with the update. Still, a quite weird thing.

    Thanks to all of you!

    Best regards

    Stefan

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that works well but I need a little more
Take the following method (written in Ruby but this question could be applied to
Take the following example, I have a class public class SomeItem { public string
Take the following code snippet: SPAttachmentCollection attachments = item.Attachments ; What exactly is SPAttachmentCollection
Take the following property: public string Foo { get; private set; } Using reflection,
Take the following code: <abbr title=World Health Organization>WHO</abbr> Can we style an abbr tag's
I have the following Action Method that I'm trying to redirect from if the
I have the following js + jQuery code with some misbehaving var scopes...or at
I'm trying to parse the following JSON string returned by httpResponse : { message
The following JSON is not passing validation. The validator complains at the first string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.