diff options
| author | jvoisin | 2018-08-21 14:22:44 +0200 |
|---|---|---|
| committer | jvoisin | 2018-08-21 14:22:44 +0200 |
| commit | 20e9bfdece3d1b7de11c5e2d71d5d5be59bb54b4 (patch) | |
| tree | aac44c96ebe10aef07eca58d938777c9bed1c682 /doc/source/features.rst | |
| parent | 01aff974e3e0af7df2250a2e7d5e8ee76b59752a (diff) | |
Document our type-juggling-prevention system
Diffstat (limited to 'doc/source/features.rst')
| -rw-r--r-- | doc/source/features.rst | 16 |
1 files changed, 16 insertions, 0 deletions
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 | |||
| 321 | Preventing sloppy comparisons | ||
| 322 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 323 | |||
| 324 | The aforementioned :ref:`strict mode <global-strict-feature>` only works with | ||
| 325 | annotated 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>` | ||
| 327 | during comparisons. Since comparison between different types in PHP is | ||
| 328 | `notoriously <https://secure.php.net/manual/en/types.comparisons.php>`__ | ||
| 329 | difficult 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 | ||
| 332 | for more details), so that values with different types will always be treated | ||
| 333 | as being different. | ||
| 334 | |||
| 319 | .. _readonly-exec-feature: | 335 | .. _readonly-exec-feature: |
| 320 | 336 | ||
| 321 | Preventing execution of writable PHP files | 337 | Preventing execution of writable PHP files |
