Bug #76347 [Opn->Fbk]: getopt() only usable once

From: Date: Wed, 23 May 2018 21:20:27 +0000
Subject: Bug #76347 [Opn->Fbk]: getopt() only usable once
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215349@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76347&edit=1 ID: 76347 Updated by: cmb@php.net Reported by: kaishos at gmail dot com Summary: getopt() only usable once -Status: Open +Status: Feedback Type: Bug Package: PHP options/info functions Operating System: ubuntu0.16.04.1 PHP Version: 7.0.30 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Firstly, active suport support for PHP 7.0 ended five months ago[1], so this branch will only receive security related fixes. Secondly, the expected result is actually: Array ( [f] => -t ) Array ( ) See <http://php.net/manual/en/function.getopt.php>. If you really get the reported actual result with an actively supported PHP version, this would be a bug. Please check again. [1] <http://php.net/supported-versions.php> Previous Comments: ------------------------------------------------------------------------ [2018-05-16 08:42:22] kaishos at gmail dot com Description: ------------ This affects php 7.0.28 that is default packages with ubuntu, could not find it in the list seems that it will not parse more options if you have parsed one. it has similarity with: https://bugs.php.net/bug.php?id=35594 Test script: --------------- create file called test.php and add: <?php $fromOpt = getopt("f:"); $toOpt = getopt("t:"); print_r($fromOpt); print_r($toOpt); ?> https://bugs.php.net/bug.php?id=35594&edit=1 then run: php test.php -f -t Expected result: ---------------- Array ( [f] => ) Array ( [t] => ) Actual result: -------------- Array ( [f] => ) Array ( ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76347&edit=1

« previous php.bugs (#215349) next »