Re: [PHP-DEV] UNKNOW:0, what is it?

2013-06-26 Thread Laruence
On Thu, Jun 27, 2013 at 12:47 AM, Ivan Enderlin @ Hoa wrote: > > On 26/06/13 18:30, Johannes Schlüter wrote: >> >> On Wed, 2013-06-26 at 18:21 +0200, Ivan Enderlin @ Hoa wrote: >>> >>> On 26/06/13 18:19, Johannes Schlüter wrote: On Wed, 2013-06-26 at 18:05 +0200, Ivan Enderlin @ Hoa wrot

Re: [PHP-DEV] Re: hex2bin: E_WARNING is too much for odd string?

2013-06-26 Thread Yasuo Ohgaki
Hi Sherif, I would like to have consistent behavior at least within a function. 2013/6/27 Sherif Ramadan > I thought you wanted to add an extra error for malformed hex, which I > would have been fine with, but removing the error entirely? The error is > useful. It informs the user that they may

Re: [PHP-DEV] Re: hex2bin: E_WARNING is too much for odd string?

2013-06-26 Thread Sherif Ramadan
On Wed, Jun 26, 2013 at 9:05 PM, Yasuo Ohgaki wrote: > Hi all, > > I've sent pull request for PHP-5.5 branch. > https://github.com/php/php-src/pull/369 > > It's simple 1 liner removes E_WARNING for invalid length. > > Are there any objections? > Yes, I object to removing the error in the same br

[PHP-DEV] ENT_ALL or similar option for htmlspecialchars[_decode]?

2013-06-26 Thread Kris Craig
I just noticed that htmlspecialchars_decode doesn't convert entities like and . Is there a bitmask I'm missing or are those simply not supported right now? If the latter, any thoughts on adding something along the lines of ENT_ALL to convert all valid entities from/to their respective characte

[PHP-DEV] Re: hex2bin: E_WARNING is too much for odd string?

2013-06-26 Thread Yasuo Ohgaki
Hi all, I've sent pull request for PHP-5.5 branch. https://github.com/php/php-src/pull/369 It's simple 1 liner removes E_WARNING for invalid length. Are there any objections? If not I'll merge it to PHP-5.5 and master, then update docs. -- Yasuo Ohgaki yohg...@ohgaki.net 2013/6/27 Yasuo Ohga

Re: [PHP-DEV] Session Id Collisions

2013-06-26 Thread Yasuo Ohgaki
Hi, Sorry for the long delay, I've sent pull requests https://github.com/php/php-src/pull/368 https://github.com/php/php-src/pull/367 https://github.com/php/php-src/pull/366 Thank you for your time. -- Yasuo Ohgaki yohg...@ohgaki.net 2012/12/24 Yasuo Ohgaki > Hi stats and others, > > Sorry

Re: [PHP-DEV] Who's incharge of github pull requests?

2013-06-26 Thread Felipe Pena
2013/6/26 Lior Kaplan : > Hi Felipe, > > Indeed I saw more responsiveness for the pull requests (mine and others), > thanks. > > The question was about the process of reviewing these requests. > 1. Do we have someone in charge (making sure they pass some minimum > requirements) or this is done spor

Re: [PHP-DEV] hex2bin: E_WARNING is too much for odd string?

2013-06-26 Thread Yasuo Ohgaki
Hi Kalle, Thank you for notifying E_ERROR/E_WARNING mistake. 2013/6/27 Kalle Sommer Nielsen > We already fixed a few of those in the past, I believe when 5.3 > was shipped, we had pretty much killed all of those along when the new > parameter parsing API was being standardized. > hex2bin() is

Re: [PHP-DEV] hex2bin: E_WARNING is too much for odd string?

2013-06-26 Thread Yasuo Ohgaki
2013/6/27 Kalle Sommer Nielsen > > 2013/6/26 Yasuo Ohgaki : > > PHP 5.4: Keep current behavior > > PHP 5.4: Riase E_ERROR and return FALSE for invalid length. > > PHP 5.5: Remove E_ERROR. > > Never ever will we raise an E_ERROR. E_ERROR means that we left the > Oops. I meant E_WARNING which is c

Re: [PHP-DEV] hex2bin: E_WARNING is too much for odd string?

2013-06-26 Thread Kalle Sommer Nielsen
Hi 2013/6/26 Yasuo Ohgaki : > PHP 5.4: Keep current behavior > PHP 5.4: Riase E_ERROR and return FALSE for invalid length. > PHP 5.5: Remove E_ERROR. Never ever will we raise an E_ERROR. E_ERROR means that we left the Engine in a state from which we cannot recover from, standard library function

Re: [PHP-DEV] hex2bin: E_WARNING is too much for odd string?

2013-06-26 Thread Yasuo Ohgaki
Hi Nikita, 2013/6/27 Nikita Popov > Why is it easier? If you pass an odd length string to hex2bin you have > malformed input, which is usually a bug on the programmers side. Not having > a warning would make the issue harder to debug. It's good to have uniformed error handling. Therefore, E_WA

Re: [PHP-DEV] hex2bin: E_WARNING is too much for odd string?

2013-06-26 Thread Nikita Popov
On Wed, Jun 26, 2013 at 9:21 PM, Yasuo Ohgaki wrote: > Hi all, > > hex2bin raises E_WARNING for odd length hex strings from PHP 5.4.1. > http://jp2.php.net/manual/en/function.hex2bin.php > However, just returning FALSE is easier for programmers. > Why is it easier? If you pass an odd length stri

[PHP-DEV] Re: hex2bin: E_WARNING is too much for odd string?

2013-06-26 Thread Yasuo Ohgaki
Typo 2013/6/27 Yasuo Ohgaki > PHP 5.4: Keep current behavior > PHP 5.4: Riase E_ERROR and return FALSE for invalid length. > PHP 5.5: Remove E_ERROR > PHP 5.4: Keep current behavior PHP 5.5: Riase E_ERROR and return FALSE for invalid length. PHP 5.6: Remove E_ERROR -- Yasuo Ohgaki yohg...@

[PHP-DEV] hex2bin: E_WARNING is too much for odd string?

2013-06-26 Thread Yasuo Ohgaki
Hi all, hex2bin raises E_WARNING for odd length hex strings from PHP 5.4.1. http://jp2.php.net/manual/en/function.hex2bin.php However, just returning FALSE is easier for programmers. Current behavior requires additional length check for bad hex to prevent E_WARNING. $str = 'abZ'; if (strlen($str

[PHP-DEV] Re: Gauging Interest:RFC to add map() function

2013-06-26 Thread Daniel Lowrey
Aside from the previously expressed reservations to the name "map()," is anyone actually comfortable with *five* required arguments? That's serious cognitive overload; a more concise API is needed. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/u

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Patrick ALLAERT
Johannes, 2013/6/26 Johannes Schlüter : > So a function author doesn't trust himself and therefore we change the > language syntax? In the following example: class Foo { public function bar($input) { $return = Baz::foo($input); if (!$return instanceof ReturnType)

RE: [PHP-DEV] Gauging Interest:RFC to add map() function

2013-06-26 Thread Richard Bradley
> From: Jeremy Curcio [mailto:j.cur...@icloud.com] > Sent: 26 June 2013 17:10 > To: Mike Willbanks > Cc: PHP Internals > Subject: Re: [PHP-DEV] Gauging Interest:RFC to add map() function > > > I am curious with something that is so easy; why would you want it in core? > > A lot of the Math Function

Re: [PHP-DEV] UNKNOW:0, what is it?

2013-06-26 Thread Ivan Enderlin @ Hoa
On 26/06/13 18:30, Johannes Schlüter wrote: On Wed, 2013-06-26 at 18:21 +0200, Ivan Enderlin @ Hoa wrote: On 26/06/13 18:19, Johannes Schlüter wrote: On Wed, 2013-06-26 at 18:05 +0200, Ivan Enderlin @ Hoa wrote: Hello, Again, I have a segfault with RecursiveDirectoryIterator when I extend it

Re: [PHP-DEV] UNKNOW:0, what is it?

2013-06-26 Thread Stas Malyshev
Hi! > Again, I have a segfault with RecursiveDirectoryIterator when I extend > it. This time, I have a very strange value on my SplFileInfo extension > (subclass). When I var_dump the value, I have UNKNOWN:0. This is not a > string, not null, not false, just UNKNOW:0, without type. Any idea of

Re: [PHP-DEV] UNKNOW:0, what is it?

2013-06-26 Thread Johannes Schlüter
On Wed, 2013-06-26 at 18:21 +0200, Ivan Enderlin @ Hoa wrote: > On 26/06/13 18:19, Johannes Schlüter wrote: > > On Wed, 2013-06-26 at 18:05 +0200, Ivan Enderlin @ Hoa wrote: > >> Hello, > >> > >> Again, I have a segfault with RecursiveDirectoryIterator when I extend > >> it. This time, I have a ver

Re: [PHP-DEV] Gauging Interest:RFC to add map() function

2013-06-26 Thread Jeremy Curcio
>The functionality provided is uncommon but perhaps usefu. However, I am>*very* against the name `map` which has a very established meaning in the>programming world; others have already mentioned this but I felt I should>mention it again.I'd like to note that I am not married to the name. If there

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-26 Thread Stas Malyshev
Hi! > I think we should. And I think we should turn all non-engine related > fatals into exceptions. But both are beyond the scope of this proposal... So, the question of what is the difference between the two errors remains unanswered. If the whole diff is that one of the errors has word "recove

Re: [PHP-DEV] Gauging Interest:RFC to add map() function

2013-06-26 Thread Levi Morrison
On Wed, Jun 26, 2013 at 9:20 AM, Jeremy Curcio wrote: > Hello, > > I would like to submit an RFC to add a new function to the PHP language. > The function would be called "map()". The purpose of this function would be > to take an existing value within a range and make it to a corresponding > loc

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Florin Patan
On Wed, Jun 26, 2013 at 6:02 PM, Stas Malyshev wrote: > Hi! > >> Currently PHP doesn't support what could be a good feature for code >> quality, return typing (or if you prefer to call it: return type >> hinting). > > What changed since the last time we discussed this? > -- > Stanislav Malyshev, S

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-26 Thread Anthony Ferrara
All, I've updated the RFC, renaming "Protocol Type Hinting" to "Structural Type Hinting" (keeping the name of the file for historical reasons). I've also expanded out the use-cases with a dedicated section and two examples (middlewares and third-party specified "standard" interfaces)... Thoughts

Re: [PHP-DEV] UNKNOW:0, what is it?

2013-06-26 Thread Ivan Enderlin @ Hoa
On 26/06/13 18:19, Johannes Schlüter wrote: On Wed, 2013-06-26 at 18:05 +0200, Ivan Enderlin @ Hoa wrote: Hello, Again, I have a segfault with RecursiveDirectoryIterator when I extend it. This time, I have a very strange value on my SplFileInfo extension (subclass). When I var_dump the value, I

Re: [PHP-DEV] UNKNOW:0, what is it?

2013-06-26 Thread Johannes Schlüter
On Wed, 2013-06-26 at 18:05 +0200, Ivan Enderlin @ Hoa wrote: > Hello, > > Again, I have a segfault with RecursiveDirectoryIterator when I extend > it. This time, I have a very strange value on my SplFileInfo extension > (subclass). When I var_dump the value, I have UNKNOWN:0. This is not a > s

Re: [PHP-DEV] Gauging Interest:RFC to add map() function

2013-06-26 Thread Johannes Schlüter
On Wed, 2013-06-26 at 16:09 +, Jeremy Curcio wrote: > > The above examples are just a few that stick out to me I'm sure that > looking through the list of available math functions would provide a > few more examples. Keeping these examples in mind, I don't follow the > logic of range mapping b

Re: [PHP-DEV] Gauging Interest:RFC to add map() function

2013-06-26 Thread Jeremy Curcio
>I am curious with something that is so easy; why would you want it in core?A lot of the Math Functions could be considered "so easy".abs() could be written out as:    function abs($n) {        if ($n >= 0) return $n;        else return $n*-1;    }pi() could be replaced by simply setting a global v

[PHP-DEV] UNKNOW:0, what is it?

2013-06-26 Thread Ivan Enderlin @ Hoa
Hello, Again, I have a segfault with RecursiveDirectoryIterator when I extend it. This time, I have a very strange value on my SplFileInfo extension (subclass). When I var_dump the value, I have UNKNOWN:0. This is not a string, not null, not false, just UNKNOW:0, without type. Any idea of wha

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Stas Malyshev
Hi! > Currently PHP doesn't support what could be a good feature for code > quality, return typing (or if you prefer to call it: return type > hinting). What changed since the last time we discussed this? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900

Re: [PHP-DEV] Gauging Interest:RFC to add map() function

2013-06-26 Thread Mike Willbanks
Hello Jeremy, On Wed, Jun 26, 2013 at 8:20 AM, Jeremy Curcio wrote: > Hello, > > I would like to submit an RFC to add a new function to the PHP language. > The function would be called "map()". The purpose of this function would be > to take an existing value within a range and make it to a cor

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Ferenc Kovacs
On Wed, Jun 26, 2013 at 4:48 PM, Johannes Schlüter wrote: > On Wed, 2013-06-26 at 16:40 +0200, Ferenc Kovacs wrote: > > > > > > I think that the return typehints a bit easier topic than the input type > > hinting(for scalars), because that affects the caller, while return type > > hinting is more

[PHP-DEV] Gauging Interest:RFC to add map() function

2013-06-26 Thread Jeremy Curcio
Hello,I would like to submit an RFC to add a new function to the PHP language. The function would be called "map()". The purpose of this function would be to take an existing value within a range and make it to a corresponding location within a new range.The map() method would have 5 required param

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Florin Patan
On Wed, Jun 26, 2013 at 3:35 PM, Julien Pauli wrote: > On Wed, Jun 26, 2013 at 2:58 PM, Patrick ALLAERT > wrote: >> >> 2013/6/26 Maxwell : >> > Sherif, >> > I have to disagree with you on this in the same way that we have type >> > hints >> > for input variables on methods, this could also be use

Re: [PHP-DEV] Who's incharge of github pull requests?

2013-06-26 Thread Lior Kaplan
Hi Felipe, Indeed I saw more responsiveness for the pull requests (mine and others), thanks. The question was about the process of reviewing these requests. 1. Do we have someone in charge (making sure they pass some minimum requirements) or this is done sporadically ? 2. If we do it sporadically

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-26 Thread Anthony Ferrara
Robert, On Wed, Jun 26, 2013 at 10:52 AM, Robert Stoll wrote: > I had a quick look at GO and as far as I understand they do not use duck > typing but a structural type system. > http://golang.org/doc/faq#implements_interface > > Please change this in your RFC to avoid misunderstandings. Great

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-26 Thread Anthony Ferrara
Florin Could you please point out what happened in the past 5 months in PHP > that changed the landscape so drastically as you say? And don't > mention folks reinventing the wheel in OOP because that's not news :) > The point was that "best practice" is volatile and temporal, and changes dependin

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Florin Patan
On Wed, Jun 26, 2013 at 4:48 PM, Johannes Schlüter wrote: > On Wed, 2013-06-26 at 16:40 +0200, Ferenc Kovacs wrote: > >> > >> I think that the return typehints a bit easier topic than the input type >> hinting(for scalars), because that affects the caller, while return type >> hinting is more cont

AW: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-26 Thread Robert Stoll
I had a quick look at GO and as far as I understand they do not use duck typing but a structural type system. http://golang.org/doc/faq#implements_interface Please change this in your RFC to avoid misunderstandings. -Ursprüngliche Nachricht- Von: Anthony Ferrara [mailto:ircmax...@gmail.

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Johannes Schlüter
On Wed, 2013-06-26 at 16:40 +0200, Ferenc Kovacs wrote: > > > I think that the return typehints a bit easier topic than the input type > hinting(for scalars), because that affects the caller, while return type > hinting is more contained: you write the function, you put the return > typehint there

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-26 Thread Florin Patan
On Wed, Jun 26, 2013 at 4:28 PM, Anthony Ferrara wrote: > Stas and all, > > > But instead a fatal "protocol does not match" error will be thrown. The >> difference? > > > A recoverable protocol does not match error. And the difference is that the > check is pushed to the caller as opposed to withi

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Patrick ALLAERT
2013/6/26 Marco Pivetta : > What about disabling the check in some environments (prod)? It would work > like an assertion I suppose. (Feel free to shoot at me if you think it's a > bad idea) This is typically something that has always been rejected in the past. -- PHP Internals - PHP Runtime D

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Ferenc Kovacs
On Wed, Jun 26, 2013 at 4:21 PM, Patrick ALLAERT wrote: > 2013/6/26 Julien Pauli : > > But what Sherif said proves as well the limits of the idea. PHP is not > > strongly typed. So each check, should it be type hinting or return type > > hinting, has to be done at runtime , which is bad for perfor

Re: [PHP-DEV] Who's incharge of github pull requests?

2013-06-26 Thread Felipe Pena
Hi, I saw some patches from you (mentioned in the blog post) has been pushed to git. About the FTP patch, as it requires further testing and an environment for such, and we do not have an active maintainer currently for the extension. It tend to have a delay until anyone with free time (most of w

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-26 Thread Anthony Ferrara
Stas and all, But instead a fatal "protocol does not match" error will be thrown. The > difference? A recoverable protocol does not match error. And the difference is that the check is pushed to the caller as opposed to within the function. > > It gives the ability for a method to be defensiv

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Patrick ALLAERT
2013/6/26 Julien Pauli : > But what Sherif said proves as well the limits of the idea. PHP is not > strongly typed. So each check, should it be type hinting or return type > hinting, has to be done at runtime , which is bad for performances. It doesn't mean you have to use it, just that it might b

AW: [PHP-DEV] RFC Proposal: New assign value operator

2013-06-26 Thread Robert Stoll
Well indeed, that would be very confusing and is not really what I meant. But it was an example anyway and don’t blame me when it does not fit in your use case ;-) No seriously, you can take email as an example instead: $email = new Email(); $email := ‘rst...@tutteli.ch’ Instead of writin

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Marco Pivetta
On 26 June 2013 15:35, Julien Pauli wrote: > On Wed, Jun 26, 2013 at 2:58 PM, Patrick ALLAERT >wrote: But what Sherif said proves as well the limits of the idea. PHP is not > strongly typed. So each check, should it be type hinting or return type > hinting, has to be done at runtime , which is

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Julien Pauli
On Wed, Jun 26, 2013 at 2:58 PM, Patrick ALLAERT wrote: > 2013/6/26 Maxwell : > > Sherif, > > I have to disagree with you on this in the same way that we have type > hints > > for input variables on methods, this could also be useful. > > Consider an interface with a getter method defined. As it s

Re: [PHP-DEV] RFC Proposal: New assign value operator

2013-06-26 Thread Alexey Zakhlestin
On 26.06.2013, at 17:29, Sebastian Krebs wrote: > 2013/6/26 Robert Stoll > >> As far as I see it, it is kind of an operator overload mechanism for the >> assign operator. >> This can be useful for small utility classes such as Money, Email etc. >> >> An example was given: >> $price = new Mone

Re: [PHP-DEV] RFC Proposal: New assign value operator

2013-06-26 Thread Sebastian Krebs
2013/6/26 Robert Stoll > As far as I see it, it is kind of an operator overload mechanism for the > assign operator. > This can be useful for small utility classes such as Money, Email etc. > > An example was given: > $price = new MoneyValue(); > $price := 29.99; > > Instead of writing something

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-26 Thread Seva Lapsha
Hi, As I see it, adapters not only serve declaration purpose, they also can adapt the method and param names and even alter or tune the execution flow. Imagine this simple case: You have a protocol Duck with method walk() with few concrete implementations. Later you have another instance of Duck

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Patrick ALLAERT
2013/6/26 Maxwell : > Sherif, > I have to disagree with you on this in the same way that we have type hints > for input variables on methods, this could also be useful. > Consider an interface with a getter method defined. As it stands now in > php, they're not entirely useful, since you can't defi

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Maxwell
Sherif, I have to disagree with you on this in the same way that we have type hints for input variables on methods, this could also be useful. Consider an interface with a getter method defined. As it stands now in php, they're not entirely useful, since you can't define what type of object your ex

Re: [PHP-DEV] RE: Announcing RFC 'Anonymous Catches'

2013-06-26 Thread Sherif Ramadan
On Wed, Jun 26, 2013 at 7:54 AM, Joost Koehoorn wrote: > On 26 juni 2013 at 08:35:59, Michael Wallner (m...@php.net) wrote: > On 25 June 2013 22:23, Johannes Schlüter wrote: > > On Tue, 2013-06-25 at 13:19 -0700, Stas Malyshev wrote: > >> Hi! > >> > >> > If I'm to understand this RFC correctly, i

AW: AW: [PHP-DEV] RFC Proposal: New assign value operator

2013-06-26 Thread Robert Stoll
I agree, $price = new MoneyValue(29.99); makes more sense and that's what I questioned in my first email. The benefit is small, I said that as well, and the drawbacks are maybe bigger as you already outlined. -Ursprüngliche Nachricht- Von: Johannes Schlüter [mailto:johan...@schlueters.d

AW: [PHP-DEV] RFC Proposal: New assign value operator

2013-06-26 Thread Robert Stoll
The property is most likely private and you don’t have to bother about it anyway. But yes, for pure PHP users it might seems confusing since PHP variables have no types. If you are familiar with types and operator overloading than it is more readable IMO I assign the new price 29.99 to the

Re: AW: [PHP-DEV] RFC Proposal: New assign value operator

2013-06-26 Thread Johannes Schlüter
On Wed, 2013-06-26 at 13:54 +0200, Robert Stoll wrote: > As far as I see it, it is kind of an operator overload mechanism for the > assign operator. > This can be useful for small utility classes such as Money, Email etc. > > An example was given: > $price = new MoneyValue(); > $price := 29.99; >

Re: [PHP-DEV] RFC Proposal: New assign value operator

2013-06-26 Thread Peter Lind
On 26 June 2013 13:54, Robert Stoll wrote: > As far as I see it, it is kind of an operator overload mechanism for the > assign operator. > This can be useful for small utility classes such as Money, Email etc. > > An example was given: > $price = new MoneyValue(); > $price := 29.99; > > Instead o

Re: [PHP-DEV] RE: Announcing RFC 'Anonymous Catches'

2013-06-26 Thread Joost Koehoorn
On 26 juni 2013 at 08:35:59, Michael Wallner (m...@php.net) wrote: On 25 June 2013 22:23, Johannes Schlüter wrote:  > On Tue, 2013-06-25 at 13:19 -0700, Stas Malyshev wrote:  >> Hi!  >>  >> > If I'm to understand this RFC correctly, it is nothing more than a  >> > random suggestion someone posed i

AW: [PHP-DEV] RFC Proposal: New assign value operator

2013-06-26 Thread Robert Stoll
As far as I see it, it is kind of an operator overload mechanism for the assign operator. This can be useful for small utility classes such as Money, Email etc. An example was given: $price = new MoneyValue(); $price := 29.99; Instead of writing something like: $price = new MoneyValue(); $price-

Re: [PHP-DEV] Announcing RFC 'Anonymous Catches'

2013-06-26 Thread Joost Koehoorn
On 26 juni 2013 at 08:50:55, Patrick ALLAERT (patrickalla...@php.net) wrote: 2013/6/25 Nikita Popov :  > but I'm against the generic catch{} statement.  I'm sharing Nikita's opinion, with the difference of a bit more  enthusiasm on leaving off the variable as it could make it more  obvious that th

RE: [PHP-DEV] RE: Announcing RFC 'Anonymous Catches'

2013-06-26 Thread Christian Stoller
>> If you have an exception like `BadCredentialsException` and throw it >> during authentication if the user has entered wrong login data, than >> you have such a situation right? >> But do you need any further information? No - in the catch block it may >> be enough to create a message for the

Re: [PHP-DEV] RFC Proposal: New assign value operator

2013-06-26 Thread Richard Quadling
On 25 June 2013 11:01, Tom Oram wrote: > Hi everyone, > > I've got an idea for an RFC proposal and from reading the instructions it > looks like I should run it past you guys first. > > I have not made any contributions to PHP before although I have made some > custom modifications in house in th

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Sherif Ramadan
On Wed, Jun 26, 2013 at 5:50 AM, Florin Patan wrote: > Hello PHP internals, > > > Currently PHP doesn't support what could be a good feature for code > quality, return typing (or if you prefer to call it: return type > hinting). > > Since the procedure says that before any real RFC should be done

Re: [PHP-DEV] pgsql: Binary data support improvement

2013-06-26 Thread Yasuo Ohgaki
Hi Matteo, 2013/6/26 Matteo Beccati > I have mixed feelings... I see where this might come in handy, but I > think it would be a bit too user-unfriendly. > I have mixed feelings for supporting direct binary support, too. Main intension is faster bytea(binary) handling. Without binary support,

[PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Florin Patan
Hello PHP internals, Currently PHP doesn't support what could be a good feature for code quality, return typing (or if you prefer to call it: return type hinting). Since the procedure says that before any real RFC should be done, the interest for this topic should be gauged, I've drafted somethi

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-26 Thread Nikita Nefedov
Hi, On Wed, 26 Jun 2013 02:57:46 +0400, Stas Malyshev wrote: That means all you really need is to call method named "get", regardless of what it actually does. Usually the code doesn't work this way - you expect something to actually happen if you call get(), something specific. Interface e

Re: [PHP-DEV] pgsql: Binary data support improvement

2013-06-26 Thread Matteo Beccati
On 26/06/2013 00:44, Yasuo Ohgaki wrote: > New: > resource pg_execute ([ resource $connection ], string $stmtname , array > $params [, array $params_format [, bool $binary_result]] ) > > Any thoughts? Using binary format "requires knowledge of the internal representation expected by the backend.

Re: [PHP-DEV] pgsql: Binary data support improvement

2013-06-26 Thread Michael Wallner
Sorry, missed the list... On 26 June 2013 09:54, Yasuo Ohgaki wrote: > Hi Make, > > 2013/6/26 Michael Wallner >> >> I didn't look at the code yet, but how do you know about binary format >> conventions of all possible types returned? > > Users can only specify if the result is returned as text o

Re: [PHP-DEV] RE: Announcing RFC 'Anonymous Catches'

2013-06-26 Thread Florin Patan
On Wed, Jun 26, 2013 at 8:31 AM, Christian Stoller wrote: >>> But I think it looks a bit cleaner if the variable could be omitted, >>> if it's not needed ;-) >> >> I don't think we need to change the language because Netbeans can't >> figure out how catch blocks work. > > The Netbeans thing was ju