Net::Gearman and PHP 5.2.9
Tue, Apr 21, 2009 12:48 PM
Perhaps if it was an actual attempt at JSON which means it did know the difference between a bare string and bad JSON and that they just broke this for fun.
<?php
$arg = "test";
echo "before:\n";
var_dump($arg);
$json_val = json_decode($arg);
echo "after:\n";
var_dump($json_val);
?>
before:
string(4) "test"
after:
string(4) "test"
Haha... I love this bug report. I remember reading (and commenting on) it. If you read it from top to bottom -- bug, no bug, bug, patch applied. I think everyone had a different understanding of what it was supposed to do. A "real" JSON validator in ext/json would still be nice to have.
Sean Coates Says:
If I'm not mistaken, the bare string was not returned; the string was truncated at the invalid codepoint.
This caused some pretty serious headaches for me with spam comments on my blog.
S