Skip to content

Instantly share code, notes, and snippets.

@m3g4p0p
Last active January 19, 2020 12:54
Show Gist options
  • Save m3g4p0p/77f1496a90de9abccf4cc320ad5192d8 to your computer and use it in GitHub Desktop.
Save m3g4p0p/77f1496a90de9abccf4cc320ad5192d8 to your computer and use it in GitHub Desktop.
Best Of PHP Deprecations

Best Of PHP Deprecations

4 real

  • mbstring.func_overload

    This implies that code using mbstring.func_overload is incompatible with practically all other code, which is written under the assumption that basic string operations work normally.

  • each()

    The each() function is inferior to foreach in pretty much every imaginable way, including being more than 10 times slower.

  • assert() with string argument

    Using assert($value) to check if a value is truthy opens an RCE vulnerability if there is any chance for $value to be a string.

    ¯\_(ツ)_/¯

  • $errcontext argument of error handler

    Due to technical issues, this does not throw a deprecation warning. It is a documentation-only deprecation.

  • Reflection export() methods

    As such, the export() method is wholly unnecessary, confusing, and violates PHP's own inheritance rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment