php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #8595 More effective parsing of list() (+other)
Submitted: 2001-01-08 09:26 UTC Modified: 2015-01-08 22:13 UTC
Votes:7
Avg. Score:3.4 ± 1.3
Reproduced:4 of 5 (80.0%)
Same Version:0 (0.0%)
Same OS:1 (25.0%)
From: antti dot boman at helsinki dot fi Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: * OS: *
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: antti dot boman at helsinki dot fi
New email:
PHP Version: OS:

 

 [2001-01-08 09:26 UTC] antti dot boman at helsinki dot fi
I'd like to use list() for other things that assigning to, ie. this works:
list($a,$b)=$c;

But the following example doesn't work (among others):

$str="I think this is a stupid example, but it should show what I want to know";
preg_match( "/(this) is a (stupid) example/", $str, list($whole,$first,$second) );

Somebody generalized this feature request as 'more effective parser'.

Otherwise, thanks a lot for a good job!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-22 20:20 UTC] david@php.net
see also #8447
 [2010-12-31 20:11 UTC] jani@php.net
-Package: Feature/Change Request +Package: Scripting Engine problem -Operating System: Any +Operating System: * -PHP Version: 4.0.4 +PHP Version: *
 [2015-01-08 22:13 UTC] ajf@php.net
-Status: Open +Status: Wont fix
 [2015-01-08 22:13 UTC] ajf@php.net
This isn't really possible. It'd be nice, but not really doable except in limited cases with references. I also think code written like this might be confusing.

Closing as wontfix.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC