Re: [PHP-DEV] [RFC] Deprecations for PHP 8.5

2025-07-15 Thread Morgan
On 2025-07-03 20:34, Morgan wrote: On 2025-07-03 07:56, Gina P. Banyard wrote: > Deprecate using values of type null and bool as array offsets and when calling array_key_exists() Still curious about this. What have you got against $branch = [false => $fail, true => $pass]; o

Re: [PHP-DEV] [RFC] Deprecations for PHP 8.5

2025-07-04 Thread Morgan
On 2025-07-04 19:38, Alexandru Pătrănescu wrote: I'm thinking about constructors usually like this: They are functions that are invoked statically (using the `new` keyword) on the class before the object is created, and they execute on instance level, after the object is created. They are ca

Re: [PHP-DEV] [RFC] Deprecations for PHP 8.5

2025-07-03 Thread Morgan
On 2025-07-03 07:56, Gina P. Banyard wrote: Hello internals, Some should be non-controversial, others a bit more. If such, they might warrant their own dedicated RFC, or be dropped from the proposal altogether. Best regards, Gina P. Banyard Just skimming and saw > Deprecate using values o

Re: [PHP-DEV] Forced named parameters

2025-05-23 Thread Morgan
On 2025-05-23 13:24, Anton Smirnov wrote: Hi Alwin Please explain the syntax you propose about this part: > That way, you could even make it so that only specific arguments are required to be named because I see only 2 ways to call it:   #[AllArgsAreNamed] function f (/* ... */) and  

Re: [PHP-DEV] Concept: Lightweight error channels

2025-04-30 Thread Morgan
On 2025-04-28 06:06, Larry Garfield wrote: Which is why I think we do want some kind of syntax similar to Rust's ?, so the above could be shortened back to this: function doStuff($id): string raises UserErr { $user = $repo->getUser($id) reraise; // We have a good user. } One thing about

Re: [PHP-DEV] Closure::getCurrent() for recursion

2025-04-01 Thread Morgan
On 2025-04-02 00:14, Ilija Tovilo wrote: On Tue, Apr 1, 2025 at 12:40 PM Tim Düsterhus wrote: If you are at the point where you need mutually recursive closures, perhaps you should just use named functions / an anonymous class. I don't find it useful to “optimize DX” for that case, since self-

Re: [PHP-DEV] Closure::getCurrent() for recursion

2025-04-01 Thread Morgan
On 2025-04-01 22:02, Hans Henrik Bergan wrote: @Morgan $second=function(array $a, callable $first){...} > This is just as effective as it would be for any use()d variable, so why do we have use() again? [Note: in my original mail "$left" should of course have been "$

Re: [PHP-DEV] Closure::getCurrent() for recursion

2025-03-31 Thread Morgan
On 2025-04-01 09:38, Ilija Tovilo wrote: > Hi everyone > > > This is essentially already possible through a by-reference capture. > > $fibonacci = function (int $n) use (&$fibonacci) { ... }; > > This cannot be a by-value capture because by the time the closure is > created and variables are bou

Re: [PHP-DEV] PHP True Async RFC

2025-03-05 Thread Morgan
On 2025-03-05 11:54, Eugene Sidelnyk wrote: > Hi there, > > I would also like to highlight some interesting ideas that I find being useful to consider. > > Recently Bend programming language has been released, and it incorporates a completely different view on the conception of "code", in th

Re: [PHP-DEV] Re: RFC: Marking return values as important (#[\NoDiscard])

2025-02-12 Thread Morgan
On 2025-02-13 00:52, Volker Dusch wrote: b) Naming of the attribute Nobody mentioned this on the list, but before opening a vote we'd like to heard if the attribute name makes sense to you. On this, it could be spelled #[\MustUse], rather than phrase it as a negative.

Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Morgan
On 2025-02-04 17:31, Larry Garfield wrote: However, there is a concern that it wouldn't be self-evident to PHP devs, and the variable binding side should have the extra marker. Ilija has suggested &, as that's what's used for references, which would result in: $b = '12'; if ($arr is ['a' =

Re: [PHP-DEV] Empty subject in match and switch constructions

2025-02-05 Thread Morgan
On 2025-02-05 09:49, Larry Garfield wrote: > Feature-wise, I have to say I'd keep it strict-always, as both our PRs implement it. Yes, that means preg_match() wouldn't be able to slot in transparently. I'm frankly OK with that; hopefully pattern matching can be extended to a better regex syn

Re: [PHP-DEV] PHP 8.4.2 Released

2024-12-19 Thread Morgan
On 2024-12-20 06:46, Calvin Buckley wrote: The PHP development team announces the immediate availability of PHP 8.4.2. This is a bugfix release. All PHP 8.4 users are encouraged to upgrade to this version. For source downloads of PHP 8.4.2 please visit our downloads page. Windows binaries can b

Re: [PHP-DEV] [RFC] Change behaviour of array sort functions to return a copy of the sorted array

2024-10-21 Thread Morgan
On 2024-10-22 00:17, mickmackusa wrote: On Mon, 21 Oct 2024, 18:09 Morgan, <mailto:weedpac...@varteg.nz>> wrote: You can’t use:         $sorted_datasets = array_map(sort(...), $datasets); You want         $sorted_datasets = $datasets;         array_walk($sorted

Re: [PHP-DEV] [RFC] Change behaviour of array sort functions to return a copy of the sorted array

2024-10-21 Thread Morgan
On 2024-10-21 06:42, Gina P. Banyard wrote: Hello internals, I would like to propose a short RFC to make the return value of the sort() and similar functions more useful: https://wiki.php.net/rfc/array-sort-return-array I intend for the discussion to last 2 weeks and then open the vote. Best

Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-17 Thread Morgan
On 2024-09-18 05:43, Jordan LeDoux wrote: The problem I was trying to solve involved lots of things that cannot be represented well by primitive types (which is presumably why they are classes in the first place). Things like Complex Numbers, Matrices, or Money. Money can be converted to a f

Re: [PHP-DEV] [RFC] Static Constructor

2024-08-27 Thread Morgan
On 2024-08-28 09:51, Bilge wrote: On 19/06/2024 19:25, Tim Düsterhus wrote: Hi On 6/19/24 16:03, Erick de Azevedo Lima wrote: I have considered some names, actually. I just chose this one for the implementation because I tried to design it to be as close as possible to the C# implementation an

Re: [PHP-DEV] State of Generics and Collections

2024-08-25 Thread Morgan
To throw one more question into the pot, I'd like to raise the possibility of wanting typedefs. (To use the old C/C++ term, the latter also allows a "type alias" syntax that does much the same thing.) To use an example from the blog post: function f(List> $entries): Map {...} there need not b

Re: [PHP-DEV] [DISCUSSION] C++ Enhancements in Zend API

2024-08-14 Thread Morgan
On 2024-08-14 16:03, Lanre wrote: On Tue, Aug 13, 2024 at 4:28 PM Mike Schinkel Well, there is this: https://media.defense.gov/2023/Dec/06/2003352724/-1/-1/0/THE-CASE-FOR-MEMORY-SAFE-ROADMAPS-TLP-CLEAR.PDF

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-08-02 Thread Morgan
On 2024-08-02 18:34, Mike Schinkel wrote: On Jul 31, 2024, at 5:15 PM, Morgan wrote: Also, providing a dedicated function for an algorithm over and above others that don't get such special treatment inflates use of that algorithm, making it more commonly used. It becomes self-reinfo

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-31 Thread Morgan
On 2024-07-31 13:07, Mike Schinkel wrote: On Jul 30, 2024, at 4:26 PM, Tim Düsterhus wrote: The problem with adding standalone functions for every algorithm is that it would result in a combinatorial explosion of available functions. I commented on this but as it was probably missed in a longe

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-29 Thread Morgan
On 2024-07-29 18:47, Rowan Tommins [IMSoP] wrote: On 29 July 2024 02:19:23 BST, Morgan wrote: At that point you've got \PHP\sha3() instead of hash("sha3-?"), and now you've (a) lost the word "hash" indicator of what's going on, and (b) hidden the choice of

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-28 Thread Morgan
nce? (Solvable in userland.) Or how about a named argument that allowed you to provide a key function to sort on instead of a comparator? (Solvable in userland.) Okay, the first change would break a lot, but an alternate sorted() function that did behave that way could be added. On Jul 27, 202

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-28 Thread Morgan
On 2024-07-28 18:42, Rowan Tommins [IMSoP] wrote: On 27 July 2024 23:14:32 BST, Morgan wrote: Why a SHA2 algorithm? Why not a SHA3 one? How about standalone functions for both, and then when SHA4 comes along (as it inevitably will) another standalone function for one of its variants

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-27 Thread Morgan
On 2024-07-28 00:36, Rowan Tommins [IMSoP] wrote: On 27 July 2024 00:58:17 BST, Morgan wrote: I'm not talking about the MD5 or SHA1 algorithms or whether they should or shouldn't be used. I'm just talking about the functions themselves. md5(), md5_file(), sha1(), and sh

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-26 Thread Morgan
On 2024-07-26 09:34, Rowan Tommins [IMSoP] wrote: On 24/07/2024 23:01, Morgan wrote: And they would still be available as hash("md5") and hash("sha1"); the only reason they're called out as their own distinct functions today is historical inertia. I don

Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4

2024-07-24 Thread Morgan
On 2024-07-24 15:58, Peter Stalman wrote: On Mon, Jul 22, 2024 at 9:06 AM Derick Rethans > wrote: - Deprecate md5(), sha1(), md5_file(), and sha1_file() (just says "large   impact") About 1.2 million. https://github.com/search?q=%28md5+OR+md5_file+OR+sha1+OR

Re: [PHP-DEV] [RFC] Deprecations for PHP 8.4

2024-07-02 Thread Morgan
On 2024-07-02 21:52, Juliette Reinders Folmer wrote: Other than that, I join the previously voiced objections to the deprecation of `uniqid()`, `md5()`, `sha1()`, `md5_file()`, `sha1_file()`. While I acknowledge that these functions _can_ be used inappropriately for security-sensitive code, whic

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-26 Thread Morgan
On 2024-06-27 12:41, Chuck Adams wrote: There’s some difference though     [] is [?’foo’ => $x is string]              // matches, $x === null Except null is not a string. > There’s a precedent with function parameters: > > function foo(string $bar = null) // $bar is string|null > whi

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-26 Thread Morgan
On 2024-06-26 09:58, Rob Landers wrote: On Tue, Jun 25, 2024, at 23:10, Rowan Tommins [IMSoP] wrote: It may be questionable to give meaning to the difference in some of these cases, but different it definitely is. True, but I was mainly referring to what you would do after performing an 'i

Re: [PHP-DEV] [RFC] Deprecations for PHP 8.4

2024-06-26 Thread Morgan
I do not believe it is appropriate to deprecate strtok() without a proper replacement. While I agree that its signature is undesirable, the suggested replacement functions or “just write a parser” are not very pleasant solutions to fill the void it would leave. The stateful functionality it exhib

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-25 Thread Morgan
On 2024-06-26 08:24, Rob Landers wrote: On Tue, Jun 25, 2024, at 20:23, Ilija Tovilo wrote: If null array values were indeed unobservable, then [] would be === to [null] (or at least ==), and a foreach over [null] would result in 0 iterations. But neither of those are the case. I think there

Re: [PHP-DEV] Add bcdivmod() to BCMath

2024-06-25 Thread Morgan
On 2024-06-25 21:11, Saki Takamachi wrote: Hi internals, I've been working on improving performance of BCMath lately, and I found that I can get the div and mod in one calculation. This is obviously faster than calculating it twice separately. Do you think there's a demand for this feature?

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-20 Thread Morgan
On 2024-06-21 05:38, Larry Garfield wrote: Hello, peoples. To that end, we're looking for *very high level* feedback on this RFC: https://wiki.php.net/rfc/pattern-matching As I started reading I starting thinking of "whatabouts" based on my experience with pattern matching in other language

Re: [PHP-DEV] Bumping minimum PostgreSQL version to 10.0

2024-06-17 Thread Morgan
On 2024-06-18 05:25, Matteo Beccati wrote: Hi, Sure, you need to have the same version of libpq that PHP was built with. But nothing prevents your script using pdo_pgsql or ext/pgsql to connect to another version of postgres running either on the same machine or a different one. Right; t

Re: [PHP-DEV] [RFC] Invoke __callStatic when non-static public methods are called statically

2024-03-29 Thread Morgan
On 2024-03-30 13:06, 하늘아부지 wrote: Even currently, `__callStatic` is called in cases of non-static methods that are not public methods. `__callStatic` already acts as a rule-breaker. I think the problem here is a confusion based on the idea that there is necessarily some direct corresponde

Re: [PHP-DEV] [RFC] Release cycle update, take #2

2024-03-21 Thread Morgan
On 2024-03-22 08:19, Jim Winstead wrote: On Thu, Mar 21, 2024, at 10:54 AM, Derick Rethans wrote: The RFC is at https://wiki.php.net/rfc/release_cycle_update Could this RFC also be a good time to clarify what sort of BC changes are actually allowed in major and minor releases, or should we s

Re: [PHP-DEV] 回复: [PHP-DEV] [rfc:direct-execution-opcode] Whether need __FILE__ the value of the file to replace the compiled opcode file path

2020-12-10 Thread Morgan Breden
I'm not 100% certain but I believe what chopins is proposing is the ability to require()/include() files generated by opcache, without including the .php file. The reference to __FILE__ is I believe a warning to using relative paths, since the compiled opcode file would be in a different location?

Re: [PHP-DEV] [RFC][DISCUSSION] Change var_export() array syntax to use short hand arrays

2020-03-30 Thread Morgan Breden
> I have already told you that the output of this function was never meant > for human consumption. > It was originally added to aid in caching of larger complicated data > structure through the likes of apc's opcode cache. It is sometimes used for human consumption now, though. For example, my t

Re: [PHP-DEV] Changing fundamental language behaviors

2019-09-12 Thread Morgan Breden
> While I realize my email is unpleasant for many to read, it's in the context of an RFC that attempts to do something that is strictly inappropriate and out of the question. Stating the fact, that the RFC process was never meant to allow this to be done, is a statement of fact. [...] > There wo

Re: [PHP-DEV] Parameter skipping

2019-04-07 Thread Morgan Breden
>In order to use named parameters, somebody needs to have declared what those names are, and made them a stable API. If they're automatically supported on existing functions, the author might not intend them to be used, or even realise they can, so not keep them stable (I tend to think of parameter

Re: [PHP-DEV] Parameter skipping

2019-04-06 Thread Morgan Breden
The problem I see with this approach is that a keyword for skipping parameters would really just be a stopgap solution until something like Named Parameters can be added. Is it really appropriate to add a feature that only serves a temporary purpose? On Sat, Apr 6, 2019 at 5:15 PM Craig Duncan w

Re: [PHP-DEV] Deprecate short_open_tag ini directive? PHP internals

2019-03-15 Thread Morgan Breden
>If you want to go further, dropping the PHP tag altogether would be nice, since it would prevent context switching between PHP/HTML/JS/whatever. >That would force Wordpress to update their whole code base. >:{)> I wholeheartedly support this initiative but I do not see it going through without a

[PHP-DEV] VCS Account Request: mgage

2015-06-19 Thread Gage Morgan
Alexandre (buhlerax) and I are going to rewrite PHP-GTK from scratch. In order for me to do my part, I will need to be able to access the Git repository. I am currently active in the php-gtk-dev mailing list. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http:

Re: [PHP-DEV] Re: Moving to an AST-based parsing/compilation process

2012-09-06 Thread Morgan L. Owens
On 2012-09-06 10:39, Stas Malyshev wrote: Hi! ... and no real benefit for average PHP user. Well, apart from perhaps leaving them with a simpler language that doesn't have the inconsistencies and corner cases that currently exist (and documented ad nauseum) not because of any design decision

[PHP-DEV] Re: Moving to an AST-based parsing/compilation process

2012-09-05 Thread Morgan L. Owens
On 2012-09-05 07:57, Nikita Popov wrote: Hey folks! Some people asked me what the advantages of using an AST-based parsing/compilation process are, so I put together a few quick notes in an RFC: https://wiki.php.net/rfc/ast_based_parsing_compilation_process It would be nice to get a few commen

Re: [PHP-DEV] $obj->attr::method() is not allowed

2012-09-04 Thread Morgan L. Owens
uot;Hi")=1) - what's so strange about it? Ah, so "r_variable" means "non-writable expression". Makes perfect sense. Incidentally, "r_variable" expands to "variable", then to "base_variable_with_function_calls", and _then_ to "function_call". Then again, $a->b->c is _also_ an "r_variable", so does that mean I can't write "$a->b->c = 1;"? Morgan L. Owens -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: [PHP-DEV] $obj->attr::method() is not allowed

2012-09-03 Thread Morgan L. Owens
t;);' (27 nodes, including "r_variable") and '$a->b->c' (26 nodes, including "base_variable_with_function_calls")). Morgan L. Owens -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: [PHP-DEV] Support negative indexes for arrays and strings

2012-09-01 Thread Morgan L. Owens
On 2012-09-01 20:17, Kris Craig wrote: This discussion kinda reminds me of some of the debates over AUTO_INCREMENT behavior in the MySQL community. Specifically, they end up having to tackle the same funcamental, conceptual dilemma: If I assign/insert/whatever an arbitrary value to a container

Re: Re: [PHP-DEV] Support negative indexes for arrays and strings

2012-09-01 Thread Morgan L. Owens
On 2012-09-01 21:23, Sherif Ramadan wrote: $array[0] = 'first element'; $array[9] = 'second element'; var_dump($array); /* array(2) { [9]=> string(14) "second element" [0]=> string(13) "first element" } */ Just correcting this as it was a copy/paste fail... The above code w

Re: Re: [PHP-DEV] [VOTE] Generators

2012-08-30 Thread Morgan L. Owens
On 2012-08-30 20:39, Derick Rethans wrote: On Wed, 29 Aug 2012, Gustavo Lopes wrote: On Wed, 29 Aug 2012 22:10:52 +0200, Derick Rethans wrote: Nothing in the core throws an exception, why would this?! This is not accurate. All the iterators throw exceptions on similar situations. Generato

Re: Re: [PHP-DEV] [RFC] Generators

2012-08-23 Thread Morgan L. Owens
On 2012-08-23 00:10, Lester Caine wrote: Then the next example is an 'iterator' ... which you are right ... I do not appreciate either, because they require an insane amount of overhead for what would be easy if the first example had been done right! I did try them, in the past, but the overhead

Re: Re: [PHP-DEV] [RFC] Generators

2012-08-23 Thread Morgan L. Owens
On 2012-08-23 02:03, Lester Caine wrote: I accept your point about not caring about how the data was created, but on the other side, if the data creation is handling a lot more data than the consumer needs there is an amount of processing time that is wasted. The quick way of doing something doe

Re: Re: [PHP-DEV] Official Userland Library (was: removing an item from an array)

2012-08-22 Thread Morgan L. Owens
On 2012-08-22 19:45, Lester Caine wrote: Personally I'm looking for a 'Official Userland Library' that provides EXAMPLES of how to do operations rather than yet another downloadable library. This is also the sort of thing I would like to see. The examples within the manual are written for expo

Re: Re: [PHP-DEV] Official Userland Library (was: removing an item from an array)

2012-08-22 Thread Morgan L. Owens
On 2012-08-22 19:45, Lester Caine wrote: Personally I'm looking for a 'Official Userland Library' that provides EXAMPLES of how to do operations rather than yet another downloadable library. This is also the sort of thing I would like to see. The examples within the manual are written for expo

Re: Re: [PHP-DEV] [RFC] Generators

2012-08-21 Thread Morgan L. Owens
Oh, yes... On 2012-08-22 04:35, Lester Caine wrote: and doesn't seem to provide any outstanding advantages? As I wrote in an earlier post: On 2012-08-09 15:30, Morgan L. Owens wrote: > I for one am lazy, and would much prefer writing: > function append_iterator($fir

Re: Re: [PHP-DEV] [RFC] Generators

2012-08-21 Thread Morgan L. Owens
On 2012-08-22 04:35, Lester Caine wrote: John LeSueur wrote: Again, the case you've cited is probably not a case where generators give much advantage. But anytime the logic to produce some data becomes more complicated (Imagine that you needed to skip some of the lines in the .csv file based on

Re: Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Morgan L. Owens
On 2012-08-21 01:10, Lester Caine wrote: For the third one ... I'm still waiting for some clarification on how yield is SUPPOSED to work anyway? If you are using a 'generator' to return a sequence of data elements, then just what does happen between each call to the generator ... DOES the genera

Re: Re: [PHP-DEV] removing an item from an array

2012-08-18 Thread Morgan L. Owens
On 2012-08-19 04:08, Levi Morrison wrote: On Sat, Aug 18, 2012 at 12:42 AM, Alexey Zakhlestin wrote: On 16.08.2012, at 0:18, Rasmus Schultz wrote: How come there is no straight-foward obvious way to simply remove a given value from an array? Well, this sounds like a reason for creating Sp

Re: [PHP-DEV] re: removing an item from an array

2012-08-18 Thread Morgan L. Owens
On 2012-08-19 10:25, Andrew Faulds wrote: On 18/08/12 14:52, Morgan L. Owens wrote: How simple is it? Does it: 1) Remove one occurrence of the element (presumably the first) or all? 2) Reindex the array (as someone else argued was necessary to make it "properly indexed" afterwards)

[PHP-DEV] re: removing an item from an array

2012-08-18 Thread Morgan L. Owens
Rasmus Schultz wrote: > I disagree - this is (or should be) a simple, atomic operation... > yet, you've got a function-call, an intermediary variable, a boolean > test, and an unset statement repeating the name of the array you're > deleting from. > > This should be a simple statement or function

Re: [PHP-DEV] removing an item from an array

2012-08-15 Thread Morgan L. Owens
On 2012-08-16 17:55, Sherif Ramadan wrote: > That doesn't make any sense. What if the values are present more than > once? array_flip will cause the keys to be overwritten. > Not to mention converting all of the array's elements to strings and/or integers. Now your array is something complete

Re: Re: [PHP-DEV] removing an item from an array

2012-08-15 Thread Morgan L. Owens
On 2012-08-16 08:27, Nikita Popov wrote: On Wed, Aug 15, 2012 at 10:22 PM, Stas Malyshev wrote: Hi! How come there is no straight-foward obvious way to simply remove a given value from an array? Just look at the number of horrible ways people solve this obvious problem: I see: if(($key = ar

Re: [PHP-DEV] Generators in PHP

2012-08-09 Thread Morgan L. Owens
hakre wrote: >> Also, currently yield looks very similar to return and I think this >> is a nice thing as it is similar semantically. yield($foo) would >> give it different semantics, imho. > > I love this point a lot. Return is very common and yield is some > kind of return. > I agree also: yiel

Re: [PHP-DEV] Generators in PHP

2012-08-09 Thread Morgan L. Owens
Mike Ford wrote: > > The signposting needn't even be as in-your-face as a generator > keyword (either instead of or in addition to function): I could get > behind a variation such as: > > function f($x, $y) yields { ... yield $z; ... } > > Or even (stretching a bit to re-use an existing keyword!):

Re: Re: [PHP-DEV] Generators in PHP

2012-08-08 Thread Morgan L. Owens
On 2012-08-09 08:42, Nikita Popov wrote: Without parenthesis their behavior in array definitions and nested yields is ambigous: array(yield $key => $value) // can be either array((yield $key) => $value) // or array((yield $key => $value)) yield yield $key => $value; // can be either yield (yie

Re: Re: [PHP-DEV] Re: Generators in PHP

2012-08-08 Thread Morgan L. Owens
On 2012-08-09 14:25, Larry Garfield wrote: On 07/27/2012 07:23 AM, Lester Caine wrote: Nikita - I am looking for a well reasoned argument as to why generator has to be added at all! 'Just because it can be' is not a valid argument, but perhaps you could add to the RFC the performance implicatio

Re: [PHP-DEV] PHP 5.x Documentend End Of Life Dates

2012-08-02 Thread Morgan L. Owens
On 2012-08-02 20:42, Peter Cowburn wrote: On 2 August 2012 09:36, Morgan L. Owens wrote: Just as each release announcement dated with detailed kept on a distinct page (linked in that list), all that's needed there is a date when support ended, with (any available) information on wha

Re: Re: [PHP-DEV] PHP 5.x Documentend End Of Life Dates

2012-08-02 Thread Morgan L. Owens
On 2012-08-02 19:56, Peter Cowburn wrote: On 2 August 2012 07:35, Adam Harvey wrote: Thoughts? (Do we even want to auto-fill this from $OLDRELEASES, or would we rather have a manual array?) Specific notes on vulnerabilities to add to branches? Better versions of the copy in the initial blurb?

Re: [PHP-DEV] Re: [RFC] foreach_variable supporting T_LIST

2012-07-21 Thread Morgan L. Owens
On 2012-07-21 12:19, Stas Malyshev wrote: Hi! So when I have a function that has a two- or multi-part result then - instead of having one part as the return value and the others by reference - in Python I'd return a tuple. PHP functions can return arrays and some do - e.g. pathinfo(). But not

Re: Re: [PHP-DEV] Re: [RFC] foreach_variable supporting T_LIST

2012-07-20 Thread Morgan L. Owens
On 2012-07-21 10:28, Stas Malyshev wrote: Hi! If I understand this correctly, this is like what Python let's you do with tuples. It's handy for getting vector components, hostnames and port numbers, etc. (I apologise for the Python comparison, it is just the language where I usually encounter t

Re: Re: [PHP-DEV] [proposal + pull request] Replace logo GUIDs with data URIs

2012-07-15 Thread Morgan L. Owens
On 2012-07-15 09:48, Stas Malyshev wrote: Hi! And I actually know of websites using the functions to display the logo.. Is there some way we could provide a BC function for it somehow? Maybe rather then removing the functions, make then return the data uris? Having the functions to get the im

Re: Re: [PHP-DEV] 6.0 And Moving Forward

2012-07-14 Thread Morgan L. Owens
On 2012-07-14 04:12, jpauli wrote: On Fri, Jul 13, 2012 at 5:33 PM, Anthony Ferrara wrote: 4. Rewrite the entire parser completely. I keep hearing about how bad PHP's parser is, and how it's growing out of control. Perhaps this is a good time to rewrite it (perhaps changing semantics slightly)

Re: Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-27 Thread Morgan L. Owens
On 2012-06-26 07:22, Ben Ramsey wrote: However, in Prototype.js and Underscore.js, pluck seems behave more like array_map() in PHP: http://api.prototypejs.org/language/Enumerable/prototype/pluck/ http://documentcloud.github.com/underscore/#pluck Nevertheless, it would technically have the same

Re: Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-25 Thread Morgan L. Owens
On 2012-06-25 04:19, Ralph Schindler wrote: The term 'column' makes a lot of sense for PDO working with database columns, but there is no concept of a 'column' in the array structure or PHP as a whole, outside of database related functions. In the case of this addition, I do indeed like array_p

Re: Re: [PHP-DEV] concatenation operator

2012-06-14 Thread Morgan L. Owens
On 2012-06-15 04:00, Ángel González wrote: On 13/06/12 05:26, Morgan L. Owens wrote: After reading the performance improvements RFC about interned strings, and its passing mention of a "special data structure (e.g. zend_string) instead of char*", I've been thinking a little bit

Re: Re: [PHP-DEV] concatenation operator

2012-06-12 Thread Morgan L. Owens
On 2012-06-08 08:18, Johannes Schlüter wrote: On Thu, 2012-06-07 at 12:53 -0700, Adi Mutu wrote: Ok Johannes, thanks for the answer. I'll try to look deeper. I basically just wanted to know what happens when you concatenate two strings? what emalloc/efree happens. This depends. As always. As s

[PHP-DEV] CVS Account Request: pete_morgan

2005-06-05 Thread Peter 'Mash&#x27; Morgan
Maintaining the smarty.php.net documentation. Reffered by nlopess at php.net -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Scheme identification in stream wrappers: (Partial) disambiguation?

2005-04-10 Thread Morgan L. Owens
Wez Furlong wrote: On Apr 9, 2005 6:07 AM, Morgan L. Owens <[EMAIL PROTECTED]> wrote: > Really? > Can you guarantee that your user-space code to sniff out the path is > going to work 100% of the time on all platforms? > Who said user-space? I meant in the implementation of fo

Re: [PHP-DEV] Scheme identification in stream wrappers: (Partial) disambiguation?

2005-04-09 Thread Morgan L. Owens
Wez Furlong wrote: > > Really? > Can you guarantee that your user-space code to sniff out the path is > going to work 100% of the time on all platforms? > Who said user-space? I meant in the implementation of fopen(). > > It's not just 1 letter. There are 3 letter special device names too. > Natch

Re: [PHP-DEV] Scheme identification in stream wrappers: (Partial) disambiguation?

2005-04-06 Thread Morgan L. Owens
If there's something that looks like a scheme (i.e., a well-formed sequence of characters followed by ':'), see if it's registered; if it is, the appropriate wrapper should be used. Otherwise, on platforms where ':' has significance, try it again as a file path. Otherwise, it fails due t

[PHP-DEV] Scheme identification in stream wrappers

2005-04-05 Thread Morgan L. Owens
It was suggested I post this here. In PHP, the character sequence "://" separates the protocol name from the protocol-specific part of a stream name. Clearly, the intention is that these stream names are URLs (i.e., URIs that actually provide a location for the identified resource). However, the