Below is the text of the page https://www.planet-php.net/ stored 2020-10-24 by archive.org.ua. The original page over time could change. View as original html

Planet PHP

[/] All news in one place platform.sh PHP 8.0 feature focus: Language tightenings (22.10.2020, 00:00 UTC) In our last chapter we went over several smaller feature improvements to PHP. Today, we’ll cover several minor language changes that make PHP safer, but may trip up some older code. There’s been a very steady trend in PHP over the last several years toward making the language tighter. That means more edge cases that are “undefined behavior that kinda silently works most of the time” turn into explicit warnings or errors, behavior that was documented but totally illogical gets adjusted to be more logical, and so on. Link Voices of the ElePHPant Interview with Chris Pitt (20.10.2020, 20:05 UTC) Link Voices of the ElePHPant Interview with Michael Lochemem (20.10.2020, 11:30 UTC) @agiroLoki Show Notes php_trie extension Trie article Functional Programming in PHP Audio This episode is sponsored by RingCentral Developers The post Interview with Michael Lochemem appeared first on Voices of the ElePHPant . Link Rob Richards Digital Identity slides from ZendCon (17.10.2020, 08:02 UTC) Link PHP: Hypertext Preprocessor PHP 8.0.0 Release Candidate 2 available for testing (16.10.2020, 00:00 UTC) The PHP team is pleased to announce the ninth testing release of PHP 8.0.0, Release Candidate 2. At this time, we're not planning to adjust the GA date, however this may change during the course of the RC cycle. The updated release schedule can, as always, be found on the PHP Wiki page about the PHP 8.0. For source downloads of PHP 8.0.0 Release Candidate 2 please visit the download page.Please carefully test this version and report any issues found in the bug reporting system.Please DO NOT use this version in production, it is an early test version. For more information on the new features and other changes, you can read the NEWS file, or the UPGRADING file for a complete list of upgrading notes. These files can also be found in the release archive. The next release will be the Release Candidate 3, planned for Oct 29 2020.The signatures for the release can be found in the manifest or on the QA site.Thank you for helping us make PHP better. Link platform.sh PHP 8.0 feature focus: quality of life improvements (14.10.2020, 00:00 UTC) Our last article looked at a new way to make null values nicer to work with. PHP 8.0 has a lot of such features that make everyday coding more fun, but there are too many of them to give them all their own articles. So today we’ll cover a grab bag of changes and improvements that aren’t web-shattering but should make working with PHP overall more pleasant. New string functions PHP has a huge array of string functions (sorry, too easy), from the very useful to the rather obscure. Link Voices of the ElePHPant Interview with Matthew Weier O’Phinney (13.10.2020, 14:36 UTC) Link Voices of the ElePHPant Interview with Jaap van Otterdijk (13.10.2020, 11:30 UTC) @Jaapio Show Notes PHP Documentor website PHP Documentor on github Audio This episode is sponsored by RingCentral Developers The post Interview with Jaap van Otterdijk appeared first on Voices of the ElePHPant . Link platform.sh PHP 8.0 feature focus: nullsafe methods (8.10.2020, 00:00 UTC) Last week we used Weak Maps to solve one edge case. Today, we simplify the most common and annoying edge case: That of nothingness. Let’s be honest, null values suck. They’ve been called the billion dollar mistake, but programmers in most languages still have to deal with it. (Except for those working in Rust.) They especially suck when you have a variable that could be an object or null. If it’s an object, presumably you know it’s type and what it can do; if it’s null, you can’t do much of anything with it. Link Rob Allen Step-debugging linked composer dependencies with PhpStorm (7.10.2020, 10:00 UTC) One project I'm working on has multiple separate parts in different git repositories that are brought into the main project using linked composer directories. I needed to get step debugging working in PhpStorm and this is the approach I took. Directory layout My project is laid out on disk like this: . ├── main-app/ │ ├── public/ │ ├── src/ │ ├── tests/ │ ├── vendor/ │ └── composer.json └── plugin-one/ ├── src/ └── tests/ As you can see I have main-app and plugin-one which are the two sets of source code that I need to work on. Linked directories in composer We need to set up ./plugin-one/ as a composer dependency of ./main-app/ such that it appears under ./main-app/vendor/client/plugin-one/ , but set-up so that we can edit the original files and have main-app pick up the changes. This is done by setting up a repository in our composer.json that points to the relevant path using a symlink. These are know as Path repositories and look like this in ./main-app/composer.json : "repositories": [ { "type": "path", "url": "../plugin-one" "options": { "symlink": true } }, ] I can then set my require like this: "require": { "client/plugin-one": "@dev", }, The net result is that ./main-app/vendor/client/plugin-one is a symlink to ./plugin-one Setting up PhpStorm We create a PhpStorm project for ./main-app and then add plug-one to it as a "content root": Go to Preferences -> Directories Click "+ Add Content Root" add add {full path}/plugin-one Click "Apply" and then "OK" to close the Preferences dialog We now have the same source code in the project twice (once in ./plugin-one and once in ./main-app/vendor/client/plugin-one ), so we need to excluded the vendor directory: In the Project tree view, find the main-app/vendor/client/plugin-one folder and select it Right click -> Mark Directory As -> Excluded The folder will now be coloured orange, so we know it's excluded. Set-up for debugging PhpStorm now knows about our source code, so next we need to map it to the server. I'm using Docker for this project, but it's the for any remote-like project. Go to Preferences -> Languages & Frameworks -> PHP -> Servers Add a new entry: Name: {dev-hostname-for-main-app} Host: {dev-hostname-for-main-app} Port: 8888 (or whatever) Debugger: Xdebug (of course!) [✓] Use path mappings In the File/Directory list set up these mappings: {full path on local disk}/main-app => /var/www/html/main-app {full path on local disk}/plugin-one => /var/www/html/plugin-one The key bit for this article is that path mapping section. The "/var/www/html" is whatever the correct path is on your Docker/Vagrant/whatever host. Finally, click the menu item Run -> Start Listening for PHP Debug Connections . Note that if this is already selected, then the menu item does not exist and the menu item Stop Listening for PHP Debug Connections is in its place. Start debugging You can now set breakpoints in plugin-one/src/whatever.php and PhpStorm will stop on them. If you are debugging a website using a browser then get the relevant Xdebug extension for Chrome or Firefox. If it's an API, then you'll need to set a cookie to enable Xdebug for the request: curl --cookie 'XDEBUG_SESSION=PHPSTORM; path=/' "http://{dev-hostname-for-main-app}:8888/foo/bar" Translate to your API client of choice! Fin This worked for me, hopefully it'll work for you too if you have a similar situation! Link More Entries Next 10 Older Entries Search Planet PHP Mozilla Searchbar Twitter Follow @planetphp on Twitter Blogs platform.sh Voices of the ElePHPant Rob Richards PHP: Hypertext Preprocessor Rob Allen Derick Rethans Matthias Noback Christian Weiske Remi Collet Cees-Jan Kiewiet Evert Pot larry@garfieldtech.com Links FAQ and Code Planet PHP FAQ Add your PHP blog Code on GitHub Contact planet-php@liip.ch Sponsors Hosted by netzwirt.ch and Liip . Maintained by Chregu Stocker , Tobias Schlitt and more. Logo designed by Colin Viebrock . Twitter account by Sepehr Lajevardi Buttons Planetarium Planet PEAR Apache Drupal MySQL