Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #19062

phpdoc: function return type

From Tommy <ba@ve.net>
Newsgroups comp.lang.php
Subject phpdoc: function return type
Date 2022-07-14 18:23 +0200
Organization Aioe.org NNTP Server
Message-ID <tapfta$1cl9$1@gioia.aioe.org> (permalink)

Show all headers | View raw


/**
  * @return int|exit
  */
function err($message, $exitCode) {
     $int = fwrite(STDERR, $message);

     if (null !== $exitCode) {
         exit($exitCode);
     }

     return $int;
}

In your opinion, int|exit is good as a type for @return tag?
Or it would be better int|null?
Or it would be better simply int?

Back to comp.lang.php | Previous | NextNext in thread | Find similar | Unroll thread


Thread

phpdoc: function return type Tommy <ba@ve.net> - 2022-07-14 18:23 +0200
  Re: phpdoc: function return type "J.O. Aho" <user@example.net> - 2022-07-14 19:04 +0200
    Re: phpdoc: function return type Tommy <ba@ve.net> - 2022-07-15 15:52 +0200

csiph-web