summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/config.rst5
-rw-r--r--doc/source/features.rst16
2 files changed, 19 insertions, 2 deletions
diff --git a/doc/source/config.rst b/doc/source/config.rst
index b3495ae..14626ce 100644
--- a/doc/source/config.rst
+++ b/doc/source/config.rst
@@ -109,8 +109,9 @@ It can either be ``enabled`` or ``disabled``.
109Prevent sloppy comparison 109Prevent sloppy comparison
110^^^^^^^^^^^^^^^^^^^^^^^^^ 110^^^^^^^^^^^^^^^^^^^^^^^^^
111 111
112sloppy_comparison, disabled by default, will prevent php `type 112:ref:`Sloppy comparison prevention <sloppy-comparisons-feature>`, disabled by default, will prevent php `type
113juggling <https://secure.php.net/manual/en/language.types.type-juggling.php>`_ (``==``) , preventing any bypass of a comparison. 113juggling <https://secure.php.net/manual/en/language.types.type-juggling.php>`_ (``==``):
114two values with different types will always be different.
114 115
115It can either be ``enabled`` or ``disabled``. 116It can either be ``enabled`` or ``disabled``.
116 117
diff --git a/doc/source/features.rst b/doc/source/features.rst
index e420156..5543696 100644
--- a/doc/source/features.rst
+++ b/doc/source/features.rst
@@ -316,6 +316,22 @@ This feature is largely inspired from the
316`autostrict <https://github.com/krakjoe/autostrict>`_ module from `krakjoe <http://krakjoe.ninja>`__. 316`autostrict <https://github.com/krakjoe/autostrict>`_ module from `krakjoe <http://krakjoe.ninja>`__.
317 317
318 318
319.. _sloppy-comparisons-feature:
320
321Preventing sloppy comparisons
322^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
323
324The aforementioned :ref:`strict mode <global-strict-feature>` only works with
325annotated types and native functions, so it doesn't cover every instances of
326`type juggling <https://secure.php.net/manual/en/language.types.type-juggling.php>`
327during comparisons. Since comparison between different types in PHP is
328`notoriously <https://secure.php.net/manual/en/types.comparisons.php>`__
329difficult to get right, Snuffleupagus offers a way to **always** use the
330``identical`` operator instead of the ``equal`` one (see the `operator section
331<https://secure.php.net/manual/en/language.operators.comparison.php>` for PHP's documentation
332for more details), so that values with different types will always be treated
333as being different.
334
319.. _readonly-exec-feature: 335.. _readonly-exec-feature:
320 336
321Preventing execution of writable PHP files 337Preventing execution of writable PHP files