|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-12-17 01:01 UTC] pajoye@php.net
[2009-12-17 01:22 UTC] tidustracker at freenet dot de
[2009-12-17 01:31 UTC] pajoye@php.net
[2009-12-19 13:23 UTC] carsten_sttgt at gmx dot de
[2009-12-28 14:55 UTC] pajoye@php.net
[2011-08-18 06:50 UTC] augf87 at gmail dot com
[2017-10-24 07:30 UTC] kalle@php.net
-Status: Assigned
+Status: Open
-Assigned To: pajoye
+Assigned To:
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 06:00:01 2025 UTC |
Description: ------------ It seems that passing an array(filled or empty) to proc_open drops the two constants SOL_TCP and SOL_UDP in created process Reproduce code: --------------- $arrConstants = get_defined_constants(true); print('Constants: '. count($arrConstants['sockets']) . PHP_EOL); print_r($arrConstants['sockets']); ob_start(); ?> $arrConstants = get_defined_constants(true); file_put_contents('D:/proc_open_bug.txt', 'Constants: '. count($arrConstants['sockets']) . PHP_EOL . print_r($arrConstants['sockets'], true)); <?php $strCode = ob_get_contents(); ob_end_clean(); $arrDescriptor = array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w')); $arrOptions = array('suppress_errors' => false, 'bypass_shell' => true); $arrPipes = array(); $strCWD = null; $arrEnv = array('process' => true); // Constants SOL_TCP and SOL_UDP are NOT available in opened process #$arrEnv = null; // All fine with constants SOL_TCP and SOL_UDP proc_open('php_53 -r "'. $strCode. '"', $arrDescriptor, $arrPipes, $strCWD, $arrEnv, $arrOptions); Expected result: ---------------- passing an array to proc_open expects 86 constants including SOL_TCP and SOL_UDP in the new process Actual result: -------------- only 84 constants