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

 ID:                 62572
 User updated by:    thbley at gmail dot com
 Reported by:        thbley at gmail dot com
 Summary:            Relax syntax by skipping ";" at end of line
 Status:             Open
 Type:               Feature/Change Request
 Package:            *General Issues
 Operating System:   all
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

small correction:
- "(", "'", "\"", "[" are currently not open on stack and


Previous Comments:
------------------------------------------------------------------------
[2012-07-17 05:30:59] thbley at gmail dot com

I would try these rules:
do ";" if line ends with "\n" and
- next token is not "->" and not an operator (-+%...)
- "(", "'", "\"" are currently not open on stack and
- previous token is not an operator and
- start child stack if "function" token comes and
- not inside "function|if|while|switch|for|foreach () {"

e.g.
$test = [
  [],
  function ()
  { // do ";"
    return "test" // do ";"
  },
] // do ";"

for must remain:
  for ($i=0;
  $i<10;
  $i++) {}

------------------------------------------------------------------------
[2012-07-16 22:07:43] zyss at mail dot zp dot ua

Semicolons were invented not by stupid people...

It's interesting how would you write without semicolons the following:

from($categories)
    ->orderBy('$v["name"]')
    ->groupJoin(
        from($products)
            ->where('$v["quantity"] > 0')
            ->orderByDescending('$v["quantity"]')
            ->thenBy('$v["name"]'),
        '$v["id"]', '$v["catId"]', 'array("name" => $v["name"], "products" => 
$e)'
    );

???

------------------------------------------------------------------------
[2012-07-16 03:36:17] thbley at gmail dot com

Description:
------------
old:

$txt1="Hello World!";
$txt2="What a nice day!";
echo $txt1 . " " . $txt2;
$i = 1; $j = 2; $k = 3;
function hello() { echo "hello world"; }

new:
$txt1="Hello World!"
$txt2="What a nice day!"
echo $txt1 . " " . $txt2
$i = 1; $j = 2; $k = 3
function hello() { echo "hello world" }

Test script:
---------------
$txt1="Hello World!"
$txt2="What a nice day!"
echo $txt1 . " " . $txt2
$i = 1; $j = 2; $k = 3
function hello() { echo "hello world" }



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



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

Reply via email to