php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #8076 Array === argv
Submitted: 2000-12-02 01:23 UTC Modified: 2001-05-12 15:31 UTC
From: anthony at trams dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.3pl1 OS: Win2k
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: anthony at trams dot com
New email:
PHP Version: OS:

 

 [2000-12-02 01:23 UTC] anthony at trams dot com
In perl, I am able to pass an array to a function.  When doing so, each of the array's indices apear to be scalar values to the function.

When passing the equivalent form of an assicitave array to perl (hash array), the values passed to the function apear to alternate between keys and values.

I am looking for this functionality in PHP, but must resort to constructing an eval() statement instead.

So what I'm suggesting is a language construct, perhaps as follows:  

array_as_argv() - which would alternate between keys and values.
array_keys_as_argv() - which would only pass the keys
array_values_as_argv() - which would only pass the values

This makes me think there might be a need for obj_as_argv(), but who knows?

See Bug id #5350

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-12 15:31 UTC] cardinal@php.net
Use call_user_func_array
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 05 22:01:30 2025 UTC