diff --git a/source/about.rst b/source/about.rst index 28e8afc8..bf2d0161 100644 --- a/source/about.rst +++ b/source/about.rst @@ -113,6 +113,32 @@ may go by different names. .. [#3] JavaScript does not have separate types for integer and floating-point. + --PHP + The following table maps from the names of JavaScript types to + their analogous types in PHP: + + +----------+--------------+ + |JavaScript|PHP | + +----------+--------------+ + |string |String | + +----------+--------------+ + |number |Integer/Float | + | |[#4]_ | + +----------+--------------+ + |object |Object | + +----------+--------------+ + |array |Array | + +----------+--------------+ + |boolean |Boolean | + +----------+--------------+ + |null |NULL | + +----------+--------------+ + + .. rubric:: Footnotes + + .. [#4] JavaScript does not have separate types for integer and + floating-point. + With these simple data types, all kinds of structured data can be represented. With that great flexibility comes great responsibility, however, as the same concept could be represented in myriad ways. For diff --git a/source/reference/array.rst b/source/reference/array.rst index 9cd1da70..704348db 100644 --- a/source/reference/array.rst +++ b/source/reference/array.rst @@ -17,6 +17,8 @@ array may be of a different type. arrays. --Ruby In Ruby, "array" is analogous to a ``Array`` type. + --PHP + In PHP, "array" is analogous to a ``Array`` type. .. schema_example:: { "type": "array" } diff --git a/source/reference/boolean.rst b/source/reference/boolean.rst index 15666567..625ffb1b 100644 --- a/source/reference/boolean.rst +++ b/source/reference/boolean.rst @@ -18,6 +18,8 @@ such as 1 and 0, are not accepted by the schema. --Ruby In Ruby, "boolean" is analogous to ``TrueClass`` and ``FalseClass``. Note that in Ruby there is no ``Boolean`` class. + --Python + In PHP, "boolean" is analogous to ``boolean``. .. schema_example:: { "type": "boolean" } diff --git a/source/reference/null.rst b/source/reference/null.rst index f406f680..8d1ee4bb 100644 --- a/source/reference/null.rst +++ b/source/reference/null.rst @@ -15,6 +15,8 @@ value: ``null``. In Python, ``null`` is analogous to ``None``. --Ruby In Ruby, ``null`` is analogous to ``nil``. + --PHP + In PHP, ``null`` is analogous to ``null``. .. schema_example:: { "type": "null" } diff --git a/source/reference/numeric.rst b/source/reference/numeric.rst index bc3b68cb..244b1a77 100644 --- a/source/reference/numeric.rst +++ b/source/reference/numeric.rst @@ -29,6 +29,8 @@ The ``integer`` type is used for integral numbers. In Python, "integer" is analogous to the ``int`` type. --Ruby In Ruby, "integer" is analogous to the ``Integer`` type. + --PHP + In PHP, "integer" is analogous to the ``integer`` type. .. schema_example:: diff --git a/source/reference/object.rst b/source/reference/object.rst index 225d2b74..f9618b31 100644 --- a/source/reference/object.rst +++ b/source/reference/object.rst @@ -32,6 +32,9 @@ conventionally referred to as a "property". everything, whereas in JSON it is used only to mean a mapping from string keys to values. + --PHP + In PHP, "objects" are analogous to the ``object`` type. In both + JSON and PHP, all keys in must be strings. .. schema_example:: { "type": "object" } diff --git a/source/reference/string.rst b/source/reference/string.rst index a6a068b6..9eef33b9 100644 --- a/source/reference/string.rst +++ b/source/reference/string.rst @@ -15,6 +15,8 @@ Unicode characters. 2.x, and the ``str`` type on Python 3.x. --Ruby In Ruby, "string" is analogous to the ``String`` type. + --PHP + In PHP, "string" is analogous to the ``string`` type. .. schema_example:: diff --git a/source/reference/type.rst b/source/reference/type.rst index bdfb327e..0818173b 100644 --- a/source/reference/type.rst +++ b/source/reference/type.rst @@ -95,6 +95,33 @@ may go by different names. .. [#3] JavaScript does not have separate types for integer and floating-point. + --PHP + The following table maps from the names of JavaScript types to + their analogous types in PHP: + + +----------+--------------+ + |JavaScript|PHP | + +----------+--------------+ + |string |String | + +----------+--------------+ + |number |Integer/Float | + | |[#4]_ | + +----------+--------------+ + |object |Object | + +----------+--------------+ + |array |Array | + +----------+--------------+ + |boolean |Boolean | + +----------+--------------+ + |null |NULL | + +----------+--------------+ + + .. rubric:: Footnotes + + .. [#4] JavaScript does not have separate types for integer and + floating-point. + + The ``type`` keyword may either be a string or an array: - If it's a string, it is the name of one of the basic types above.