diff --git a/doc/component/JSON_representation.markdown b/doc/component/JSON_representation.markdown
index a4d39335..47c3429c 100644
--- a/doc/component/JSON_representation.markdown
+++ b/doc/component/JSON_representation.markdown
@@ -116,8 +116,8 @@ The JSON representation may be converted back into an AST using the `JsonDecoder
 ```php
 <?php
 
-$nodeDecoder = new PhpParser\NodeDecoder();
-$ast = $nodeDecoder->decode($json);
+$jsonDecoder = new PhpParser\JsonDecoder();
+$ast = $jsonDecoder->decode($json);
 ```
 
 Note that not all ASTs can be represented using JSON. In particular:
@@ -128,4 +128,4 @@ Note that not all ASTs can be represented using JSON. In particular:
 
 If the node tree is not representable in JSON, the initial `json_encode()` call will fail.
 
-From the command line, a JSON dump can be obtained using `vendor/bin/php-parse -j file.php`.
\ No newline at end of file
+From the command line, a JSON dump can be obtained using `vendor/bin/php-parse -j file.php`.