Req #24100 [Com]: Please add "endclass", "endfunction" keywords

From: Date: Thu, 29 Aug 2013 23:02:14 +0000
Subject: Req #24100 [Com]: Please add "endclass", "endfunction" keywords
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-181323@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=24100&edit=1

 ID:                 24100
 Comment by:         carlos at nodolibre dot org
 Reported by:        waxmop at sarcastic-horse dot com
 Summary:            Please add "endclass", "endfunction" keywords
 Status:             Wont fix
 Type:               Feature/Change Request
 Package:            Feature/Change Request
 Operating System:   linux
 PHP Version:        4.3.2
 Block user comment: N
 Private report:     N

 New Comment:

Well, it seems that we'll have to change to ruby or python.


Previous Comments:
------------------------------------------------------------------------
[2003-06-09 13:40:54] derick@php.net

The "endif;" stuff is old legacy syntax and is definitely not the recommended way of doing
things. For my part if can be removed for PHP 5... anyway, definitely not something we will add.

------------------------------------------------------------------------
[2003-06-09 13:21:18] waxmop at sarcastic-horse dot com

I really like this alternative syntax:

<?php if($a): ?>
<h1>A is true.</h1>
<?php endif; ?>

I thought I was free from using curly brackets "{}", until I realized that I'd still
have to define classes and functions in the old style:

<?php
class Old
{
    var $val;
    function Old($num=0)
    {
        print "<p>Created an object";
        if ($num > 0):
            print "this is mismatched syntax!";
        endif;
    }
}
?>

It seems a little jarring to have to switch back and forth between the "{}" and the
alternative style in a class definition.  

It would be nice to be able to create an object with the alternative style syntax rather than with
curly brackets.  It could look a little like this:

<?php
class Noo:
    var $val;
    function Noo():
        print "<p>Created a noo object";
    endfunction;
endclass;
?>

Wouldn't that be great?  My apologies if this is a redundant submission.  I searched for
endclass and endfunction, but couldn't find them. 

------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=24100&edit=1


Thread (3 messages)

« previous php.bugs (#181323) next »