Lua (Scribunto):
```
print( mw.dumpObject( mw.text.jsonDecode( "\"true\"" ) ), type( mw.text.jsonDecode( "\"true\"" ) ) )
"true" string
print( mw.dumpObject( mw.text.jsonDecode( "true" ) ), type( mw.text.jsonDecode( "true" ) ) )
true boolean
print( mw.dumpObject( mw.text.jsonDecode( "trueOBVIOUSLYnot" ) ), type( mw.text.jsonDecode( "trueOBVIOUSLYnot" ) ) )
true boolean FAIL
print( mw.dumpObject( mw.text.jsonDecode( "\"false\"" ) ), type( mw.text.jsonDecode( "\"false\"" ) ) )
"false" string
print( mw.dumpObject( mw.text.jsonDecode( "false" ) ), type( mw.text.jsonDecode( "false" ) ) )
false boolean
print( mw.dumpObject( mw.text.jsonDecode( "falseOBVIOUSLYnot" ) ), type( mw.text.jsonDecode( "falseOBVIOUSLYnot" ) ) )
false boolean FAIL
print( mw.dumpObject( mw.text.jsonDecode( "\"null\"" ) ), type( mw.text.jsonDecode( "\"null\"" ) ) )
"null" string
print( mw.dumpObject( mw.text.jsonDecode( "null" ) ), type( mw.text.jsonDecode( "null" ) ) )
nil nil
print( mw.dumpObject( mw.text.jsonDecode( "nullOBVIOUSLYnot" ) ), type( mw.text.jsonDecode( "nullOBVIOUSLYnot" ) ) )
nil nil FAIL
-- Even much obscure things fail:
print( mw.dumpObject( mw.text.jsonDecode( "true, {} nil; [] false" ) ), type( mw.text.jsonDecode( "true, {} nil; [] false" ) ) )
true boolean
```
PHP:
```
var_dump( json_decode( "\"true\"" ) );
string(4) "true"
var_dump( json_decode( "true" ) );
bool(true)
var_dump( json_decode( "trueOBVIOUSLYnot" ) );
NULL
var_dump( json_last_error() );
int(4) // JSON_ERROR_SYNTAX
var_dump( json_decode( "\"false\"" ) );
string(5) "false"
var_dump( json_decode( "false" ) );
bool(false)
var_dump( json_decode( "falseOBVIOUSLYnot" ) );
NULL
var_dump( json_last_error() );
int(4) // JSON_ERROR_SYNTAX
var_dump( json_decode( "\"null\"" ) );
string(4) "null"
var_dump( json_decode( "null" ) );
NULL
var_dump( json_decode( "nullOBVIOUSLYnot" ) );
NULL // NULL is returned if the json cannot be decoded or if the encoded data is deeper than the recursion limit.
var_dump( json_last_error() );
int(4) // JSON_ERROR_SYNTAX
```