Req #51373 [Opn->Wfx]: remove or change the 'function' in classes
| From: | derick@php.net | Date: | Tue, 23 Mar 2010 22:05:13 +0000 |
| Subject: | Req #51373 [Opn->Wfx]: remove or change the 'function' in classes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-148913@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51373&edit=1
ID: 51373
Updated by: derick@php.net
Reported by: kjarli at gmail dot com
Summary: remove or change the 'function' in classes
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
Package: Unknown/Other Function
PHP Version: Irrelevant
New Comment:
functions are by far not deprecated. OO might be useful, but is
definitely not what all PHP really cares for. I don't see why we would
want to change this. It doesn't add functionality, nor does it add to
readability. IMO, changing this would be a strange thing to do.
Previous Comments:
------------------------------------------------------------------------
[2010-03-23 22:46:20] kjarli at gmail dot com
Description:
------------
The function keyword is pretty deprecated in php atm. If you got a
function inside
a class people always refer to it as a 'method' and not a function.
Besides that,
there is actually no need for that keyword...
class foo {
public function foobar() {}
}
Is actually the same as:
class foo {
public foobar() {}
}
Should not be hard to understand that it's a function or method...
I propose to either change the keyword to method or remove it completely
Test script:
---------------
<?php
class foo {
// old
public function foobar() {}
// suggestion 0
public method foobar() {}
// suggestion 1
public foobar() {}
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51373&edit=1