PHP Class PhpBench\Json\JsonDecoder

Accepts non-strict "JSON": - {this: ["is": {where: "sparta"}]} # quoteless keys are allowed - this: ["is": {where: "sparta"}] # enclosing braces can be omitted Lints the JSON using the JsonParser.
Afficher le fichier Open project: dantleech/phpbench Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( )
decode ( string $jsonString ) : array Normalize, parse and decode the given JSON(ish) encoded string into an array.

Private Methods

Méthode Description
normalize ( $jsonString ) Allow "non-strict" JSON - i.e. if no quotes are provided then try and add them.

Method Details

__construct() public méthode

public __construct ( )

decode() public méthode

Normalize, parse and decode the given JSON(ish) encoded string into an array.
public decode ( string $jsonString ) : array
$jsonString string
Résultat array