Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Measure Anything in Laravel with StatsD
Sep 26, 2017 @ 10:53:28

On the Laravel News site there's a new tutorial posted showing you how to integrate your Laravel application with StatsD for statistics gathering. StatsD is a project from Etsy that runs as a Node.js platform and listens for incoming connections providing statistics to record to the system.

I want to show you some tools and techniques you can use to measure anything and everything that you want in your Laravel applications with StatsD. These ideas are simple and not new; yet, I believe that the simplicity and power are what makes StatsD great.

You can also take the ideas in this article and apply them to any programming language or stack. Instrumenting your code can have a huge payoff as your application scales and can help you gain deep insights.

The post starts off by talking about how integrating new features like this should be as painless as possible and some about what StatsD provides. It then talks about "instrumentation" of your code and how metrics can provide insight into what your code is doing and how well it does it. It shows you how to set up the Graphite/StatsD Docker container and how to install the league/statsd package to help make the connection to the server. The post wraps up with some examples of statistics you might want to measure and the code to increment/decrement values in both normal code and middleware (including controller execution time).

tagged: tutorial laravel graphite statsd statistics gather increment decrement

Link: https://laravel-news.com/measure-anything-laravel-statsd

A Tale of Two Industries: How Programming Languages Differ Between Wealthy and Develo
Sep 01, 2017 @ 12:44:03

On the StackOverflow blog there's an interesting post that looks at the differences in programming languages between countries based on their current state, either a developing country or a wealthy one (or somewhere in between).

Here at Stack Overflow, we’re interested in using our data to share insights about the worldwide software development community. [...] This leads us to wonder how else programming technologies may differ between rich and poor countries, and how that affects our picture of the global software development industry. In this post, we’ll explore these differences, and show that’s it’s useful to segment the software development industry into high-income countries and the rest of the world.

All the analyses explored here were performed on 2017 so far (January-August), on the 250 tags that had the most traffic during that time.

They investigated some of the major programming languages and platforms (including PHP) and found some interesting negative and positive correlation results. The post then covers how they split the list of countries in two (wealthy vs developing) and show results of the technologies they use. They include graphs for each of the points they make and link over to their StackOverflow Insights site where you can gather statistics for evaluation of your own.

tagged: stackoverflow programming language country difference statistics

Link: https://stackoverflow.blog/2017/08/29/tale-two-industries-programming-languages-differ-wealthy-developing-countries/

Jordi Boggiano:
PHP Versions Stats - 2017.1 Edition
May 09, 2017 @ 09:16:21

Jordi Boggiano, author and lead developer on the Composer project has posted his latest updates sharing the PHP version statistics for the first part of 2017.

It's stats o'clock! See 2014, 2015, 2016.1 and 2016.2 for previous similar posts.

A quick note on methodology, because all these stats are imperfect as they just sample some subset of the PHP user base. I look in the packagist.org logs of the last month for Composer installs done by someone. Composer sends the PHP version it is running with in its User-Agent header, so I can use that to see which PHP versions people are using Composer with.

He starts with the differences between now and the last time he ran the stats with a nice trends towards the PHP 7.x releases, especially PHP 7.1. He shares some graphs of the overall version distribution and a time-related graph showing changes in usage over time. Finally, he ends the post the same way as the others showing requirements of packages and how they've changed since the last update (what version a package requires).

tagged: version statistics results graph time php7 2017

Link: https://seld.be/notes/php-versions-stats-2017-1-edition

Jordi Boggiano:
PHP Versions Stats - 2016.2 Edition
Nov 18, 2016 @ 11:17:40

In his latest post Jordi Boggiano (of the Composer project) has released his PHP usage statistics for the second half of 2016 based on the information gathered during Composer installations.

It's stats o'clock! See 2014, 2015 and 2016.1 for previous similar posts.

A quick note on methodology, because all these stats are imperfect as they just sample some subset of the PHP user base. I look in the packagist.org logs of the last 28 days for Composer installs done by someone. Composer sends the PHP version it is running with in its User-Agent header, so I can use that to see which PHP versions people are using Composer with.

He compares them to the statistics from May 2016 showing some interesting but not unexpected changes, mostly in the growth of PHP 7+ versions. He shares a few of his own observations of the results and encourages library authors to start focusing on PHP 7 functionality rather than 5.5/5.6 compatibility. He also shares a secondary data set - the PHP versions that libraries require that, surprisingly, is moving a lot slower than the actual PHP version adoption.

tagged: version language statistics 2016 requirement composer install results

Link: https://seld.be/notes/php-versions-stats-2016-2-edition

Jordi Boggiano:
PHP Versions Stats - 2016.1 Edition
Jun 07, 2016 @ 14:51:35

Jordi Boggiano has posted some updated statistics around the use of the Packagist site around PHP version requirements and the relation of package downloads to PHP versions.

Last year I posted stats about PHP versions, and the year before as well, both time in November. However this year I can't wait for November as I am curious to explore the PHP7 uptake!

A quick note on methodology, because all these stats are imperfect as they just sample some subset of the PHP user base. I look in the packagist.org logs of the last 28 days for Composer installs done by someone. Composer sends the PHP version it is running with in its User-Agent header, so I can use that to see which PHP versions people are using Composer with.

He compares the previous statistics against the ones gathered back in November 2015, both in numbers and graphs. He shows the stats for the PHP versions being used and for the PHP versions that are required. It's interesting to see that there's been a good uptick in supported versions including PHP 7.0+.

tagged: packagist statistics version composer usage requirement

Link: https://seld.be/notes/php-versions-stats-2016-1-edition

Freek Van der Herten:
Getting package statistics from Packagist
May 23, 2016 @ 10:18:07

In a post to his site Freek Van der Herten shows you how to gather information from the Packagist website about the number of times that your packages have been downloaded.

At my work I’m currently creating a new dashboard. That’s a fancy term for an html page sprinkled with some Vue magic that will be displayed on tv screen at the wall of our office. I won’t say much about the dashboard itself on this post, but I’ll make sure to write something on that in the near future.

One of the things I want to display on our dashboard is how many times our packages get downloaded (yeah it’s a vanity project, sorry about that :-)). To make this real easy our intern Jolita and I cooked up a new package called packagist-api. It uses the packagist api to fetch data about published packages.

They include an example of the package in use, fetching the list of packages for the "spatie" vendor and getting the details by package name. The results include more information than just the download count as well (including current version, maintainers and the basic description). The post ends with an example of filtering out the downloads counts and putting them into a collection for later use.

tagged: package statistics packagist library results tutorial

Link: https://murze.be/2016/05/getting-package-statistics-packagist/

Jordi Boggiano:
Common files in PHP packages
Apr 21, 2016 @ 09:29:15

Jordi Boggiano has a new post to his site today sharing some interesting PHP package statistics he gathered as a part of the metadata in the Composer/Packagist ecosystem.

This one started in a peculiar way. Paul M. Jones announced a new version of his Producer tool, I had a look at it and saw that it recommended having a changelog called CHANGES.md by default. [...] My first thought was to report an issue asking to change the default, but then I thought it's Paul, he will not just take my word for it, he will want hard facts. So here I am two days later. I queried GitHub's API for the file listing (only the root directory) of all PHP packages listed on packagist.org. What this let me do is look at what files are commonly present (and not), which is quite interesting to get a picture of the whole ecosystem.

He queried about 79,000 packages and found some interesting patterns in the results. These included findings like:

  • 8% have a DependencyInjection/ directory, which I believe indicates Symfony bundles
  • 3.6% have a examples/ and 3.5% a docs/ directory
  • 49% have some file or directory indicating the presence of tests (phpunit.xml & co)
  • 14% have committed their composer.lock
  • 8% show a presence of some code quality/style CI (scrutinizer, codeclimate, styleci)

There's some other interesting statistics in the post around license files, changelogs and CLI binaries too. He's also posted the full data set for anyone interested in running some of their own statistics on the results.

tagged: package statistics packagist composer data results summary

Link: https://seld.be/notes/common-files-in-php-packages

Symfony Finland:
Symfony Benchmarks: Symfony Proxy vs. Varnish
Jan 05, 2016 @ 13:29:51

The Symfony Finland blog site has worked up some benchmarks comparing the Symfony Proxy versus Varnish and shared the results in this new post. The Symfony Proxy is a tool built in to the framework to help with caching responses automatically. Varnish, however, is a separate tool optimized to handle the caching of the same content but outside of the application completely.

In the previous articles we have evaluated PHP performance on different runtimes (PHP 5.6, HHVM, PHP 7) as well as how it behaves when adding server resources (CPU & RAM) using eZ Platform - a CMS built on the Symfony Framework.

In production environments Symfony and eZ Platform are likely ran behind the Varnish Reverse Proxy, which we'll evaluate next by comparing it to the built in Symfony Proxy.

They once again use the eZ platform demo application as the software under test on an 8 Core machine. The results aren't overly surprising if you're familiar with Varnish at all. Software-based caching layers are helpful but when you are able to remove the processing overhead of it from an application, you're better off.

tagged: symfony benchmark symfonyproxy varnish ezplatform statistics

Link: https://www.symfony.fi/entry/symfony-benchmarks-symfony-proxy-vs-varnish

Jordi Boggiano:
PHP Versions Stats - 2015 Edition
Nov 23, 2015 @ 13:17:54

It's come to "that time of year" again and Jordi Boggiano has posted the latest update in his series of PHP usage statistics. In this summary he looks at the PHP versions installed based on the packagist.org logs for developers using Composer.

It's that time of the year again, where I figure it's time to update my yearly data on PHP version usage. Last year's post showed 5.5 as the main winner and 5.3 declining rapidly. Let's see what 2015 brought.

[...] A quick note on methodology, because all these stats are imperfect as they just sample some subset of the PHP user base. [...] Composer sends the PHP version it is running with in its User-Agent header, so I can use that to see which PHP versions people are using Composer with. Of course this data set is probably biased towards development machines and CI servers and as such it should also be taken with a grain of salt.

He first compares the statics for his 2015 searches against the 2014 stats and shows the differences in usage for PHP versions 5.3.3 up to 5.6.0. Fortunately, the results show a rise in the usage of PHP 5.5 and a decline in all others...but it's not too much of a difference (2-3% range). Pie graphs are also included to help visualize these differences. He also includes some statistics on what PHP versions are required by certain packages for the ones listed on Packagist with increases starting with 5.4 and the largest advance for 5.5.

tagged: usage statistics version comparison yearly packagist composer required

Link: http://seld.be/notes/php-versions-stats-2015-edition

Etsy Code as Craft Blog:
Experimenting with HHVM at Etsy
Apr 08, 2015 @ 08:49:20

On the Etsy "Code as Craft" blog they've posted an article about their experiences in experimenting with HHVM at Etsy and some of the differences it makes.

In 2014 Etsy’s infrastructure group took on a big challenge: scale Etsy’s API traffic capacity 20X. We launched many efforts simultaneously to meet the challenge, including a migration to HHVM after it showed a promising increase in throughput. Getting our code to run on HHVM was relatively easy, but we encountered many surprises as we gained confidence in the new architecture.

They start with a brief overview of what HHVM is for those that aren't sure and talk about where their focus was in these experiments. They list out some of the main reasons for trying out HHVM and the role of concurrency in their current application. They started with the "minimum viable product" and compared benchmarks between PHP 5.4 and HHVM on several endpoints. They also show how they "teed" incoming requests to both servers to ensure that the responses were the same across both. They also talk about using employee-only traffic and the overall statistics for when they released the HHVM version internally. They also talk about some of the undocumented features to keep an eye out for if you're thinking of switching: "warming up" the requests to align them in JIT memory, using perf(1) for profiling and the use of the HHVM interactive debugger (hphpd).

tagged: hhvm etsy experiment performance throughput statistics hiphop vm

Link: https://codeascraft.com/2015/04/06/experimenting-with-hhvm-at-etsy/