-
-
Save fernandodebrando/3c0425c3c4ad5cd43bf28cbc1b0ca19d to your computer and use it in GitHub Desktop.
Object typehint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Esta função será analisada estaticamente de acordo com o | |
// tipo retornado | |
function correctFunction() : object { | |
$obj = json_decode('{}'); | |
return $obj; | |
} | |
// Esta função será analisada estaticamente e contém erro | |
// que resultará em falha em tempo de execução | |
function errorFunction() : object { | |
return []; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment