Re: [PHP-DEV] [RFC] new foo()->bar()

2010-11-29 Thread Felipe Pena
2010/11/29 Felipe Pena > It also probably makes sense to add array deference chaining e.g. new >> Foo()[] (just for language consistency). >> >> > Hmm, looks good to me. :) > > I've updated the patch with the bracketed version to include the array dereferecing support: http://felipe.ath.cx/diff/

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Benjamin Dubois
Hi ! This is my first email here (I'm just a PHP user, with only very basic C skills, but I'm working on it), and I would love to contribute to this project. I have been working with Objective-c lately, and it has a very flexible and short way to deal with properties, which could look like this

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Ángel González
Richard Quadling wrote: > As for reading $seconds directly ... > > Well. > > If you think of the element that follows read as $this->, then if > the parser can handle both ... > > read $seconds > read getSeconds > > then yes for both. > > If not, then I'd guess that the getSeconds version shoul

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Johannes Schlüter
On Mon, 2010-11-29 at 13:40 -0600, la...@garfieldtech.com wrote: > I still want to keep the performance implications in mind, as this > sounds like something that we'd want to use a lot but could also cost a > lot more than it seems at first glance if we're not careful. By making properties in m

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread la...@garfieldtech.com
On 11/29/10 12:41 PM, Johannes Schlüter wrote: On Mon, 2010-11-29 at 12:18 -0600, la...@garfieldtech.com wrote: Another advantage here would presumably be performance. If there's no getter defined then the engine could simply map $foo->bar to the class member directly (which is really fast) and

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Johannes Schlüter
On Mon, 2010-11-29 at 12:18 -0600, la...@garfieldtech.com wrote: > Another advantage here would presumably be performance. If there's > no > getter defined then the engine could simply map $foo->bar to the > class > member directly (which is really fast) and not to a method, so > there's > no a

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread la...@garfieldtech.com
On 11/29/10 8:30 AM, Ángel González wrote: What about allowing this syntax to attach the property to a variable? For instance: = 0&& $seconds< 60) $this->seconds = $seconds; } public function setMinutes($minutes) { if ($minutes>= 0&& $minutes< 60) $this->minutes =

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread la...@garfieldtech.com
On 11/29/10 11:51 AM, Jonathan Bond-Caron wrote: Right, it looks the same but the subtle difference is 'property Hours' wouldn't be registered as a class. It's just container code for get(), set() methods that would get 'compiled' into opcodes in the class TimePeriod (the property exists vs. sea

RE: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Jonathan Bond-Caron
On Mon Nov 29 09:27 AM, Stas Malyshev wrote: > Hi! > > > Nice RFC, just an idea for an alternative syntax (added to the RFC > > as > #2): > > > > property Hours { > > get { return $this->seconds / 3600; } > > set { $this->seconds = $value * 3600; } // The variable $value > holds > > the i

[PHP-DEV] Hello - been pointed this way for suggestions - Including.

2010-11-29 Thread Michael Morris
Been pointed this way by some folks that this is the place to set suggestions on changes to the functions or language. I have two at the moment, and that is to the including functions (include, require, include_once, require_once). They need to be considered separately as they address two different

Re: [PHP-DEV] RFC: Making T_FUNCTION optional in method declarations

2010-11-29 Thread guilhermebla...@gmail.com
+1 for next major, but not for middle point release. =) 2010/11/29 Pierre Joye : > my +1 for new major version only, btw :) > > 2010/11/27 Pierre Joye : >> +1 if "While technically possible this RFC suggests that the following >> shall NOT be valid for keeping the code readable " also means that t

Re: [PHP-DEV] Supporting Binary Notation for Integers

2010-11-29 Thread Jonah H. Harris
On Mon, Nov 15, 2010 at 12:07 PM, Jonah H. Harris wrote: > On Fri, Nov 12, 2010 at 12:10 PM, Jonah H. Harris > wrote: > >> RFC updated with links to GCC, Python, and Ruby syntax definitions. >> > > I just noticed the patch (written against 5.3) doesn't apply cleanly to > trunk and will be updatin

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Richard Quadling
2010/11/29 Ángel González : > Richard Quadling wrote: > setMilliseconds() should have $value as parameter instead of a magic name. > > What about allowing this syntax to attach the property to a variable? > > For instance: > > class TimePeriod > { >    protected $seconds; >    protected $minutes;

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Stas Malyshev
Hi! public property Hours read getHours write setHours; I actually like that, though I think we should support the whole existing semantics, i.e. get/set/isset/unset. And probably keep the names, so we don't call the same thing both "read" and "get". Having them called __get etc. woul

Re: [PHP-DEV] [RFC] new foo()->bar()

2010-11-29 Thread Julien Pauli
Care should be taken in the case of new myClass()->foo() just creates an object to call a method but a static method would be more efficient here. However, well used (fluent interface for exemple) make me think +1 for that patch. J.Pauli On Mon, Nov 29, 2010 at 12:40 PM, Felipe Pena wrote: > Hi

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Matthew Weier O'Phinney
On 2010-11-29, Stas Malyshev wrote: > > Nice RFC, just an idea for an alternative syntax (added to the RFC as #2): > > > > property Hours { > > get { return $this->seconds / 3600; } > > set { $this->seconds = $value * 3600; } // The variable $value holds > > the incoming value to be "set"

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Matthew Weier O'Phinney
On 2010-11-29, Richard Quadling wrote: > On 28 November 2010 23:18, wrote: > > Link to the RFC: > > http://wiki.php.net/rfc/propertygetsetsyntax > > > > Thanks, > > Dennis Robinson > > I'd really like this feature to be part of PHP. > > I don't particularly like the use of what looks like a clos

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Ángel González
Richard Quadling wrote: > I'd really like this feature to be part of PHP. > > I don't particularly like the use of what looks like a closure for the > set/get. > > I used to code in Delphi and I always like the way in which their > properties were defined. > > Essentially, the setter and getter ar

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Stas Malyshev
Hi! Nice RFC, just an idea for an alternative syntax (added to the RFC as #2): property Hours { get { return $this->seconds / 3600; } set { $this->seconds = $value * 3600; } // The variable $value holds the incoming value to be "set" } class TimePeriod { private $seconds;

RE: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Jonathan Bond-Caron
On Sun Nov 28 06:18 PM, presid...@basnetworks.net wrote: > > Link to the RFC: > http://wiki.php.net/rfc/propertygetsetsyntax > Nice RFC, just an idea for an alternative syntax (added to the RFC as #2): property Hours { get { return $this->seconds / 3600; } set { $this->seconds =

Re: [PHP-DEV] SVN Account Request: eyalt

2010-11-29 Thread Patrick ALLAERT
Can someone please approve eyal's account request with the following karma?: php/php-src/*/tests Thanks, Patrick 2010/11/22 Patrick ALLAERT : > Eyal provided already a fair number of contributions/remarks on the php-qa ML. > > Regards, > -- > Patrick Allaert > --- > http://code.google.com/p/pecla

Re: [PHP-DEV] RFC: Making T_FUNCTION optional in method declarations

2010-11-29 Thread Pierre Joye
my +1 for new major version only, btw :) 2010/11/27 Pierre Joye : > +1 if "While technically possible this RFC suggests that the following > shall NOT be valid for keeping the code readable " also means that the > patch implements it as well (force the function visibility property > usage). Cheer

Re: [PHP-DEV] [RFC] new foo()->bar()

2010-11-29 Thread Felipe Pena
Hi Dmitry, 2010/11/29 Dmitry Stogov > Hi Felipe, > I'm wondered it works out of the box with so small patches :) > > However, both patches introduce new parser conflicts and it would be grate > to avoid them. > > I will check if there is any way to avoid it. > Also the patches need to be ch

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Richard Quadling
On 28 November 2010 23:18, wrote: > Link to the RFC: > http://wiki.php.net/rfc/propertygetsetsyntax > > Thanks, > Dennis Robinson I'd really like this feature to be part of PHP. I don't particularly like the use of what looks like a closure for the set/get. I used to code in Delphi and I alway

Re: [PHP-DEV] git anyone?

2010-11-29 Thread Lester Caine
David Soria Parra wrote: On 2010-11-29, Clint Byrum wrote: On Sat, 2010-11-27 at 16:26 +, Lester Caine wrote: I've not used git or hg much at all, but bzr has always satisfied my needs for DVCS, and has recently gotten much faster and more space efficient than it was in the past. Sorry, b

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Chad Fulton
On Sun, Nov 28, 2010 at 11:48 PM, Christian Kaps wrote: ... > /** >  * >  */ > public function set name(string $name) { >    $this->name = htmlentities($name); >    $this->name = strip_tags($this->name); > } > > /** >  * >  */ > public function get name($name) { >    return $this->name; > } > > G

Re: [PHP-DEV] git anyone?

2010-11-29 Thread David Soria Parra
On 2010-11-29, Clint Byrum wrote: > On Sat, 2010-11-27 at 16:26 +, Lester Caine wrote: > I've not used git or hg much at all, but bzr has always satisfied my > needs for DVCS, and has recently gotten much faster and more space > efficient than it was in the past. Sorry, but I think bzr is not