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

TutsPlus.com:
Working With PHP Arrays in the Right Way
Apr 26, 2017 @ 11:57:09

If you're relatively new to the PHP language and are just getting your feet wet, the massive amounts of array functionality included in the language could be confusing. This is where this new article on the TutsPlus.com site comes in, showing you how to work with PHP arrays "the right way".

n this tutorial, I am going to make a list of common PHP array functions with examples of usage and best practices. Every PHP developer must know how to use them and how to combine array functions to make code readable and short.

Also, there is a presentation with given code examples, so you can download it from the related links and show it to your colleagues to build a stronger team.

He starts out with some of the basics around using arrays in PHP and then quickly moves into other topics:

  • shortening code with functions like list
  • using the filtering functions
  • walking through array values
  • joining arrays
  • generating arrays
  • sorting the contents of arrays

He ends the post with a look at combining array functions to make it simpler to do things like remove empty values or return just the top three values.

tagged: tutorial introduction array functionality language

Link: https://code.tutsplus.com/tutorials/working-with-php-arrays-in-the-right-way--cms-28606

CloudWays Blog:
Phil Sturgeon Talks About API Development, PHP-FIG, PHP Books And The Future Of PHP
Apr 25, 2017 @ 12:34:44

On the Cloudways blog there's a new post sharing an interview with Phil Sturgeon with some of his thoughts about API development, the PHP-FIG organization, PHP-related books and the future of the language.

Today we are super excited to have Phil Sturgeon with us for this interview. Phil is a cool dude and an experienced API dev. He has a lot of experience in creating API for different platforms. Right now, he is working at WeWork as a Platform Engineer. He has written an excellent book on creating API, “Build APIs You Won’t Hate”. He has worked with popular PHP tools and frameworks including CodeIgniter, FuelPHP, PyroCMS. Phil also contributed to PHP The Right Way and PHP-FIG.

Phil also speaks at PHP conferences and often mentors budding developers. In this Interview he talks about his development experiences, workflows and experience with API development.

In the interview Phil answers questions about:

  • how he got started in PHP development
  • his opinions on PHP 7.x
  • preferred development workflows
  • his (previous) involvement with the PHP-FIG
  • his speaking and the topics he usually covers

Check out the full interview for answers to these and other questions.

tagged: cloudways interview philsturgeon development api phpfig books language

Link: https://www.cloudways.com/blog/phil-sturgeon-php-interview/

PHP.net:
PHP 7.1.4 Released
Apr 14, 2017 @ 09:23:58

On the main PHP.net site they've posted an announcement about the latest release in the PHP 7.1.x series - PHP 7.1.4:

The PHP development team announces the immediate availability of PHP 7.1.4. Several bugs have been fixed. All PHP 7.1 users are encouraged to upgrade to this version.

Bugfixes in this release include changes in Core, Apache, DOM, Opcache and OpenSSL functionality. As always, this latest release can be downloaded from the main downloads page on the PHP.net site (source) and windows.php.net for the Windows binaries. If you'd like to view the full list of changes and see links to the bugs they fix check out the full Changelog.

tagged: language release bugfix php71

Link: http://php.net/index.php#id2017-04-13-2

PHP.net:
PHP 7.1.3 Released
Mar 17, 2017 @ 11:17:21

The PHP.net site has posted an announcement about the latest release in the PHP 7.1.x series - PHP 7.1.3:

The PHP development team announces the immediate availability of PHP 7.1.3. Several bugs have been fixed. All PHP 7.1 users are encouraged to upgrade to this version.

Bugs fixed in this version include changes in core code, Apache support, GD image handling, OpenSSL changes and correcting bugs in the standard libraries. As always you can download this latest release either from the main PHP.net site (source) or from windows.php.net (Windows binaries).

tagged: language release bugfix php71

Link: http://php.net/index.php#id2017-03-16-2

Community News:
Exakat - Static analysis tools for PHP
Feb 27, 2017 @ 14:25:25

On the Exakat GitHub account Damien Seguy has put together a pretty complete list of static analyzers you can use for your PHP applications.

The list is broken down into the types of scanners:

  • Bugs finders
  • Coding standards
  • DIY
  • Fixers
  • Metrics
  • SaaS
  • Misc

Each section includes a good list of tools and links to each of them (usually just to other GitHub repositories but some go to actual project pages). There's a lot of them to look through but be careful to evaluate the current state of the project. Just because it's linked here doesn't mean it's a complete tool.

tagged: static scanner tool language bug standard metrics saas list

Link: https://github.com/exakat/php-static-analysis-tools

Rasmus Lerdorf:
A bit of PHP history
Feb 22, 2017 @ 12:55:24

If you were ever interested in the early days of PHP (back in the PHP/FI days, pre-3.0 even) Rasmus Lerdorf has a post sharing an old Changelog he created for some of the first PHP version releases.

Ran across this Changelog from a long long time ago. Read from the bottom up. I added the PHP Tools lines at the bottom for context. So many early decisions made on a whim still affecting us today. And then there are things like "Removed **, // and %% operators" which did a vector dot-product and its inverse, I think. I seem to recall deleting it when I tried to document it.

No years on most of the entries, but version 1.90 was on Sept.18, 1995.

It's an interesting read to see some of the thoughts and additions to the language early on. You can see which functions were added way back then and which ones have been dropped since including an entry for October 17th - "First public release of the code".

tagged: language history changelog early version

Link: https://toys.lerdorf.com/archives/61-A-bit-of-PHP-history.html#extended

Three Devs & A Maybe:
Contributing to PHP with Joe Watkins
Feb 21, 2017 @ 12:15:03

The Three Devs and a Maybe podcast has posted their latest episode featuring returning special guest Joe Watkins to talk about contributing back to the PHP language:

In this weeks episode we chat to good friend of the show Joe Watkins. We start off discussion with his recent work on creating a compute-node, dual WAN setup and accepted PHP Serbia talk on contributing to PHP without being a ‘C wizard’. From here we move on to mention some of the areas (bug tracking system and QA) that could be improved with the help of new contributors within the PHP internals ecosystem. Finally, we highlight several recently proposed RFCs, his opinions on them and some work he is doing on a future RFC.

You can listen to this latest episode either through the in-page audio player or by downloading the mp3 directly. If you enjoy the show be sure to also subscribe to their feed and follow the podcast on Twitter to get updates with new shows are released.

tagged: threedevsandamaybe podcast joewatkins contributing language

Link: http://threedevsandamaybe.com/contributing-to-php-with-joe-watkins/

PHP.net:
PHP 7.1.2 Released
Feb 20, 2017 @ 12:15:32

The official PHP.net site has announced the release of the latest version in the PHP 7.1.x series: PHP 7.1.2:

The PHP development team announces the immediate availability of PHP 7.1.2. Several bugs have been fixed. All PHP 7.1 users are encouraged to upgrade to this version.

Bugs fixed include changes for DOM handling, FastCGI, hashing (adding http://php.net/hash_hkdf function), MySQL, OpenSSL and a good number of other locations. You can view the Changelog for the complete list. As always you can get this latest version from the main downloads page (source release) or windows.php.net for the Windows binaries.

tagged: language version release php71 minor bugfix

Link: http://php.net/index.php#id2017-02-17-1

Dev.to:
PHP 7.2: The First Programming Language to Add Modern Cryptography to its Standard Library
Feb 14, 2017 @ 12:10:29

In this post to the dev.to site Scott Arciszewski talks about a milestone in the PHP language, it being the first language to "add modern cryptography to its standard library" (PHP 7.2).

Last week, the voting phase closed on an RFC to add libsodium to PHP 7.2. The result was unanimous (37 in favor, 0 against).

When version 7.2 releases at the end of the year, PHP will be the first programming language to adopt modern cryptography in its standard library.

He goes on to talk about what "modern cryptography" is describing concepts like secure primitives and showing example of the high-level API the integration will provide. The post finishes out with a rebuttal against some of the nay-sayers around PHP and its reputation for security. They say that there's "no way PHP is more secure than " so Scott compares this libsodium addition to some of the features in other languages and where they're lacking in relation.

tagged: programming language cryptography standard library libsodium php72

Link: https://dev.to/paragonie/php-72-the-first-programming-language-to-add-modern-cryptography-to-its-standard-library

SitePoint PHP Blog:
How to Make Modern PHP More Modern? With Preprocessing!
Feb 03, 2017 @ 11:20:47

The SitePoint PHP blog has posted another tutorial from author Christopher Pitt sharing another one of his "interesting things" you can do with PHP. In this latest article Christopher returns to the idea of "macros" to help with some pre-processing in PHP applications and, ultimately, creating a new language feature without some of the usual overhead.

Let’s have a bit of fun. A while ago, I experimented with PHP macros, adding Python range syntax. Then, the talented SaraMG mentioned an RFC, and LordKabelo suggested instead adding C#-style getters and setters to PHP.

Aware of how painfully slow it can be for an outsider to suggest and implement a new language feature, I took to my editor…

He starts with a brief refresher on macros to do some pre-processing on PHP scripts and allow you to make custom language features that then get interpreted into valid PHP (often with some interesting eval tricks involved). He starts by building a "base" to add in the C# style getters and setters in a special format inside of a class. He includes the macro definitions to set this up and the result once it is passed through the "yay" precompiler. To get around having to run that precompiler every time manually, he creates a custom autoloader to do the job dynamically. He then takes this logic and packages it up so it can be easily installed as a Composer dependency. With this structure in place, he moves on to the creation of a new language feature - the actual functionality for the getter/setters. He ends the post with a screen capture showing the language feature in use and some of the interesting things you can do with it.

tagged: precompile macro tutorial language feature getter setter

Link: https://www.sitepoint.com/how-to-make-modern-php-more-modern-with-preprocessing/