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

CodeWall:
5 Ways To Loop Through An Array In PHP
Sep 25, 2018 @ 11:04:25

On the CodeWall site Dan Englishby walks you through some of the basic functionality in the PHP language for working with arrays. In it he shows how to loop through an array using multiple tools including the usual control structures and others less widely used.

PHP, just like most other programming languages has multiple ways to loop through arrays. The most popular ways to do it usually is with a while, for and foreach operator, but, believe it or not, there more ways to do it with PHP. In this article I will walk-through each possibility for reading arrays whilst looping.

He breaks the article up into sections, one for each of the methods:

  • the white loop
  • the for loop
  • the foreach loop
  • the do/while loop
  • using the ArrayIterator

Each item in the list comes with a summary of how it works and some code showing it in action.

tagged: introduction tutorial language loop array top5 example

Link: https://www.codewall.co.uk/5-ways-to-loop-through-array-php/

TJ Miller:
Verifying Laravel Version Compatibility
Sep 24, 2018 @ 10:45:58

TJ Miller has written up a post for his site sharing a method he's created to verify the compatibility of a package in Laravel based on the version of Laravel installed.

I’ve been working with Honeybadger to build a new set of PHP integrations. I would like to write more about that soon, however, I feel like I’ve stumbled across something that could be useful to others. I wanted to share it as soon as I could.

For the Laravel package, I was aiming for Laravel 5.5 and newer support as it is the latest LTS version. [...] In hindsight, I don’t think that I actually ever tested it against a 5.5 install. I relied on the CI process to make those verifications for me.

[...] As Laravel 5.7 is now out, I needed to add support to both the package’s composer configuration and verification in CI. [...] Now that I am supporting three versions I felt that I needed a more specific way of verifying compatibility with different versions of Laravel.

He shares his initial version of his Travis-CI configuration, running tests on PHP 7.1 and 7.2 with the prefer-lowest flag. In order to make it easier, he updated this based on what he'd seen in other packages: adding a matrix that runs PHP 7.1 through 7.3 against versions 5.5.x, 5.6.x and 5.7.x to ensure compatibility across all variations. His resulting build looks something like this.

tagged: verify laravel version compatibility travisci multiple language framework

Link: https://blog.tjmiller.me/verifying-laravel-version-compatibility

php[architect]:
PHP 7.3 is On Track
Sep 17, 2018 @ 11:19:58

On the php[architect] site they've shared another article from their September 2018 issue. In this new article author Damien Seguy looks forward to PHP 7.3 and covers some of the new features that come with it.

PHP 7.3 successfully passed the “feature freeze” deadline. On Aug. 1st, 2018 all features for PHP 7.3 were identified. This triggered the first PHP 7.3 beta, on the following day, and, from there, we’ll reach RC in September. It is time to review what this new PHP version has available for us, help test PHP 7.3, and get ready.

He goes through several of the changes coming including:

  • Improved Garbage Collector
  • Relaxed Heredoc/Nowdoc
  • Trailing Comma for Calls
  • Deprecated Case-insensitive Constants
  • PCRE 2.0
  • SQLite 3.24
  • Json_encode May Throw Exceptions
  • array_first_key(), array_last_key()
  • list() with References
  • is_countable()
  • net_get_interfaces()
  • Removing image2wbmp()
  • assert() is Now a Reserved Function
  • Continue for Loops, Break for Switch
  • Monotonic Timer: hrtime()
  • compact() Reports Undefined Variables

For each of the items listed, there's a brief explanation of what the feature is and some code to show it in action. The tutorial ends with a listing of some things you can do to prepare your current codebase to work with PHP 7.3 ahead of the December 13th release date.

tagged: language release php73 lookahead preparation features tutorial example

Link: https://www.phparch.com/2018/09/php-7-3-is-on-track/

Laravel News:
PHP 7.3’s First Release Candidate is Here
Sep 14, 2018 @ 09:54:29

In a new post to the Laravel News site, they've shared the announcement about the release of the first Release Candidate for PHP 7.3.x: PHP 7.3.0RC1.

PHP 7.3 is inching closer to general release (planned for December), with today’s announcement of the first PHP 7.3 release candidate:

The post also shares the upcoming timeline for the releases leading up to PHP 7.3.0 (stable) with the first beta release planned for November 20th. They also list out (and link to more information) for some of the features coming in 7.3 including:

  • Trailing Commas in function calls
  • Flexible Heredoc and Nowdoc syntax
  • list() reference assignment
tagged: language release php73rc1 detail announcement updates

Link: https://laravel-news.com/php-7-3-rc1

PHP.net:
PHP 7.1.22, 7.0.32, 7.2.1 and 7.3.0RC1 Released
Sep 13, 2018 @ 12:32:21

On the main PHP.net site they've announced the release of several new versions for the PHP 7.1.x and 7.2.x series as well as the first Release Candidate for PHP 7.3.0.

The PHP development team announces the immediate availability of PHP 7.1.22 [and 7.0.32/7.2.10]. This is a security release. One security bug has been fixed in this release. All PHP 7.1 [and 7.2] users are encouraged to upgrade to this version.

These updates can be downloaded from the main downloads page or windows.php.net for the Windows binaries. The pre-release PHP 7.3.0RC1 is also available from the QA site or the Windows QA site.

tagged: language release php71 php72 php73rc1

Link: http://php.net

Laravel News:
PHP Docs Workflow for Alfred
Aug 22, 2018 @ 10:49:53

On the Laravel News site there's a new post sharing a workflow developed by Bill Clark that makes searching the PHP documentation with the Alfred tool easier.

PHP Docs workflow for Alfred by Bill Clark is a workflow for searching the PHP documentation from Alfred directly. The PHP Docs workflow code builds on Till Krüss’ Laravel Docs Workflow for Alfred that we recently covered.

[...] You can search the PHP documentation by opening up Alfred and prefixing your search with “php” and then the search term.

They give an example of how to search the documentation and a screenshot of the resulting list. You can find out more and get this Alfred workflow for yourself over on the GitHub repository for the project.

tagged: documentation language workflow alfred productivity tool github

Link: https://laravel-news.com/php-docs-workflow-for-alfred

PHP.net:
PHP 7.3.0.beta2 Released
Aug 16, 2018 @ 11:09:47

The main PHP.net site has posted announcement of the release of the latest beta for the PHP 7.3.0 series: PHP 7.3.0beta2

The PHP team is glad to announce the release of the sixth PHP 7.3.0 version, PHP 7.3.0beta2. The rough outline of the PHP 7.3 release cycle is specified in the PHP Wiki.

[...] For more information on the new features and other changes, you can read the NEWS file, or the <a href="https://github.com/php/php-src/blob/php-7.3.0beta2/UPGRADING>UPGRADING file for a complete list of upgrading notes. Internal changes are listed in the UPGRADING.INTERNALS file. These files can also be found in the release archive.

The next release would be Beta 3, planned for August 30th.

You can download this latest preview release from either the source package site or from the Windows QA site for the Windows binaries.

tagged: language beta release php73beta2 announcement

Link: http://php.net/archive/2018.php#id2018-08-16-1

PHP.net:
PHP 7.3.0.beta1 Released
Aug 02, 2018 @ 11:13:01

On the main PHP.net site there's an announcement posted about the release of the latest pre-release of the PHP 7.3.x series: PHP 7.3.0.beta1.

The PHP team is glad to announce the release of the fifth PHP 7.3.0 version, PHP 7.3.0beta1. The rough outline of the PHP 7.3 release cycle is specified in the PHP Wiki.

[...] Please carefully test this version and report any issues found in the bug reporting system.

Changes in this beta include fixes in the language core, SQLite3 handling, the SPL, and PDO PostgreSQL support. As always, you can download this pre-release from the PHP QA site for source downloads or Windows QA site for the Windows binaries.

tagged: language beta release php73beta1 announcement

Link: http://php.net/archive/2018.php#id2018-08-02-1

PHP.net:
PHP 7.1.20 & 5.6.37 Released
Jul 20, 2018 @ 10:18:49

On the main PHP.net site an announcement has been posted of the latest versions in the PHP 7.1.x and 5.6.x series: 7.1.20 and 5.6.37.

The PHP development team announces the immediate availability of PHP 7.1.20 [and 5.6.37]. This is a security release. Several security bugs have been fixed in this release. All PHP 7.1 [and 5.6.37] users are encouraged to upgrade to this version.

Changes in these releases include updates to date/time handling, PHP-FPM, internationalization and PostgreSQL functionality. You can download this latest release either from the main PHP.net site (for source packages) or windows.php.net for the Windows binaries.

tagged: language release bugfix php71 php56

Link: http://php.net/index.php#id2018-07-20-2

PHP.net:
PHP 7.3.0alpha4 Released
Jul 19, 2018 @ 12:49:13

The official PHP site has posted an announcement of the release of the latest alpha for the upcoming PHP 7.3.0 release: PHP 7.3.0 alpha 4.

The PHP team is glad to announce the release of the fourth PHP 7.3.0 version, PHP 7.3.0alpha4. The rough outline of the PHP 7.3 release cycle is specified in the PHP Wiki.

This is a development release and should not be used in production. Changes in this alpha release include updates to core functionality, updates to filtering, FPM handling, mbstring and zip archive functionality. You can check out the NEWS file for a complete list of updates.

To download this latest release to try with your codebase, you can download the source from the QA downloads or get the Windows binaries from the Windows QA site. The next planned release of PHP 7.3.0 is the first beta and is set to release on August 2nd, 2018.

tagged: language release alpha php73alpha4 php73

Link: http://php.net/index.php#id2018-07-19-1