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

Larry Garfield:
Just how insular is the PHP community?
Aug 25, 2015 @ 12:20:37

In this post to his site Larry Garfield takes a look at how insular the PHP community is and, instead of just expressing personal opinions on the subject, looks at data around some of the "same old faces" comments recently pointed at the PHP community.

Periodically, there is a complaint that PHP conferences are just "the same old faces". That the PHP community is insular and is just a good ol' boys club, elitist, and so forth. It's not the first community I've been part of that has had such accusations made against it, so rather than engage in such debates I figured, let's do what any good scientist would do: Look at the data!

He starts with a look at the Joind.in conference feedback site and the data it has to offer. This is what he's basing is research on, pulling the information from the site's JSON API to work through it locally. While the detailed information is attached on another page he does share a summary of his findings. Interestingly enough, just a bit over half of the speakers at these events were first-time speakers. His results show that there's an average of 13.1% of new speakers at each event too.

tagged: insular community conference speaker joindin data results

Link: http://www.garfieldtech.com/blog/php-conference-data

SitePoint PHP Blog:
Turning a Crawled Website into a Search Engine with PHP
Jul 06, 2015 @ 10:19:43

The SitePoint PHP blog has posted the second part of their "Powerful Custom Search Engines with Diffbot" series with part two showing how to take the Diffbot results and make them searchable.

In the previous part of this tutorial, we used Diffbot to set up a crawljob which would eventually harvest SitePoint’s content into a data collection, fully searchable by Diffbot’s Search API. We also demonstrated those searching capabilities by applying some common filters and listing the results. [...] In this part, we’ll build a GUI simple enough for the average Joe to use it, in order to have a relatively pretty, functional, and lightweight but detailed SitePoint search engine. What’s more, we won’t be using a framework, but a mere total of three libraries to build the entire application.

For those interested in the end result, you can skip to the demo. Otherwise, they'll walk you through the full process:

  • Bootstrapping the environment and needed libraries
  • Creating a simple "home" page with a Diffbot client
  • Creating the frontend interface (a form allowing for various search terms)
  • Making the Javascript to catch the form submission
  • Adding CSS to style the page
  • Building out the PHP backend to perform the different search types (author and keywords)

Finally he ties it all together and create the output of the search results, providing links to each of the matching pages, posting date, author information and a brief summary. He ends the post with a look at paginating the results via a "PaginationHelper" class that will drop a navigation item at the bottom of the results and handle moving from page to page, interfacing with the Diffbot client.

tagged: search engine diffbot tutorial series part2 results crawled website

Link: http://www.sitepoint.com/turning-crawled-website-search-engine-php/

David Lundgren:
SPL FileObject & LimitIterator
Jun 24, 2015 @ 08:04:24

In the latest post to his site David Lundgren takes a look at two pieces of PHP's SPL libraries - the FileObject and LimitIterator.

Over that last couple of weeks I've come to use the SPL far more than I have in the past. The SplFileObject for reading CSV files is far more convenient than the fgetcsv() function, and associated code needed for a CSV file. Using the LimitIterator allowed me to easily bypass the first row of the CSV, as they were headers and I knew the format of those headers.

He includes an example of using these two to read from a CSV file, processing the header information and each row following. He also gives another example of the LimitIterator handing the results of a database query, reducing the array set down to only the first twelve items. You can find out more about these two handy tools in their SPL documentation, FileObject and LimitIterator, as well as the rest of the SPL if you haven't looked into it before.

tagged: spl standardphplibrary fileobject limititerator csv database results

Link: http://davidscode.com/blog/2015/06/22/spl-fileobject-limititerator/

HHVM Blog:
Lockdown Results and HHVM Performance
Jun 10, 2015 @ 09:02:59

The HHVM blog has a new post today sharing the results of their first open source lockdown. During this time they worked to improve not only HHVM itself but how well it supports other open source projects using it as a platform.

The HHVM team has concluded its first ever open source performance lockdown, and we’re very excited to share the results with you. During our two week lockdown, we’ve made strides optimizing builtin functions, dynamic properties, string concatenation, and the file cache. In addition to improving HHVM, we also looked for places in the open source frameworks where we could contribute patches that would benefit all engines. Our efforts centered around maximizing requests per second (RPS) with WordPress, Drupal 7, and MediaWiki, using our oss-performance benchmarking tool.

They share some of the benchmark improvements made by the updates during the session including performance boosts for WordPress & MediaWiki. They also talk about the community involvement during the event and updates made to their own tooling too. The post then spends some time talking about their methodology on development and testing during the lockdown and how the results compare pre- and post-lockdown. The remainder of the post looks at some more specific issues and covers a few technical notes about software used and how the results were reported.

tagged: hhvm lockdown opensource benchmark improvement wordpress drupal mediawiki results

Link: http://hhvm.com/blog/9293/lockdown-results-and-hhvm-performance

SitePoint PHP Blog:
Best PHP Framework for 2015 – SitePoint Survey Results
Mar 30, 2015 @ 11:59:00

In a new post to the SitePoint PHP blog editor Bruno Skvorc shares the results of the PHP framework survey the site posted a month back. In it they asked developers for their opinions on favorite frameworks (not necessarily the one they use, but their own personal opinion). For anyone that's been keeping up with the current state of PHP frameworks, the results aren't all that surprising though.

One month ago, we started the annual SitePoint framework popularity survey. Now that the month has expired, it’s time to look at the results and to distribute the prizes. The response was a whopping ~7800 entries, far more than any other survey we’ve held so far, and even after filtering out invalid entries we end up with a formidable number of valid participants.

According to the results the most popular framework, by far, was Laravel. Coming in second was Symfony2 and third the Nette framework. They did ask for different opinions for personal versus business choices but the results track the same between the two. He also splits out the data into the top results by country and by the age of the people who responded.

He finishes off the post with some of his own thoughts on why Laravel was the clear winner with only some of it having to do with the framework itself. He points out the related projects, "near perfect documentation" and other things (like Laravel's own subreddit). He suggests that, even though open source and "free" tend to go together, spending money and a good amount of time on a project can help ensure it succeeds. He also offers some practical advice for those wanting to give their project a boost:

Spread the word, analyze solutions from other people, discuss them. Be open, be transparent. Have an official blog, get a StackOverflow tag, justify your decisions, get in touch with popular publications which can help promote your framework if you present it well enough.
tagged: framework survey results opinion popularity 2015 laravel symfony2 nette

Link: http://www.sitepoint.com/best-php-framework-2015-sitepoint-survey-results/

Michael Dyrynda:
Filtering models with Eloquent in Laravel
Mar 06, 2015 @ 10:14:12

Michael Dyrynda has a recent post about handling matching and limiting results in Eloquent models in a Larvel-based application.

Say you have a users table with the following fields in it name, email, city, state, zip. You may want to provide fuzzy searching for the name, email, or city and exact matching for the state and zipfields. Why fuzzy matching for only some of the fields? Well, you might want to search for everyone whose name contains Michael or has has an @gmail.com address. Be mindful of the latter; it will expose a large dataset if you're not careful in restricting access to the functionality. You probably wouldn't want to allow it in anything bigger than a proof of concept (which this is!).

He goes through the model process, showing how to set up a simple model with the fields mentioned and make use of query scopes to limit returned results. Code is included showing how to define the "scopeFilter" method in the model and call the "User" model instance with the "filter" method. The example limits the results to only the users with a value in the "name" and "state" field.

tagged: filter model results tutorial eloquent laravel scope query

Link: https://iatstuti.net/blog/filtering-models-with-eloquent-in-laravel

Stefan Koopmanschap:
On Code Reviews
Mar 06, 2015 @ 09:11:40

Stefan Koopmanschap has a new post today talking about code reviews and introducing the concept for those not familiar with what they are or their usefulness.

Code reviewing is exactly what it sounds like: It is reviewing code written by another developer. There are different ways of doing this, but in the end it all comes down to having at least one other set of eyes checking any code written before it is released. There’s many reasons for doing code reviews. It can be to prevent security issues, to ensure correct performance of your application, to prevent bugs but eventually it all comes down to the more generic term of ensuring the quality of your application.

He goes on to talk about some of the most common ways to do code reviews, either in something a simple as a pull request out to face-to-face discussions as the code is being introduced. He includes some hints on preparing for the review, steps to perform the review, dealing constructively with the comments made and finally the approval. He talks about who should do the reviewing and how they can still be useful even if you work alone or with a QA department.

tagged: codereview introduction why how tips results methods

Link: http://leftontheweb.com/blog/2015/03/06/Code_Reviews/

Community News:
Do You Know PHP? (Quiz)
Nov 19, 2014 @ 10:53:23

Think you know a lot about PHP? Well, the folks at PHP Weekly and mogosselin have put together a fun little quiz you can use to see just how much you know your favorite language.

Question topics cover things like:

  • Notable people in PHP's past
  • "Meta" about the language itself
  • The future of the language
  • Projects from around the PHP community
  • PHP security topics
  • Plenty of tricky code questions

...and that's all the hints you're going to get. Go over and test out your knowledge and see how you rank against the other developers taking on the challenge!

tagged: quiz fun language history future project questions results

Link: http://markonphp.com/php-quiz-2014/

Peter Aba:
phpmetrics of popular php projects
Sep 15, 2014 @ 10:11:01

Peter Aba has put together a a set of visualizations around the popularity of various PHP projects using the phpmetrics tool. He decided to run it against several projects he knows of and share the results.

I came across a new tool called phpmetrics. It can be used for, what a surprise, calculating and displaying metrics for php. I fell in love with this cute little tool in an instance and decided to run it on some php projects that I consider important. I’m aware of the fact that the list is currently far from complete, but it’s probably still worth a look. I especially love the “maintenability” (sic!) reports, I find those big red spots just as disgusting as I find ugly code the same.

He's broken it up into a few different sections with lots of different projects under each:

  • Frameworks
  • CMS
  • E-commerce
  • Development tools

There's also an "Other" (and "Backfire") category that contains the results for the results of phpmetrics itself. He also includes a few issues he ran across during the processing of the metrics, some with the phpmetrics tool itself and some with the libraries themselves.

tagged: metrics popular projects phpmetrics results visualization

Link: https://peteraba.com/blog/phpmetrics-of-popular-projects/

Real-World WordPress Benchmarks with PHP5.5 PHP5.6 PHP-NG and HHVM
Jul 30, 2014 @ 12:26:51

The Kinsta.com blog has a new post with the results of some benchmarking they've done around WordPress comparing PHP 5.5, PHP 5.6 (PHPNG) and HHVM in response time (well, time taken for the request).

If you remember we wrote an article a good couple of months ago when WordPress 3.9 came out that HHVM was fully supported beginning with that release, and we were all happy about it. The initial benchmark results showed HHVM to be far more superior than the Zend engine that’s currently powering all PHP builds.

[...] Obviously you have to compromise based on your (or rather your sites’) needs but is it worth it? How much of a performance gain can you expect by switching to HHVM? [...] Today I finally took the time to set up a test environment and do some tests to compare a couple of different builds with a fresh out of the box WordPress install and one that has a bunch of content added plus runs WooCommerce!

The testing was all done locally on virtual machines (using Vagrant setups) and two different kinds of test WordPress installations. They share the results in the post, showing the differences between the HHVM installations and the plain PHP ones. The results also show the differences between having the opcode cache on and off. Curious to see how it would perform outside of a local system, they also pushed the same configurations out to a DigitalOcean instance with some slightly different results.

tagged: wordpress benchmark php55 php56 phpng hhvm compare results

Link: https://kinsta.com/blog/real-world-wordpress-benchmarks-with-php5-5-php5-6-php-ng-and-hhvm/