Created
July 18, 2025 16:45
-
-
Save flavioheleno/5385866227c70fb066cbd310f251533b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def get_active() -> dict: | |
"""Retrieves the list of latest active PHP versions and its releases. | |
Returns: | |
dict: status and result or error msg. | |
""" | |
response = requests.get('https://www.php.net/releases/active.php') | |
if (response.status_code != 200): | |
return { | |
"status": "error", | |
"error_message": "Failed to retrieve the list of active supported versions", | |
"response_content": response.text | |
} | |
return { | |
"status": "success", | |
"report": response.json() | |
} | |
def get_branches() -> dict: | |
"""Retrieves the list of all PHP versions, its latest releases, current state and dates for initial release, active support end and security support end. | |
Returns: | |
dict: status and result or error msg. | |
""" | |
response = requests.get('https://www.php.net/releases/branches.php') | |
if (response.status_code != 200): | |
return { | |
"status": "error", | |
"error_message": "Failed to retrieve the list of releases", | |
"response_content": response.text | |
} | |
return { | |
"status": "success", | |
"report": response.json() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment