Skip to content

PHP 7.4: new NewProcOpenCmdArray sniff#869

Merged
wimg merged 1 commit intomasterfrom
php-7.4/new-proc-open-cmd-array-sniff
Aug 28, 2019
Merged

PHP 7.4: new NewProcOpenCmdArray sniff#869
wimg merged 1 commit intomasterfrom
php-7.4/new-proc-open-cmd-array-sniff

Conversation

@jrfnl
Copy link
Copy Markdown
Member

@jrfnl jrfnl commented Aug 20, 2019

proc_open() now accepts an array instead of a string for the command. In
this case the process will be opened directly (without going through a
shell) and PHP will take care of any necessary argument escaping.

proc_open(['php', '-r', 'echo "Hello World\n";'], $descriptors, $pipes);

Refs:

Includes unit tests.

Related to #808

> proc_open() now accepts an array instead of a string for the command. In
>  this case the process will be opened directly (without going through a
>  shell) and PHP will take care of any necessary argument escaping.
>
>  `proc_open(['php', '-r', 'echo "Hello World\n";'], $descriptors, $pipes);`

Refs:
* https://github.com/php/php-src/blob/3775d47eee38f3b34f800a0b23f840ec7a94e4c7/UPGRADING#L323-L327
* php/php-src@8be0510

Includes unit tests.
@jrfnl jrfnl force-pushed the php-7.4/new-proc-open-cmd-array-sniff branch from 0190c85 to a56e1f0 Compare August 21, 2019 09:43
@wimg wimg merged commit da4609d into master Aug 28, 2019
@delete-merged-branch delete-merged-branch bot deleted the php-7.4/new-proc-open-cmd-array-sniff branch August 28, 2019 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants