Benchmark: strtotime() vs DateTime vs getTimestamp in PHP
Recently I wrote about how one can implement date comparison in PHP. In the article I presented two approaches. Firstly, using the strtotime() method and another with the DateTime class.
Then, in the comments on the german division of this blog, it was pointed out that the strtotime() variant is probably faster. Because I wasn’t sure about this, I decided to make a small performance test and share the results with you in this article.
How did I test the performance?
Since the question aims on strtotime() vs. DateTime, the DateTime class is contrary to the strtotime() function. So because DateTime class offers more functionality, I had first to create the DateTime object and then get the timestamp of it, because the strtotime function gives a timestamp as return value and I wanted to compare the time needed to generate the identical output.
As input I have taken a date without a custom time […]
A few days ago I already described how to set up the Eclipse development environment for usage with Perl scripts. If you don’t want to use a sledgehammer to crack a nut, you can also use the Notepad++ editor to relatively comfortably write Perl scripts.

New week, new episode of “Best of Web”. This time I have prepared myself in time, so I could publish the article for this week even before the late evening. One learns to do so.
Nowadays you will hardly find a website without it. What is it what I’m taling about? Did you already guess it? I mean Like buttons, Share buttons, Like counter, avatars, etc. – if you look at today’s network landscape, it’s hard to imagine that there was a time before all that fancy stuff.