Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] RFC: Making T_FUNCTION optional in method declarations [RSS Feed]

#1 Nov. 27, 2010 17:50:53

Sebastian B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


Am 27.11.2010 18:40, schrieb Johannes Schlüter:
> RFC:http://wiki.php.net/rfc/optional-t-function> Patch:http://schlueters.de/~johannes/php/zend_optional_t_function.diff+1

--
Sebastian Bergmann Co-Founder and Principal Consultanthttp://sebastian-bergmann.de/http://thePHP.cc/--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#2 Nov. 27, 2010 17:53:20

Kalle S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


2010/11/27 Johannes Schlüter <johan***@*chlueters.de>:
> RFC:http://wiki.php.net/rfc/optional-t-function> Patch:http://schlueters.de/~johannes/php/zend_optional_t_function.diff+1, I've missed being able to skip the function keyword for a while now.


--
regards,

Kalle Sommer Nielsen
ka...@php.net

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#3 Nov. 27, 2010 17:54:51

Felipe P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


2010/11/27 Johannes Schlüter <johan***@*chlueters.de>

> Without T_FUNCTION token. In my opinion an access modifier /public,
> private protected, static, final) should still be required for keeping
> readability.
>
> RFC:http://wiki.php.net/rfc/optional-t-function> Patch:http://schlueters.de/~johannes/php/zend_optional_t_function.diff>
>
+1

--
Regards,
Felipe Pena

Offline

#4 Nov. 27, 2010 17:55:48

Ilia A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


As long as a modifier (public|private|protected) is still required, +1.

2010/11/27 Johannes Schlüter <johan***@*chlueters.de>:
> Hi,
>
> every now and then while writing classes I forget to add the "function"
> keyword between my visibility modifier and the method name in a class
> declaration. I don't think it is required for readability and it is not
> needed by the parser to prevent conflicts, I therefore propose the
> following RFC incl. patch to allow writing
>
>        class Foo {
>            public bar() {
>                echo "Hello World";
>            }
>        }
>
> Without T_FUNCTION token. In my opinion an access modifier /public,
> private protected, static, final) should still be required for keeping
> readability.
>
> RFC:http://wiki.php.net/rfc/optional-t-function> Patch:http://schlueters.de/~johannes/php/zend_optional_t_function.diff>
> johannes
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit:http://www.php.net/unsub.php>
>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#5 Nov. 27, 2010 17:56:51

Pierrick C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


+1

2010/11/27 Johannes Schlüter <johan***@*chlueters.de>

> Hi,
>
> every now and then while writing classes I forget to add the "function"
> keyword between my visibility modifier and the method name in a class
> declaration. I don't think it is required for readability and it is not
> needed by the parser to prevent conflicts, I therefore propose the
> following RFC incl. patch to allow writing
>
> class Foo {
> public bar() {
> echo "Hello World";
> }
> }
>
> Without T_FUNCTION token. In my opinion an access modifier /public,
> private protected, static, final) should still be required for keeping
> readability.
>
> RFC:http://wiki.php.net/rfc/optional-t-function> Patch:http://schlueters.de/~johannes/php/zend_optional_t_function.diff>
> johannes
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit:http://www.php.net/unsub.php>
>

Offline

#6 Nov. 27, 2010 18:31:56

Pierre J.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


+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).

2010/11/27 Pierrick Charron <pierr***@*ebstart.fr>:
> +1
>
> 2010/11/27 Johannes Schlüter <johan***@*chlueters.de>
>
>> Hi,
>>
>> every now and then while writing classes I forget to add the "function"
>> keyword between my visibility modifier and the method name in a class
>> declaration. I don't think it is required for readability and it is not
>> needed by the parser to prevent conflicts, I therefore propose the
>> following RFC incl. patch to allow writing
>>
>>        class Foo {
>>            public bar() {
>>                echo "Hello World";
>>            }
>>        }
>>
>> Without T_FUNCTION token. In my opinion an access modifier /public,
>> private protected, static, final) should still be required for keeping
>> readability.
>>
>> RFC:http://wiki.php.net/rfc/optional-t-function>> Patch:http://schlueters.de/~johannes/php/zend_optional_t_function.diff>>
>> johannes
>>
>>
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit:http://www.php.net/unsub.php>>
>>
>



--
Pierre

@pierrejoye |http://blog.thepimp.net|http://www.libgd.org--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#7 Nov. 27, 2010 18:42:48

Johannes S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


On Sat, 2010-11-27 at 19:30 +0100, Pierre Joye wrote:
> +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).

The patch follows the RFC's suggestion. This option is mentioned to make
it clear that this is a expected limitation if implemented. (And to
allow other opinions, which I don't expect)

johannes


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#8 Nov. 27, 2010 18:48:22

Philip O.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


Sorry for moving offtopic, but if the PHP syntax is going to change then we
should revisit other proposals that add/change syntax. For example, I think the
short syntax for arrays was declined mainly because it introduced a
new syntax at a time we wanted to preserve BC:

-http://wiki.php.net/rfc/shortsyntaxforarraysRegards,
Philip
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#9 Nov. 27, 2010 20:34:40

Marcello D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


+1 to being able to omit the function keyword.

2010/11/27 Johannes Schlüter <johan***@*chlueters.de>:
> Hi,
>
> every now and then while writing classes I forget to add the "function"
> keyword between my visibility modifier and the method name in a class
> declaration. I don't think it is required for readability and it is not
> needed by the parser to prevent conflicts, I therefore propose the
> following RFC incl. patch to allow writing
>
>        class Foo {
>            public bar() {
>                echo "Hello World";
>            }
>        }
>
> Without T_FUNCTION token. In my opinion an access modifier /public,
> private protected, static, final) should still be required for keeping
> readability.
>
> RFC:http://wiki.php.net/rfc/optional-t-function> Patch:http://schlueters.de/~johannes/php/zend_optional_t_function.diff>
> johannes
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit:http://www.php.net/unsub.php>
>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#10 Nov. 27, 2010 21:06:49

Ferenc K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


2010/11/27 Philip Olson <phi***@*oshambo.org>

> Sorry for moving offtopic, but if the PHP syntax is going to change then we
> should revisit other proposals that add/change syntax. For example, I think
> the short syntax for arrays was declined mainly because it
> introduced a new syntax at a time we wanted to preserve BC:
>
> -http://wiki.php.net/rfc/shortsyntaxforarrays>
> Regards,
> Philip
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit:http://www.php.net/unsub.php>
>
I would love both feature, I think we should finalize the release
process/roadmap, and after that, it would be a good idea to revisit the
pending/declined rfc-s in the light of the roadmap.

Tyrael

Offline

  • Root
  • » PHP
  • » [PHP-DEV] RFC: Making T_FUNCTION optional in method declarations [RSS Feed]

Board footer

Moderator control

Enjoy the 17th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support