14 Sep 2019

feedPlanet PHP

Interview with Katie McLaughlin

14 Sep 2019 9:31pm GMT

Interview with Junade Ali

14 Sep 2019 3:05pm GMT

12 Sep 2019

feedPlanet PHP

PHP Internals News: Episode 27: Argument Information

PHP Internals News: Episode 27: Argument Information

London, UK
Thursday, September 12th 2019, 09:27 BST

In this episode of "PHP Internals News" I chat with Nikita Popov (Twitter, GitHub) about adding information about arguments and return types to PHP's reflection mechanism.

The RSS feed for this podcast is https://derickrethans.nl/feed-phpinternalsnews.xml, you can download this episode's MP3 file, and it's available on Spotify and iTunes. There is a dedicated website: https://phpinternals.news

Show Notes

Credits

Music: Chipper Doodle v2 - Kevin MacLeod (incompetech.com) - Creative Commons: By Attribution 3.0

Become a Patron!

12 Sep 2019 8:27am GMT

11 Sep 2019

feedPlanet PHP

Slim4-empty: minimal Slim 4 starting point

To simplify creating a new Slim 4 project, I've created slim4-empty which does this for me. To use it: [crayon-5d8099ac8f1c0290150969/] and you're done! The my-new-project directory is created and contains Slim 4 along with a minimally viable public/index.php to get you going. You can then run it with the PHP built-in server: [crayon-5d8099ac8f1c9279241620/] And navigate to https://localhost:8888 to view "Hello World" in your browser. What does it contain? Slim4-empty provides no structure to your project… continue reading.

11 Sep 2019 10:00am GMT

10 Sep 2019

feedPlanet PHP

Interview with Katie McLaughlin

10 Sep 2019 11:03pm GMT

511 Network Authentication Required

10 Sep 2019 3:00pm GMT

Interview with David Bisset

@dimensionmedia Show Notes David Bisset's blog site WordCamp Miami Audio This episode is sponsored by Using the WordPress REST API

The post Interview with David Bisset appeared first on Voices of the ElePHPant.

10 Sep 2019 11:30am GMT

Xdebug Update: August 2019

Xdebug Update: August 2019

London, UK
Tuesday, September 10th 2019, 09:25 BST

This is another of the monthly update reports in which I explain what happened with Xdebug development in this past month. It will be published on the first Tuesday after the 5th of each month. Patreon supporters will get it earlier, on the first of each month. You can become a patron here to support my work on Xdebug. More supporters, means that I can dedicate more of my time to improving Xdebug.

In August, I worked on the following things:

2.8.0beta2 Release

This second beta release addresses a lot of issues that were still outstanding for the 2.8 release. This included simple issues like Wrong name displayed for Recoverable fatal errors and Code Coverage misses fluent interface function call. The trickiest bug was related to the DBGp debugging protocol.

I test Xdebug's implementation of the DBGp protocol by having a file with the PHP script to debug and then a phpt test that has a set of commands to run against that file. As an example, for one of the fixed bugs, the script looks like:

<?php function breakpoint1()
{
        echo base64_encode("testing"), "\n";
        strlen();
}

breakpoint1();
??>

And the phpt test looks like:

<?php require 'dbgp/dbgpclient.php';
$filename = realpath( dirname(__FILE__) . '/bug01388-01.inc' );

$commands = array(
        'feature_get -n resolved_breakpoints',
        "breakpoint_set -t line -f file://{$filename} -n 4",
        'breakpoint_list',
        'feature_set -n resolved_breakpoints -v 1',
        'feature_get -n resolved_breakpoints',
        'breakpoint_list',
        "breakpoint_set -t line -f file://{$filename} -n 4",
        'breakpoint_list',
        'detach',
);

dbgpRunFile( $filename, $commands );
??>

The third command sets a breakpoint on line 4 (the echo statement) and then does various things related to breakpoint resolving. The "remote log" that is generated by the test is then compared (after some regexp replacements) with the expected output.

Because I run the script in a new process, I have some methods in place to also collect the output of the script (both stdout and stderr). I don't usually have stderr on, as there are a few false positives, but when I tested with this in the past, I noticed that one test caused a segmentation fault.

After a few hours of trying to find out the problem, I noticed that this would only happen in the init state (when the debugger first connects to the IDE, and when the IDE can enable features and send breakpoints). If in this init state the IDE would send the detach command, Xdebug would crash. This detach command can be used by an IDE to disengage the debugger, with the script continuing to run afterwards.

Due to an implementation bug related to whether the debugger connection was active or not, a detach in the init state would mark the connection active, while the connection was already cleaned up before hand. This caused Xdebug to access memory, that was already freed (which is a bad thing to do). The fix was luckily quite simple.

IANA Port Assignment

As a result of a twitter conversation that I had, I tried applying for an "assigned port" for the DBGp protocol. As some of you might be aware, Xdebug shares the same default port (9000) as PHP-FPM. This has caused confusion in the past, so I was hoping to avoid future problems with Xdebug 3 by asking IANA to assign me one. However, IANA declined by application by somewhat vague comments about "security" and not needing one because DBGp runs on a LAN.

As to the security aspect, they require authentication and encryption for new protocols, and of course DBGp isn't new. I would like to add an encryption layer to DBGp, but I can't require this right away, as that would mean no IDE can talk DBGp any more. Requiring authentication (i.

Truncated by Planet PHP, read more at the original (another 5031 bytes)

10 Sep 2019 8:25am GMT

06 Sep 2019

feedPlanet PHP

Leaders Wanted

In the best companies, everyone is a leader. Decisions are made by those best suited to make them, everyone feels trusted and respected, and a shared purpose provides unity and motivation. I've been trying to be a better leader my entire career, and I ……

06 Sep 2019 5:55pm GMT

PHP on the road to the 7.4.0 release

06 Sep 2019 8:35am GMT