Cal Evans' Blog: I called Zend_Json::encode(), so WTH are all my properties?
In dealing with a little JSON encoding and objects in a project of his recently, Cal Evansbumped against a problem when he was encoding an object and moving it back and forth between the back and front ends.
The problem is simple, JSON encode a PHP object and send it back to the front end. Sounds simple and the last 100 times I wrote this code it was simple. This time, I was too smart for my own good. Here's the scenario.
He illustrates his problem - the "dropping" of properties somewhere along the way - with a sample class that encodes the object and sends it along. He missed one key bit of information, though. His protected array of properties wasn't getting passed back out correctly and we're in the resulting JSON message. A quick hack of a getProperties() function call made this problem a thing of the past.
In a return to the public stage, John Edwards has confirmed plans to talk politics a month after admitting to an extramarital affair. But his wife won't be at his side.
AFP - Australian police have cleared an Indian doctor of involvement in failed bomb attacks in Britain last year after a bungled 14-month probe that is now the subject of a judicial inquiry.
Reuters - Personal income tumbled unexpectedly
in July and inflation-adjusted spending shrank as government
economic stimulus waned, but consumer spirits rose this month,
a hint the economy may muddle through its woes.