{"id":19073310,"url":"https://github.com/canciolabs/php-stack","last_synced_at":"2026-02-26T06:56:00.163Z","repository":{"id":224644261,"uuid":"763150612","full_name":"canciolabs/php-stack","owner":"canciolabs","description":"This tiny package contains an interface and an array-based implementation of the LIFO Stack data structure.","archived":false,"fork":false,"pushed_at":"2025-01-24T22:53:49.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"1.2","last_synced_at":"2025-03-27T12:52:32.157Z","etag":null,"topics":["data-structures","php","stack"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/canciolabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-25T17:32:12.000Z","updated_at":"2024-02-27T02:33:46.000Z","dependencies_parsed_at":"2025-02-22T04:25:18.527Z","dependency_job_id":"803b7393-e754-4b42-9701-78351a8e4421","html_url":"https://github.com/canciolabs/php-stack","commit_stats":null,"previous_names":["canciolabs/php-stack"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canciolabs%2Fphp-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canciolabs%2Fphp-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canciolabs%2Fphp-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canciolabs%2Fphp-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/canciolabs","download_url":"https://codeload.github.com/canciolabs/php-stack/tar.gz/refs/heads/1.2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248791732,"owners_count":21162259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-structures","php","stack"],"created_at":"2024-11-09T01:46:16.474Z","updated_at":"2026-02-26T06:55:55.135Z","avatar_url":"https://github.com/canciolabs.png","language":"PHP","readme":"# CancioLabs / DS / PHP-Stack\n\nThis tiny package contains an interface and an array-based implementation of the LIFO Stack data structure.\n\n## Interface\n\n| Method  | Description                                      |\n|---------|--------------------------------------------------|\n| push    | Adds a new element to the top of the stack.      |\n| pop     | Removes and return the top element of the stack. |\n| top     | Returns the top element of the stack.            |\n| isEmpty | Tests whether the stack is empty.                |\n| clear   | Removes all elements from the stack.             |\n| count   | Returns the number of elements of the stack.     |\n| toArray | Transforms the stack into an array.              |\n\n## How to use it\n\n```\n$stack = new Stack(['A', 'B']);\n\n$stack-\u003epush('C');\n$stack-\u003epush('D');\n\n$stack-\u003eisEmpty(); // returns false\n$stack-\u003ecount(); // returns 4\n\n$stack-\u003etop(); // output 'D'\n$stack-\u003epop(); // returns 'D'\n\n$array = $stack-\u003etoArray(); // return ['A', 'B', 'C']\n\nforeach ($stack as $element) {\n    // i=0: $element = 'C'\n    // i=1: $element = 'B'\n    // i=2: $element = 'A'\n}\n\n$stack-\u003eisEmpty(); // returns true \n```\n\n## Tests and Coverage\n\nAll tests are passing with no warnings and code coverage is 100%.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanciolabs%2Fphp-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanciolabs%2Fphp-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanciolabs%2Fphp-stack/lists"}