Skip to content

Instantly share code, notes, and snippets.

@lechidung
Last active November 29, 2020 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lechidung/d3bf18e347bdc9e0424ce36985f2a9e4 to your computer and use it in GitHub Desktop.
Save lechidung/d3bf18e347bdc9e0424ce36985f2a9e4 to your computer and use it in GitHub Desktop.
PHP 8
/*** PHP 7 ***/
strlen([]); // Warning: strlen() expects parameter 1 to be string, array given
array_chunk([], -1); // Warning: array_chunk(): Size parameter expected to be greater than 0
/*** PHP 8 ***/
strlen([]); // TypeError: strlen(): Argument #1 ($str) must be of type string, array given
array_chunk([], -1); // ValueError: array_chunk(): Argument #2 ($length) must be greater than 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment