Article of the week

Sorting objects by their property in PHP

Sorting objects by their property in PHP

10 Dec 2016 13:10:14


A few words on a basic technique of sorting objects by their common property in PHP programming language.


Read full article »

Recent articles

Walking pyramid graph paths in PHP

12 Feb 2020 19:53:09

Walking pyramid graph paths in PHP

This article is a follow-up to my text about turning a pyramid like structure into a graph (which looks a lot like a tree, but isn't one), finding all the paths in the graph and collecting all the values held by vertices in each path of it. In the first article I stopped at ...

Read more »

Converting pyramid to graph in PHP

11 Feb 2020 20:28:38

Converting pyramid to graph in PHP

Suppose you have a structure like one shown below, lets call it pyramid, and are asked to find all the paths from top to bottom in it, and perhaps also to do something with values of nodes in each path, add them or find their product etc. . How do you achieve these things? In ...

Read more »

A troubled relationship between PHP and large integers

09 Feb 2020 23:23:46

A troubled relationship between PHP and large integers

Suppose, that you need to compute 25! in PHP. It is a fairly large number. PHP will tell you that it is 1.551121004E+25, nice and short. No surprises here. Let's look under the hood, though. Sometimes you need, for example to do something with each digit of the number. So, ...

Read more »

Longest Collatz sequence in PHP

08 Feb 2020 23:30:22

Longest Collatz sequence in PHP

This article is a result of a fairly well known computer programming problem I came across online some time ago. Essence of the problem was about finding the longest Collatz sequence, that is the largest number of terms for a number less than N, with N being 1 000 000. For ...

Read more »