php / php/doc-en

Missing backwards-incompatible change in PHP 8

Open Beginner friendly
#4,054 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Status: Verified
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

From manual page: https://php.net/function.proc-open


In PHP 8.0, proc_open changed that it now runs (in Windows) cmd /s /c always.

See:
https://github.com/php/php-src/commit/9ca449e0a803cb9d1d40fd6b83f2da1e6a7b46d9

It is mentioned in the migration guide as well:
https://www.php.net/manual/en/migration80.incompatible.php#:~:text=now%20consistently%20execute-,%25comspec%25,-/s%20/c%20%22%24commandline

I think this should be noted in the proc_open page itself. I recently upgraded some servers from PHP 7.2 to 8.2, and this line of code, which used to work stopped working:

    $cmd = '"C:\\path\\to\\exe.exe '.$cssfile.'"';
    $descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w"));
    $process = proc_open($cmd, $descriptorspec, $pipes, $swffontdir);

The documentation for proc_open does mention changes regarding to escaping when using array as args, but not that the old string version also did.

Also, this is now misleading, as we pass /s /c:

Note: On Windows, unless bypass_shell is set to true in options, the command is passed to cmd.exe (actually, %ComSpec%) with the /c flag as unquoted string

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the proc_open manual page and compare its Windows command-passing note with the PHP 8 migration guide and referenced PHP source commit. Update the page to describe the /s /c behavior for string commands and correct the currently misleading wording, then verify the documentation renders correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.