|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-06-09 13:40 UTC] derick@php.net
[2013-08-29 23:02 UTC] carlos at nodolibre dot org
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 18:00:01 2025 UTC |
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.