fork download
  1. <?php
  2. declare(strict_types = 1);
  3. ini_set("display_errors", '1');
  4. ini_set("display_startup_erros", '1');
  5. error_reporting( E_ALL | E_STRICT | E_NOTICE );
  6. function verNumero (int $num) : int {
  7. return $num++;
  8. }
  9. echo verNumero('7');
  10. echo verNumero(7);
  11.  
  12. //https://pt.stackoverflow.com/q/384959/101
Runtime error #stdin #stdout #stderr 0s 82560KB
stdin
Standard input is empty
stdout
Fatal error: Uncaught TypeError: Argument 1 passed to verNumero() must be of the type integer, string given, called in /home/GlpSH0/prog.php on line 9 and defined in /home/GlpSH0/prog.php:6
Stack trace:
#0 /home/GlpSH0/prog.php(9): verNumero('7')
#1 {main}
  thrown in /home/GlpSH0/prog.php on line 6
stderr
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to verNumero() must be of the type integer, string given, called in /home/GlpSH0/prog.php on line 9 and defined in /home/GlpSH0/prog.php:6
Stack trace:
#0 /home/GlpSH0/prog.php(9): verNumero('7')
#1 {main}
  thrown in /home/GlpSH0/prog.php on line 6