Skip to content

Instantly share code, notes, and snippets.

@ThijsFeryn
Created July 14, 2016 14:32
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 ThijsFeryn/78c5711c7b7f7a928cad4ae15890ec32 to your computer and use it in GitHub Desktop.
Save ThijsFeryn/78c5711c7b7f7a928cad4ae15890ec32 to your computer and use it in GitHub Desktop.
Coerce returned integer into a string. No type error thrown despite the return type declaration.
<?php
function double(int $argument):string {
return $argument*2;
}
var_dump(double(3));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment