Skip to content

List of PHP Kata to Update

interrupt-routine edited this page Jul 7, 2025 · 66 revisions

PHP 8.0 with PHPUnit 9.5.2 was added. The kata on this page needs to be updated manually. Any help is appreciated!

Summary of Changes

  • Files are no longer concatenated, but it should work very similarly as before because solution and preloaded files are autoloaded
  • The name of the test class now required to end with Test
  • Solution and Preloaded file should have <?php
    • Runner prepends this if missing for backwards compatibility, but any new code should include it
  • Test file should have <?php use PHPUnit\Framework\TestCase;
    • Runner prepends this if <?php is missing for backwards compatibility, but any new code should include it
  • PHPUnit is updated to 9.5.2 so there are some breaking changes
    • Testing for exceptions: PHPUnit 6 removed support for testing for exceptions with PHPDoc annotations:
     /**
     * @expectedException InvalidArgumentException
     */
     public function testForException()
     {
         functionThatShouldThrow();
     }
    new code should use expectException():
    public function testForException()
    {
        $this->expectException(InvalidArgumentException::class);
        functionThatShouldThrow();
    }

List of Kata

  1. 'Magic' recursion call depth number
  2. Brainfuck Translator
  3. Buddy Pairs
  4. Burrows-Wheeler-Transformation
  5. Buying a car
  6. Car Park Escape
  7. Catalog
  8. Challenge Fun #14: Target Game
  9. Check and Mate?
  10. Ciphers #1 - The 01 Cipher
  11. Color Choice
  12. Connect 4
  13. Count up the points for the 7 Wonders board game! Easy version
  14. Creating a custom PHP stream wrapper
  15. Divide numbers as strings
  16. Domain name validator
  17. Don't rely on luck.
  18. Esolang Interpreters #1 - Introduction to Esolangs and My First Interpreter (MiniStringFuck)
  19. Esolang: InfiniTick
  20. Evaluate mathematical expression
  21. Experimenting with a sequence of complex numbers
  22. Factorial decomposition
  23. Family Gift Exchange / Names Out of a Hat
  24. Fibo akin
  25. Financing Plan on Planet XY140Z-n
  26. Fluent Calculator
  27. Functions of Integers on Cartesian Plane
  28. Generate keywords
  29. Get angle between hour and minute hands
  30. Going to the cinema
  31. Going to zero or to infinity?
  32. Good words
  33. Hofstadter Q
  34. How many dots are covered
  35. How Much?
  36. Human readable duration format
  37. Hungry Hippos
  38. Implement the (Unnormalized) Cardinal Sine
  39. IPv4 Network and Broadcast Addresses
  40. Is my friend cheating?
  41. Is there an arrow missing ? (Relations - Part1: Reflexivity)
  42. John and Ann sign up for Codewars
  43. Largest Palindromic Product
  44. League Player Rank
  45. Linked Lists - Get Nth Node
  46. Linked Lists - Insert Nth Node
  47. List of all Rationals
  48. MAC Address : Regexp
  49. Make sets
  50. Mirrored Exponential Chunks
  51. Mystery Class
  52. Object-Oriented PHP #1 - Classes, Public Properties and Methods
  53. Object-Oriented PHP #6 - Visibility
  54. One Line Task: Largest Rectangle
  55. Pattern Generator
  56. Pattern Generator (mirrored)
  57. Perimeter of squares in a rectangle
  58. PHP Immutable
  59. PHP in Action #5 - PHPMailer Intro
  60. Pigs in a Pen
  61. Points in the circle
  62. Pokemon Damage Calculator
  63. Positions Average
  64. Product of two squares
  65. Pull your words together, man!
  66. Rectangle into Squares
  67. Reflection in PHP #1 - Introduction
  68. Reflection in PHP #3 - Using Reflection on Classes
  69. Reflection in PHP #4 - Puzzle Challenge [Assessment]
  70. RoboScript #4 - RS3 Patterns to the Rescue
  71. Roman Numerals Decoder
  72. Screen Locking Patterns
  73. Selective memory
  74. Shortest Distance to a Character
  75. Simple assembler interpreter
  76. Simple consecutive pairs
  77. Simplifying multilinear polynomials
  78. Smallest possible sum
  79. Snakes and Ladders
  80. Square Pi's
  81. String Scramble
  82. Sum Mixed Array
  83. Text align justify
  84. Texting with an old-school mobile phone
  85. The Skiponacci Sequence
  86. The Walker
  87. URL building
  88. Wave Sorting
  89. We are Family
  90. Weight for weight

After changing assertEquals with assertSame to avoid this problem some katas failed the automatic change and require manual editing:

  1. A Rule of Divisibility by 7
  2. Area of an arrow
  3. Binary Genetic Algorithms
  4. Brainfuck Translator
  5. Buying a car
  6. Calculate mean and concatenate string
  7. Closest and Smallest
  8. Convert a String to a Number!
  9. Creating a custom PHP stream wrapper
  10. Disease Spread
  11. Driving School Series #2
  12. Easy Cyclist's Training
  13. Easy Line
  14. Euclidean distance in n dimensions
  15. Fibonacci, Tribonacci and friends
  16. Financing Plan on Planet XY140Z-n
  17. Find the Middle of the Product
  18. Find the area of the rectangle!
  19. FizzBuzz++
  20. Fun with lists: filter
  21. Fun with lists: map
  22. Functions of Integers on Cartesian Plane
  23. Heron's formula
  24. How good are you really?
  25. How many dots are covered
  26. League Player Rank
  27. Looking for a benefactor
  28. MAC Address : Regexp
  29. Molecule to atoms
  30. Mutual Recursion
  31. One Line Task: Largest Rectangle
  32. Ordered Count of Characters
  33. Parse a linked list from a string
  34. Pascal's Triangle
  35. Pattern Generator (mirrored)
  36. Program a Calculator #2 - 3D Vectors
  37. Quarter of the year
  38. Regex Tic Tac Toe Win Checker
  39. Regexp Basics - is it IPv4 address?
  40. Return the closest number multiple of 10
  41. Return the first M multiples of N
  42. Reverse polish notation calculator
  43. Screen Locking Patterns
  44. Send in the Clones
  45. Simple Fun #181: Rounding
  46. Simple Fun #74: Growing Plant
  47. Simple Fun #87: Shuffled Array
  48. Square Pi's
  49. Sum and Length
  50. Sum of Array Averages
  51. Sum of Intervals
  52. Sum of positive
  53. The Walker
  54. Tiny Three-Pass Compiler
  55. Tortoise racing
  56. Wave Sorting
  57. We are Family
  58. simple calculator
Clone this wiki locally