Re: [PHP-DEV] Re: Suggestion: Make all PCRE functions return *character* offsets,rather than *byte* offsets if the modifier `u` (PCRE_UTF8) is given

2020-10-02 Thread Colin O';Dell
ike a natural extension. And while it may not be the most optimal or common way of working with strings, I do believe there are some valid use cases for it. If placing this within PCRE violates some principles of the library then I'd be okay placing similar functionality elsewhere. -- Colin O'Dell colinod...@gmail.com

Re: [PHP-DEV] substr with null length

2019-10-21 Thread Colin O';Dell
e: https://github.com/php/php-src/pull/4840 I'll also take a look at those other functions and see if I can assist with adjusting those other instances as well. Cheers, Colin O'Dell colinod...@gmail.com

[PHP-DEV] substr with null length

2019-10-21 Thread Colin O';Dell
ine) - $start)); } } Are there any historical reasons preventing substr() from accepting a null $length like mb_substr() does? I'd be happy to write the RFC and take a stab at the implementation if there's interest in such a change. Regards, Colin O'Dell colinod...@gmail.com

[PHP-DEV] [RFC][Withdrawn] array_change_keys()

2018-11-27 Thread Colin O';Dell
drawing the RFC. I would like to thank Jeremy for his help creating the proposed implementation and everyone who provided candid feedback on this. Cheers, Colin O'Dell colinod...@gmail.com -- Colin O'Dell colinod...@gmail.com https://www.colinodell.com

Re: [PHP-DEV] Wiki account gone missing?

2018-09-11 Thread Colin O';Dell
y try a few more times, attempt the other password reset if needed, and reach out to the other list if all else fails. Thanks again! Colin -- Colin O'Dell colinod...@gmail.com https://www.colinodell.com

[PHP-DEV] Wiki account gone missing?

2018-09-11 Thread Colin O';Dell
the right direction :) Thanks! Colin O'Dell colinod...@gmail.com / colinod...@php.net -- Colin O'Dell colinod...@gmail.com https://www.colinodell.com

Re: [PHP-DEV] Re:[PHP-DEV] [VOTE] array_key_first(), array_key_last(), array_value_first(),array_value_last()

2018-07-11 Thread Colin O';Dell
d changes should at least contain a summary of those points and counter-points, but if feels like those are being ignored here. So while I do understand the value of such a feature, I'd much rather delay its implementation than to rush it along with potential issues and no strong consensu

[PHP-DEV] [RFC] Enable strict_types checking for curl_setopt()

2017-04-22 Thread Colin O';Dell
. The full details of the proposal, including the proposed patch, can be found here: https://wiki.php.net/rfc/curl_setopt_strict_types Huge thanks to Sara Golemon for the idea and creating the patch! Cheers, Colin O'Dell colinod...@gmail.com

Re: [PHP-DEV] [RFC][VOTE] array_change_keys

2017-01-10 Thread Colin O';Dell
Hearing no objections, voting is now halted and the RFC is back to "Under Discussion". Cheers, Colin On Mon, Jan 9, 2017 at 2:40 PM Colin O'Dell wrote: > Due to concerns that have not been adequately addressed during the > discussion period, and mailing list issues which m

[PHP-DEV] [RFC][VOTE] array_change_keys

2017-01-08 Thread Colin O';Dell
discussion thread: https://www.reddit.com/r/PHP/comments/4ll1hg/rfc_array_change_keys/ The implementation is also on 3v4l.org should you wish to test it out. Regards, Colin O'Dell

Re: [PHP-DEV] [RFC Discussion] array_change_keys()

2016-05-31 Thread Colin O';Dell
array_change_keys() has been added to 3v4l.org if anyone would like to try it online. Simple example: https://3v4l.org/vehTo/rfc#tabs

Re: [PHP-DEV] [RFC Discussion] array_change_keys()

2016-05-30 Thread Colin O';Dell
> > Ported to https://github.com/Ocramius/array_change_keys-benchmark, thanks! > I've updated the RFC's benchmarks based on your tool. They confirm that array_change_keys is faster than array_combine but slower than foreach (in most cases). Thanks for helping with this! > No, but I really don'

Re: [PHP-DEV] [RFC Discussion] array_change_keys()

2016-05-29 Thread Colin O';Dell
> > Yes there is: > array_combine( > array_map($someFunc, array_keys($arr), $arr), > $arr > ) > This way $someFunc gets key as first argument and value as second. (you > might use array_values($arr) instead of $arr but I’m not sure it’s worth it) > Good call! I have updated the RF

Re: [PHP-DEV] [RFC Discussion] array_change_keys()

2016-05-29 Thread Colin O';Dell
Marco, > 1. could you also provide the code for the benchmarks? I'd gladly measure > them with an accurate tool > Yeah that would be great! Here's the benchmark I was using: https://gist.github.com/colinodell/872c1f0c92351af687347c0c8be4f253 > 2. do we really need another array function tha

Re: [PHP-DEV] [RFC Discussion] array_change_keys()

2016-05-29 Thread Colin O';Dell
> > The RFC states "The new array returned by this function will contain the > same values in the same order, but with potentially different keys." > > But further down it states, that on multiple times the same key the last > one will "win". So in that special case it's **not** the same array > an

Re: [PHP-DEV] [RFC Discussion] array_change_keys()

2016-05-29 Thread Colin O';Dell
> > shouldn't it be possible to return null as new key? That way you say: > Use the next free integer index. > > Not sure if returning null is wanted (as it could hide errors in the > callback) or needed in some real world use cases. But it would be more > in sync with $a[] = ... > That's an inter

Re: [PHP-DEV] [RFC Discussion] array_change_keys()

2016-05-29 Thread Colin O';Dell
> > Does this RFC really require a 2/3 majority? I mean, it does not change > the syntax or alters anything. It is just about a single new function? > > https://wiki.php.net/rfc/voting#required_majority > Good catch! You're right, this RFC only adds a single new function and does not modify the s

[PHP-DEV] [RFC Discussion] array_change_keys()

2016-05-29 Thread Colin O';Dell
s. I'd be happy to answer any questions you might have. Regards, Colin O'Dell

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

2016-04-21 Thread Colin O';Dell
> > $r = new ReflectionClass('ORM\Entity'); > var_dump($r->getAttributes()); > Oops, that should've been: $r = new ReflectionClass('Foo'); var_dump($r->getAttributes()); Colin

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

2016-04-21 Thread Colin O';Dell
> A more robust alternative would be something along the same lines that > Doctrine uses: Make annotations actual classes. Just spitballing here - what if both approaches were supported, but class-based annotations were prefixed with a special character (perhaps "@") to differentiate them? For ex

Re: [PHP-DEV] UUID

2016-04-12 Thread Colin O';Dell
> > I would prefer not to refer to random to avoid any confusion with the > recent added random function. As uuid is not crypto safe and is not aimed > to. Users will then hopefully not think about using instead of the random > api. > > Also uuid alone may be a problem (bc?) It sounds like a logica

Re: [PHP-DEV] UUID

2016-04-12 Thread Colin O';Dell
On Tue, Apr 12, 2016 at 2:09 AM Sebastian Bergmann wrote: > In PHP 7.0 we introduced random_bytes() which wraps Linux's getrandom(2) > as well as Windows's CryptGenRandom() and uses /dev/urandom as a fallback. > > I think it would be great if we added a function that wraps > /proc/sys/kernel/rand

Re: [PHP-DEV] [VOTE] var deprecation

2016-03-31 Thread Colin O';Dell
icipated in the discussions, and a special thanks to Thomas Punt for helping to create the proposed patch. Regards, Colin O'Dell On Fri, Mar 25, 2016 at 7:14 AM Christoph Becker wrote: > On 25.03.2016 at 08:12, Dmitry Stogov wrote: > > > Java is going to add "var" (http://ope

Re: [PHP-DEV] Add spaceship assignment operator

2016-03-24 Thread Colin O';Dell
You're right! Good call :) On Thu, Mar 24, 2016 at 3:05 PM Sara Golemon wrote: > On Thu, Mar 24, 2016 at 11:50 AM, Colin O'Dell > wrote: > > Would your proposal also allow ! to work? > > > I think you means !===, which is "not-identical assignment&qu

Re: [PHP-DEV] Add spaceship assignment operator

2016-03-24 Thread Colin O';Dell
Would your proposal also allow ! to work? Colin

[PHP-DEV] Re: [VOTE] var deprecation

2016-03-24 Thread Colin O';Dell
courage everyone to read the RFC and cast your vote towards whichever > option you feel is the best for the language and the community. > > Regards, > > Colin O'Dell >

Re: [PHP-DEV] [RFC][Discussion] Precise session data management

2016-03-24 Thread Colin O';Dell
I'm +1 for splitting it into smaller chunks. I didn't fully comprehend the impact of some aspects of the RFC and therefore didn't feel it was appropriate for me to cast a vote either way. However, if the different pieces were broken out into smaller, more-focused RFCs I would likely vote for most

[PHP-DEV] [VOTE] var deprecation

2016-03-24 Thread Colin O';Dell
and will end in one week. You can find the full RFC (including the proposed patch and automatic upgrade tool) here: https://wiki.php.net/rfc/var_deprecation I encourage everyone to read the RFC and cast your vote towards whichever option you feel is the best for the language and the community. Regards, Colin O'Dell

Re: [PHP-DEV] RFC about automatic template escaping

2016-03-22 Thread Colin O';Dell
Daniel, This is a really interesting idea! However, I'm unsure whether it's wise to bring this feature in without having the community test and validate it first. Would it be possible to release this as an extension first so we can gauge its stability and desirability in "the real world"? As fa

Re: [PHP-DEV] php 7 bug in substr_replace function

2016-03-15 Thread Colin O';Dell
Hi Pascal, The bug tracker can be found here: https://bugs.php.net/ You might also want to include this link in your bug report - it shows the results of your test across multiple versions of PHP, thus confirming the behavior: https://3v4l.org/bPOK3 Cheers, Colin

Re: [PHP-DEV] [RFC Discussion] "var" Deprecation

2016-03-14 Thread Colin O';Dell
> > Forcing people to specify a visibility for properties and not for methods > would add yet another inconsistency in the language. > That's a really good point. However, I think we currently have a different inconsistency: declaring functions without explicit visibility is possible without need

Re: [PHP-DEV] [RFC Discussion] "var" Deprecation

2016-03-11 Thread Colin O';Dell
> > I'm still on the fence about this, but here's a patch for it: > https://github.com/php/php-src/compare/master...tpunt:deprecate-var Thank you so much Thomas! I have added your patch to the RFC. I really appreciate you taking the time to implement this. Regards, Colin

[PHP-DEV] Re: [RFC Discussion] "var" Deprecation

2016-03-10 Thread Colin O';Dell
My apologies, I posted the wrong discussion link. Here's the correct one: http://markmail.org/message/wn3ykdwgplfctho7 Colin On Thu, Mar 10, 2016 at 12:14 PM Colin O'Dell wrote: > Hello all, > > I have completed my initial draft of the RFC to deprecate "var"

[PHP-DEV] [RFC Discussion] "var" Deprecation

2016-03-10 Thread Colin O';Dell
hp.net/rfc/mailing_list_discussion Regards, Colin O'Dell

Re: [PHP-DEV] [RFC Proposal] var keyword deprecation/removal

2016-03-03 Thread Colin O';Dell
d you please provide an example where 'var' is not replaceable by 'public'? Thanks for your feedback! Colin O'Dell

Re: [PHP-DEV] Re: [RFC Proposal] var keyword deprecation/removal

2016-02-18 Thread Colin O';Dell
> > By the time of 8.0 nothing would be different from today. 8.0 is not > some magic number by which old code ceases to exist. > The usage of "var" may continue to decline as folks increasingly adopt the newer visibility keywords. Perhaps it's too early to make this decision and this discussion

Re: [PHP-DEV] Re: [RFC Proposal] var keyword deprecation/removal

2016-02-18 Thread Colin O';Dell
> > It would have to be done in 8.0, since removing it would constitute a BC > break. > Thanks for clarifying that Tom! Makes sense to me. > It's worth noting that there were better reasons for deprecating PHP > 4-style constructors over the simple redundancy argument. Specifically, > there was

Re: [PHP-DEV] Re: [RFC Proposal] var keyword deprecation/removal

2016-02-18 Thread Colin O';Dell
> > I think it's a drop in the bucket compare to new features we're adding > plenty of on every version. These make the language a lot more complex > than var being an alias to public (not even different syntax). > Very true. I'm not proposing this because it's a great new feature. But has this l

Re: [PHP-DEV] Re: [RFC Proposal] var keyword deprecation/removal

2016-02-18 Thread Colin O';Dell
> Though if we do get rid of the var syntax, I'd like it if we kept the > reserved word, because it still might be useful in future for typed > variables or different variable scoping. Good idea Andrea! Thanks for that suggestion. I do have a general question about these types of changes: if the

Re: [PHP-DEV] [RFC Proposal] var keyword deprecation/removal

2016-02-18 Thread Colin O';Dell
low and the upgrade path is so simple, I don't think its a bad idea. Colin On Thu, Feb 18, 2016 at 3:25 PM Walter Parker wrote: > On Thu, Feb 18, 2016 at 11:30 AM, Sebastian Bergmann > wrote: > > > On 02/18/2016 02:10 PM, Colin O'Dell wrote: > > > >> I

[PHP-DEV] [RFC Proposal] var keyword deprecation/removal

2016-02-18 Thread Colin O';Dell
le constructors in favor of the PHP 5 __construct() method. I'd like to propose doing the same for the "var" keyword - deprecate it in PHP 7.1 and remove it in a future version (7.2 or 8.0?) I'd appreciate any thoughts or feedback you may have, especially if you have any objections to me creating an RFC for this proposal. Best regards, Colin O'Dell