Last active
November 29, 2020 18:20
-
-
Save lechidung/b4da7c4e542bdd54bcefad2698f67ab0 to your computer and use it in GitHub Desktop.
PHP 8
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 7 ***/ | |
class PostsController | |
{ | |
/** | |
* @Route("/api/posts/{id}", methods={"GET"}) | |
*/ | |
public function get($id) { /* ... */ } | |
} | |
/*** PHP 8 ***/ | |
class PostsController | |
{ | |
#[Route("/api/posts/{id}", methods: ["GET"])] | |
public function get($id) { /* ... */ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment