Skip to content

Instantly share code, notes, and snippets.

@flavioheleno
Created July 18, 2025 16:45
Show Gist options
  • Save flavioheleno/5385866227c70fb066cbd310f251533b to your computer and use it in GitHub Desktop.
Save flavioheleno/5385866227c70fb066cbd310f251533b to your computer and use it in GitHub Desktop.
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