{"id":24650776,"url":"https://github.com/tangoman75/php-lab","last_synced_at":"2025-10-19T23:28:13.105Z","repository":{"id":213392400,"uuid":"730448667","full_name":"TangoMan75/php-lab","owner":"TangoMan75","description":"TangoMan PHP Lab is a PHP coding project for practicing common interview questions and coding challenges.","archived":false,"fork":false,"pushed_at":"2024-10-31T10:30:56.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-25T18:16:34.502Z","etag":null,"topics":["back-end","interview","php","practice","technical-interview","test","training","vanilla"],"latest_commit_sha":null,"homepage":"https://tangoman.io","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TangoMan75.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-12-12T00:24:08.000Z","updated_at":"2024-04-20T17:20:47.000Z","dependencies_parsed_at":"2023-12-25T23:25:26.618Z","dependency_job_id":"e4299e12-be0d-46c5-901c-4aee5750b75c","html_url":"https://github.com/TangoMan75/php-lab","commit_stats":null,"previous_names":["tangoman75/php-lab"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TangoMan75%2Fphp-lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TangoMan75%2Fphp-lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TangoMan75%2Fphp-lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TangoMan75%2Fphp-lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TangoMan75","download_url":"https://codeload.github.com/TangoMan75/php-lab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244686469,"owners_count":20493448,"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":["back-end","interview","php","practice","technical-interview","test","training","vanilla"],"created_at":"2025-01-25T18:16:41.289Z","updated_at":"2025-10-19T23:28:13.001Z","avatar_url":"https://github.com/TangoMan75.png","language":"Shell","readme":"![GH language](https://img.shields.io/github/languages/top/TangoMan75/php-lab)\n[![GH release](https://img.shields.io/github/v/release/TangoMan75/php-lab)](https://github.com/TangoMan75/php-lab/releases)\n[![GH license](https://img.shields.io/github/license/TangoMan75/php-lab)]((https://github.com/TangoMan75/php-lab/blob/main/LICENSE))\n[![GH stars](https://img.shields.io/github/stars/TangoMan75/php-lab)](https://github.com/TangoMan75/php-lab/stargazers)\n[![Node CI](https://github.com/TangoMan75/php-lab/workflows/PHP%20CI/badge.svg)](https://github.com/TangoMan75/php-lab/actions/workflows/php8.2.yml)\n![Visitors](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2FTangoMan75%2Fphp-lab\u0026labelColor=%23697689\u0026countColor=%2337d67a\u0026style=flat)\n\n🔬 TangoMan PHP Lab\n===================\n\n#back-end #interview #practice #php #technical-interview #test #training #vanilla\n\n**🔬 TangoMan PHP Lab** is a PHP coding project for practicing common interview questions and coding challenges.\n\nThere are various PHP scripts in the root directory that implement different algorithms and solutions to coding problems:\n\n1. 🔄 **Ackermann**\n\nImplements the Ackermann function, which is a classic example of a recursive function that can be used to test compilers and illustrate the concept of recursion.\n\n2. 🔍 **BinarySearch**\n\nImplements binary search to find an element in a sorted array. Binary search is an efficient algorithm for searching sorted data sets and relies on the divide-and-conquer technique.\n\n3. ➕ **Factorial**\n\nCalculates factorials recursively. Factorials are used in combinatorics and provide good examples of recursive functions.\n\n4. 🔢 **Fibonacci**\n\nGenerates Fibonacci numbers recursively. The Fibonacci sequence illustrates recursion and has applications in mathematics and nature.\n\n5. 💬 **FizzBuzz**\n\nPrints numbers 1 to 100, but prints \"Fizz\" for multiples of 3, \"Buzz\" for multiples of 5, and \"FizzBuzz\" for multiples of both. This is a common interview screening question.\n\n6. 👋 **HelloWorld**\n\nPrints \"Hello world!\" - the traditional first program for beginner programmers.\n\n7. ❄️ **MinTemperature**\n\nFinds minimum temperature value from temperature data. Demonstrates algorithms for finding minimum/maximum values.\n\n8. 🔄 **Palindrome**\n\nChecks if a string is a palindrome. Palindromes illustrate recursion and string manipulation.\n\n9. ✔️ **Perfect**\n\nChecks if a number is a perfect number, where the number equals the sum of its divisors. Interesting math and recursion example.\n\n10. 🃏 **Poker**\n\nEvaluates poker hands. Involves evaluating combinations and ranks of cards.\n\n11. 🥇 **PrimeNumbers**\n\nChecks if a number is prime, where a natural number greater than 1 has no positive divisors other than 1 and itself.\n\n12. 🔄 **Rot13**\n\nEncodes/decodes a string using the ROT13 cipher, a simple letter substitution cipher. Basic encryption example.\n\n13. 🔑 **SimpleJWT**\n\nImplements JSON Web Token (JWT) encoding and decoding.\n\n14. 💹 **Stocks**\n\nReturn an array holding the names of the top three stocks with the best average performance given two separate arrays containing stocks names and prices.\n\n15. 🔢 **Syracuse**\n\nImplements the Syracuse algorithm/sequence. Interesting recursion and number theory example.\n\n16. 🏗️ **TowerOfHanoi**\n\nImplements the Tower of Hanoi algorithm. A classic algorithm that illustrates recursion and dynamic programming.\n\n17. 🔄 **VonNeumann**\n\nGenerates Von Neumann ordinal numbers. Illustrates generating recursive sequences.\n\n✅ Unit Tests\n-------------\n\nThe `tests` directory in each folder contains `PHPUnit` test cases for testing the implementations of each algorithm.\n\n🚀 Github Actions\n-----------------\n\nThis project uses Github Actions for continuous integration and testing. The `.github/workflows` directory contains YAML workflow definitions for:\n\n- Linting: Runs `php-cs-fixer` to check code style and quality on every push and pull request.\n- Testing: Runs the PHUnit tests.\n\nThe workflows help maintain code quality and ensure the tests pass on multiple php versions.\n\n📑 Documentation\n----------------\n\nPHPUnit documentation is available here: [https://docs.phpunit.de](https://docs.phpunit.de)\n\nphp-cs-fixer documentation is available here: [https://cs.symfony.com/doc/rules/index.html](https://cs.symfony.com/doc/rules/index.html)\n\n🌟 Inspiration\n--------------\n\nThe following YouTube videos inspired **TangoMan PHP Lab** project:\n\n- [FizzBuzz: One Simple Interview Question](https://www.youtube.com/watch?v=QPZ0pIK_wsc)\n- [Solve This Coding Question To Win $200](https://www.youtube.com/watch?v=WDuZ_S_9vLg)\n- [The Most Difficult Program to Compute? - Computerphile](https://www.youtube.com/watch?v=i7sm9dzFtEI)\n\n💻 Dependencies\n---------------\n\n**TangoMan PHP Lab** requires the following dependencies:\n\n- PHP\n- Composer\n\n---\n\n### 🐘 PHP\n\nLearn how to install PHP from official documentation [here](https://www.php.net/manual/en/install.php)\n\n#### 🐧 Install PHP (Linux)\n\nOn linux machine enter following commands\n\n```bash\n$ sudo add-apt-repository --assume-yes ppa:ondrej/php\n$ sudo apt-get update\n$ sudo apt-get install --assume-yes php8.2\n```\n\n---\n\n### 📦 Composer\n\nLearn how to install Composer from official documentation [here](https://getcomposer.org/download/)\n\n#### 🐧 Install Composer (Linux)\n\nOn linux machine install composer globally with the following commands (requires php):\n\n```bash\n# download binary\n$ php -r \"copy('https://getcomposer.org/composer-stable.phar', 'composer.phar');\"\n# install composer globally\n$ sudo mv composer.phar /usr/local/bin/composer\n# fix permissions\n$ sudo chmod uga+x /usr/local/bin/composer\n$ sync\n# install symfony flex globally to speed up download of composer packages (parallelized prefetching)\n$ composer global require 'symfony/flex' --prefer-dist --no-progress --no-suggest --classmap-authoritative\n$ composer clear-cache\n```\n\n🚀 Installation\n---------------\n\n### ⚡ Step 1: Simply enter following command in your terminal\n\n```bash\nsh entrypoint.sh install\n```\n\n🔥 Usage\n--------\n\nRun `sh entrypoint.sh` to print help\n\nRun tests:\n\n```bash\nsh entrypoint.sh unit\n```\n\nLint code:\n\n```bash\nsh entrypoint.sh lint\n```\n\nFix lint errors:\n\n```bash\nsh entrypoint.sh lint --fix\n```\n\nUninstall:\n\n```bash\nsh entrypoint.sh uninstall\n```\n\n🤝 Contributing\n---------------\n\nThank you for your interest in contributing to **TangoMan PHP Lab**.\n\nPlease review the [code of conduct](./CODE_OF_CONDUCT.md) and [contribution guidelines](./CONTRIBUTING.md) before starting to work on any features.\n\nIf you want to open an issue, please check first if it was not [reported already](https://github.com/TangoMan75/php-lab/issues) before creating a new one.\n\n📜 License\n----------\n\nCopyrights (c) 2024 \u0026quot;Matthias Morin\u0026quot; \u0026lt;mat@tangoman.io\u0026gt;\n\n[![License](https://img.shields.io/badge/Licence-MIT-green.svg)](LICENSE)\nDistributed under the MIT license.\n\nIf you like **TangoMan PHP Lab** please star, follow or tweet about it:\n\n[![GitHub stars](https://img.shields.io/github/stars/TangoMan75/php-lab?style=social)](https://github.com/TangoMan75/php-lab/stargazers)\n[![GitHub followers](https://img.shields.io/github/followers/TangoMan75?style=social)](https://github.com/TangoMan75)\n[![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fgithub.com%2FTangoMan75%2Fphp-lab)](https://twitter.com/intent/tweet?text=Wow:\u0026url=https%3A%2F%2Fgithub.com%2FTangoMan75%2Fphp-lab)\n\n... And check my other cool projects.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangoman75%2Fphp-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftangoman75%2Fphp-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangoman75%2Fphp-lab/lists"}