PHPAlgorithms 1.0.0 is there

PHPAlgorithms

Last year, I announced PHPAlgorithms. Since then, I worked a lot on this repository as part of my personal learning progress on Algorithms and Datastructures.

Now, I am proud to announce that we have reached our first milestone – version 1.0.0. With the support of the community, we fixed remaining issues and made this release happen. I want to say: Thank you very very much to everyone contributing to PHPAlgorithms!

PHPAlgorithms 1.0.0 has breaking changes compared to its previous 0.x- versions:

  • namespace change: from plural to singular
    • For example, the namespace doganoo\PHPAlgorithms\Datastructure\Lists\ArrayLists has been changed to doganoo\PHPAlgorithms\Datastructure\Lists\ArrayList
  • strict_types=1 for each class
    • each class (including all test classes) got a strict types declaration, which means, that there is no (auto) casting where applicable. For instance, if your a method expects an integer and you pass a number as a string, PHPAlgorithms will throw an exception
  • removed deprecated classes (such as HashMap, Comparable, etc.)
    • some classes and interfaces did not fit into naming conventions and thus, they were deprecated in earlier versions and removed in 1.0.0.
  • using spl_object_hash for object keys in HashTable
    • Previously, we used object serialization as object keys for HashTable’s. Now, there is another way to create an object hash.

Please check our migration guide for further details. In this guide, I describe the exact steps to migrate from < 1.0.0 to 1.0.0 and higher.

I want to thank all contributors who made version 1.0.0. happen. You are great, guys!

For any questions, just get in touch.

And in the meanwhile, we made it into the Jetbrains Blog.