On Thu, 2010-05-13 at 20:38 -0300, Mathias Grimm wrote:
> I want to suggest the GO include format
>
> <?php
> require
> (
> 'utila.php',
> 'utilb.php',
> 'utilc.php',
> )
>
> the same from include
What's te benefit, other than saving a few chars on the cost of being
more explicit. I don't see any benefit.
Doing this would mean an error to include one of these files would give
an imprecise error message. Given
<?php
require(
$a,
$b
);
?>
fails it will always tell you about an error in line 5 (basically where
the ; is)
<?php
require $a;
require $b;
?>
will give you the precise line.
Other similar issues exist.
> or more , without comma
>
> <?php
>
> require
> (
> 'utila.php'
> 'utilb.php'
> 'utilc.php'
> )
that looks more like a typo than expected code.
> or more, withou .php
> <?php
>
> require
> (
> 'utila',
> 'utilb',
> 'utilc',
> )
that makes no sense. It would have to check for two files, and why
only .php? Why not .inc or .class or whatever people are using?
>
> the same for other to, like define..
>
> <?php
> define
> (
> 'K_TYPE_A' => 'a',
> 'K_TYPE_B' => 'b'
> 'K_TYPE_C' => 'c'
> )
>
> with or without comma...
define() is a regular function so we'd have to make it a language
construct (which creates issues) or do some strange things to function
declarations.
Again, I see no benefit (and no, a few characters more are no trouble,
writing code is never the hard part. The hard part is maintenance ...
and a proper IDE serves quite well for saving key strokes ...)
johannes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php