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

Three Devs & A Maybe:
Episode 78 - PHP Internals catch-up with Joe Watkins
Nov 24, 2015 @ 09:58:04

The Three Devs and a Maybe podcast has a new episode posted today with special guest Joe Watkins, PHP internals developer and developer on the APCu extension. They catch up with Joe and what's been happening in the world of PHP internals lately (and the flurry of excitement around PHP 7).

On this weeks show we are lucky to be joined by recurring guest and friend of the show Joe Watkins. We start of discussion with the upcoming PHP 7 release, reasoning behind why it has been postponed, the bright future of adoption to the release compared to previous versions and how the release gets packaged up for different distributions.

Other topics mentioned in this latest episode include:

  • "uopz" (User Operations for Zend)
  • the pthreads polyfill
  • the recent APCu events and additions

The show notes also link to several of Joe's projects on GitHub for reference. You can listen to this latest episode either through the in-page audio player or by downloading the mp3. Also be sure to subscribe to their feed if you enjoy the episode and want to hear more.

tagged: threedevsandamaybe podcast ep78 joewatkins interview phpinternals php7 apcu pthreads useroperations uopz

Link: http://threedevsandamaybe.com/php-internals-catch-up-with-joe-watkins/

Cal Evans:
7 Days of PHP 7 – The Complete Collection
Nov 12, 2015 @ 12:35:47

With the upcoming release of the first stable version of PHP 7 Cal Evans has been posting a "7 Days of PHP 7" series, linking to information about the upcoming release, presentations, podcasts and more about this upcoming version. In this post to his site he gathers them all into one place with links to everything for easier consumption.

PHP 7 was originally supposed to be released today, November 12th, 2015. The Core developers weren’t comfortable releasing it just yet so they pushed the date back to November 26th, 2015. That’s fine, we all appreciate their diligence.

Still, I had already started my “7 Days of PHP 7” countdown when they made the announcement. Because the actual release date isn’t important to spreading the word about PHP 7, I decided to continue on with the countdown.

In his tweets he links to things like the PHP 7 migration manual, an article about PHP 7 performance and video tutorials on getting up and running with PHP 7. Check out the full post for more information on these and other useful PHP 7-related resources.

tagged: php7 7days tweet resource article tutorial language version release

Link: http://blog.calevans.com/2015/11/12/7-days-of-php-7-the-complete-collection/

PHP 7.0.0 RC 7 Released
Nov 12, 2015 @ 11:22:41

On PHP.net today they've announced the released of the latest (and hopefully last) Release Candidate before the final, stable version of PHP 7 is announced: PHP 7.0.0. RC7.

The PHP development team announces the immediate availability of PHP 7.0.0 RC 7. This is the twelfth pre-release of the new PHP 7 major series. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system.

[...] This release candidate is unplanned and ships instead of the announced RTM for the reasons of yet additional quality improvement. If no major issues appear within the usual two-week test period, the 7.0.0 general availability (GA) release will be brought out. You can also read the full list of planned releases on our wiki.

You can find the complete list of changes in the NEWS file. You can get the download of this latest release from either the QA source download page or the windows.php.net QA site. Remember, this is a release candidate version and is not meant to be used in production.

tagged: php7 php7rc7 releasecandidate release preview development language version

Link: http://php.net/archive/2015.php#id2015-11-12-1

Davey Shafik:
Upgrading to PHP 7
Nov 12, 2015 @ 09:19:52

As Davey Shafik mentions in this post to his site, O'Reilly has just released a "mini-eBook" he's written up to help you migrate your current codebase up to PHP 7 compatibility.

Yesterday, O’Reilly published my report on Upgrading to PHP 7. This 80-page mini-eBook is available free (and DRM free) in ePub, Mobi, and PDF formats.

Grab it today or read more details here.

The book guides you through the updates and features that come along with PHP 7 including: "deprecated features, Unicode enhancements, changes in Object-Oriented programming, and other enhancements." You'll get more details on what to change to bring your code up to the level of PHP 7 and remove deprecated features and what to replace them with. The book is free so there's no reason not to pick up a copy and find out what the PHP 7 revolution is all about.

tagged: php7 upgrade ebook oreilly published released download free

Link: https://daveyshafik.com/archives/69401-upgrading-to-php-7.html

Kinsta Blog:
10 Things Not To Do In PHP 7
Nov 11, 2015 @ 09:53:36

On Kinsta.com Daniel Pataki has posted a list of seven things not to do in PHP 7 when it's finally released. It's no secret that there's a lot of new functionality coming with this new version but that also potentially means some bad practices coming along with them.

I’ve already shared some of the upcoming features of PHP 7, in this article I thought I’d take a look at some of the bad patterns we should stop using as we switch to the lightning fast PHP 7.

Among the things on his list are suggestions like:

  • Do Not Use mysql_ Functions (removed from core)
  • Do Not Use PHP Close Tags At The End Of A file
  • Do Not Perform Queries In A Loop
  • Do Not Trust User Input

Some of the suggestions do have a direct relation to what PHP 7 has to offer but most of them are just good practices to follow during your development work. Quite a few good tips in there, especially if you're relatively new to the language and want to start with PHP 7 and go.

tagged: php7 top10 opinion development practice habits recommendation

Link: https://kinsta.com/blog/10-things-not-to-do-in-php-7/

Remi Collet:
PHPUnit code coverage benchmark
Nov 09, 2015 @ 11:57:33

Remi Collet has a quick review of some of the performance results from running the Composer PHPUnit tests on PHP 5 versus PHP 7.

As already said numerous time, PHP 7 is faster than PHP 5. Since PHPUnit 4.8 you can choose between XDebug and phpdbg as driver to retrieve code coverage data, see PHPUnit 4.8: Code Coverage Support.

Here is some benchmark results. All the tests are run using PHPUnit 5.0.8, PHP 5.6.15 as SCL or PHP 7.0.0RC6 as SCL and XDebug 2.4.0beta1 (freshly released, with some additional patches) for the composer test suite.

He shows the results in execution time and memory used for PHP 5 versus PHP 7 versions, both with and without code coverage being generated. He also includes two examples of running the tests with PHP 7, once using the XDebug debugger and one using phpdbg.

tagged: remicollet phpunit composer coverage benchmark php5 php7

Link: http://blog.remirepo.net/post/2015/11/09/PHPUnit-code-coverage-benchmark

Ken Guest:
Scan your code for old-style constructors using PHPUnit
Nov 06, 2015 @ 11:53:26

Ken Guest has a quick post on his site with a helpful hint for those updating older codebases. You can use PHPUnit & PHP_CodeSniffer to locate old constructors in the PHP4 format (constructors named after the classes).

There are less than seven days left until PHP 7 is released, which drops support for old-style constructors – the ones where a method is a constructor if it shares the same name as the class. You don’t want to spend too much time scrolling through codebases for that though do you? Better things to do, like watch videos of conference talks you’ve missed and such. Well, you’re in luck. If you use php_codesniffer (and if you don’t, well shame on you), you’ll be able to get a report of old-style constructors fairly quickly.

He includes examples of the commands you'll need to use to sniff out these older constructors, making use of the built-in "Squiz" coding standard and the "Generic.NamingConventions.ConstructorName" sniff but only on PHP files. He also shows how to alias it to a bash command and export the results to a CSV file.

tagged: scan code legacy constructor php4 php7 phpunit phpcodesniffer

Link: https://kenguest.wordpress.com/2015/11/06/scan-your-code-for-old-style-constructors-using-phpunit/

Julien Pauli:
Huge Page usage in PHP 7
Oct 30, 2015 @ 12:16:48

In this post to his site Julien Pauli looks at the concept of "huge pages" and how it relates to some of the behind the scenes work done in PHP 7 to improve memory usage.

Memory paging is a way Operating Systems manage userland process memory. Each process memory access is virtual, and the OS together with the hardware MMU must translate that address into a physical address used to access the data in main memory (RAM).

Paging memory is dividing memory in chunks of fixed size, called pages. [...] Why use huge pages? The concept is easy. If we make the OS Kernel use bigger page sizes, that means that more data can be accessed into one single page. That also means that we'll suffer from less TLB miss, once the page translation is stored into the TLB, because one translation will now be valid for more data.

He briefly covers how some updated memory handling and opcode restructuring helps PHP 7 perform even better, especially when it comes to the OPCache handling. He talks about the changes made in the extension specifically to support the "huge pages" idea, complete with code examples (in C) of how this was accomplished.

tagged: huge page php7 memory improvement performance opcache

Link: http://jpauli.github.io/2015/10/28/huge-page.html

SitePoint PHP Blog:
Randomness in PHP – Do You Feel Lucky?
Oct 29, 2015 @ 13:52:24

The SitePoint PHP blog has a post from author Nicola Pietroluongo talking about randomness in PHP. In the tutorial he talks about randomness, how it relates to cryptography and what's coming in PHP 7 to help.

This article analyzes problems related to random number generation used for cryptography purposes. PHP 5 does not provide an easy mechanism for generating cryptographically strong random numbers, while PHP 7 solves this by introducing a couple of CSPRNG functions.

He starts off by talking about what a CSPRNG (cryptographically secure pseudorandom number generator) is and some of the things it could be used for. He then moves on to the functionality coming in PHP 7 with the addition of the random_* functions for getting random bytes and random integer values. He talks briefly about what's going on "behind the scenes" of the generation and provides a simple code example with a randomized "dice roll" and the resulting numbers. He ends the post mentioning the random_compat library that can be installed for pre-PHP 7 applications that provides the same functionality just without those two functions defined.

tagged: random generation csprng number generator tutorial php7 php5 randomcompat

Link: http://www.sitepoint.com/well-do-ya-punk/

PHP 7.0.0 RC 6 Released
Oct 29, 2015 @ 11:23:16

The PHP project has just released the latest (and last before the general availability) Release Candidate for the upcoming major version of the language - PHP 7 RC6.

The PHP development team announces the immediate availability of PHP 7.0.0 RC 6. This is the eleventh pre-release of the new PHP 7 major series. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system. [...] PHP 7.0.0 RC 6 contains fixes for 10 reported bugs and marks the end of the pre-release circle.

Please note that this is a preview release and is not meant for use in a production environment. You can grab this latest Release Candidate version from the QA downloads page or the Windows QA site for the binaries. The next release, a general availability version, is planned for November 12th.

tagged: php7 releasecandidate php7rc6 language release preview

Link: http://php.net/archive/2015.php#id2015-10-29-1