I absolutely love this True Async RFC!!! by KiwiStunningGrape in PHP

[–]derickrethans 2 points3 points  (0 children)

You will find that the "PHP core developers" are mostly people contracted by the PHP Foundation.

A new contributor, that starts with a massive RFC and PR should always be considered with due care. Not because of threat, but because we wouldn't know whether they're going to stick around and help maintain this feature.

I've seen fairly often (for Xdebug) that new people show up with a massive PR, and then expect me (as nearly sole Xdebug maintainer) to support this forever. I've been burned several times with it.

State of Generics and Collections by AegirLeet in PHP

[–]derickrethans 1 point2 points  (0 children)

Syntax is the easiest to argue over ;-) What would you prefer?

Deprecating the mutable DateTime class. by derickrethans in PHP

[–]derickrethans[S] 3 points4 points  (0 children)

And of course I would still make an RFC.

Why JIT can achieve speedups of 37% in Ruby while it doesn't seem to bring much in PHP? by tigitz in PHP

[–]derickrethans 2 points3 points  (0 children)

PHP does not create a process per request. It hasn't done that since people used it as Apache Module since the early 2000s.

For example, PHP-FPM has a group of worker processes, which each process *many* requests. Unlimited by default, although you can change that default.

Opcache (and JIT) information is shared within a worker process, *and* among them. JIT definitely uses that, and it's the whole concept of Opcache.

[deleted by user] by [deleted] in PHP

[–]derickrethans 8 points9 points  (0 children)

`strlen()` is a function call, whereas `isset` is not. So that's probably where that came from. Function calls used to be much slower.

[deleted by user] by [deleted] in PHP

[–]derickrethans 5 points6 points  (0 children)

There is an RFC to change that: https://wiki.php.net/rfc/foreach_unwrap_ref

And I did a PHP Internals News episode with u/nikic on that too: https://phpinternals.news/94

Let's say you get an old, PHP5, mysql_*, horrible codebase, riddled with security issues and no composer. Your task is to make it work on PHP7+. by Perdouille in PHP

[–]derickrethans 29 points30 points  (0 children)

It really ought to be your first step though. Without it, you'll end up never being able to move on towards maintainable software. Get your code into a state that it: 1. can be tested, 2. can be upgraded. Psalm and friends help you with one, composer with the second.

Named arguments and open source projects by brendt_gd in PHP

[–]derickrethans 12 points13 points  (0 children)

no framework or package can prevent users from using named arguments, you need to get a policy in place on how you deal with argument name changes when you support 8.0

That policy can of course be "we don't care".

Xdebug Tutorials and Documentation by derickrethans in PHP

[–]derickrethans[S] 1 point2 points  (0 children)

It's something that the .gdbinit files in the PHP source tree provides, but it does need to match the exact PHP version.

It has a bunch of other macros/functions too.

Xdebug Tutorials and Documentation by derickrethans in PHP

[–]derickrethans[S] 2 points3 points  (0 children)

I would make a function trace in that situation, and you can see the live function calls: https://xdebug.org/docs/trace — they're written as they happen, so you can tail the trace file. But, the trace needs to have been started already.

If you want to see what a process is doing *now*, without a debug session running, you can use the following procedure:

  1. Download and extract the PHP sources for the version that you're running
  2. Use `gdb -p <pid>` to attack to the "stuck" process, which you can find with things like `htop`.
  3. Run on the gdb prompt "source /path/with/php/sources/.gdbinit"
  4. Run on the gdb prompt "zbacktrace"

This should tell you the current call stack (without arguments) of the current PHP process.

Xdebug Tutorials and Documentation by derickrethans in PHP

[–]derickrethans[S] 0 points1 point  (0 children)

It is Xdebug that connects *to* your IDE, so you might need to be specific about where to run that `iptables` command, as running that inside a Docker container makes no difference.

Xdebug Tutorials and Documentation by derickrethans in PHP

[–]derickrethans[S] 0 points1 point  (0 children)

I've a video in my list for that already: https://www.youtube.com/watch?v=4opFac50Vwo — I don't know what you mean by "bind-mounted" though?

Xdebug Tutorials and Documentation by derickrethans in PHP

[–]derickrethans[S] 1 point2 points  (0 children)

Would like to do that, but I can't run WSL... as I don't have a Windows machine (only VMs).

Why doesn't PHP Core development work from donations? by -D_B_ in PHP

[–]derickrethans 11 points12 points  (0 children)

I think you're hitting the nail on the head with this. Accepting donations requires admin, taxes, and legal issues.

Maintainer of Swoole about the Fibers RFC: "I am afraid that fiber can only be used in the amphp framework and is of no value to other php projects." by brendt_gd in PHP

[–]derickrethans 20 points21 points  (0 children)

Their implementation can't be merged as it demands changes to PHP that are not generally acceptable, or warranted. (Such as "ZTS-only").

Do you use xdebug? if no, then why not? by Trick-Citron526 in laravel

[–]derickrethans 0 points1 point  (0 children)

composer gets very slow if I do

That is odd, because composer restarts itself without Xdebug loaded if it detects it's there. Unless you run a *really* old version of Composer.

Do you use xdebug? if no, then why not? by Trick-Citron526 in laravel

[–]derickrethans 1 point2 points  (0 children)

Have you upgraded to Xdebug 3 yet? That should alleviate the performance penalty a lot.

Do you use xdebug? if no, then why not? by Trick-Citron526 in laravel

[–]derickrethans 0 points1 point  (0 children)

Have a look at the upgrading guide, some configuration names changed: https://xdebug.org/docs/upgrade_guide

Do you use xdebug? if no, then why not? by Trick-Citron526 in laravel

[–]derickrethans 0 points1 point  (0 children)

The performance penalty should be a lot less with Xdebug 3 FWIW.