.. _json5_objects: Helper Objects ############## .. highlight:: php The helper objects allow you control how specific values are rendered. They are also designed to be JSON-transparent so you can get an equivalent JSON file by using ``json_encode()``. This compatibility may be broken by some planned objects. ``HexInteger`` ============== Renders an integer in a hexadecimal form:: new HexInteger(0xdeadbeef), ]; echo Json5Encoder::encode($value); echo json_encode($value, JSON_PRETTY_PRINT); .. code-block:: json5 // JSON5 { hex: 0xDEADBEEF, } // JSON { "hex": 3735928559 } ``CommentDecorator`` ==================== Renders a value with comments. The ``commentBefore`` may be multiline, the ``commentAfter`` must be a single line:: new CommentDecorator(6.6743e-11, commentBefore: <<