I've heard around the web that PHPDoc is now basically redundant thanks to the new features in PHP 7+ (return types etc.).
Should we still use it or is it truly pointless?
Opinions please :)
P.S: First post on dev.to!
I've heard around the web that PHPDoc is now basically redundant thanks to the new features in PHP 7+ (return types etc.).
Should we still use it or is it truly pointless?
Opinions please :)
P.S: First post on dev.to!
For further actions, you may consider blocking this person and/or reporting abuse
dev.to staff -
UgbabeOG -
Peter Kim Frank -
jmau111⭐⭐⭐ -
Once suspended, jamesking56 will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, jamesking56 will be able to comment and publish posts again.
Once unpublished, all posts by jamesking56 will become hidden and only accessible to themselves.
If jamesking56 is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to James King.
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community safe. Here is what you can do to flag jamesking56:
Unflagging jamesking56 will restore default visibility to their posts.
Top comments (5)
I mean, Java has had return types and all that good stuff for much longer than PHP--obviously--and Javadoc is still a thing, so....
I'd say there's still a place. Type info only goes so far and PHPDoc is more than just type information!
I work with Drupal on occasion and deal with PHPDoc-driven documentation like api.drupal.org/api/drupal/core%21l...
I would not want to try to deal with the number of distinct classes it would take to express that same level of information. I'm not sure it's realistically possible.
I would gladly welcome a PHPDoc flavour (or IDE configuration option) where you don't have to provide parameters or return value types. Unfortunately sometimes you have to provide it when you want to document type of array values.
Still useful for declaring thrown exceptions.
No PHPDoc is still relevant. Documentation is key to the best code ever written. PHPDocs provide you with another level of documentation that is useful in source code.