Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Zeev Suraski

There's no real motivation to do that actually.  These constructs are very 
unique, and the fact they have construct-specific syntax doesn't have any 
negative impact, as it's still within the standard syntax rules of PHP (all 
but echo, which is a remnant of PHP/FI 2, and perhaps it was a mistake to 
copy its syntax as-is).
Let's not look for problems where they don't exist...

Zeev

At 20:31 23/3/2001, Phil Driscoll wrote:
> >it should be even more save to hardcode them in PHP itself
>
>...or better still not to have language constructs at all so that everything
>that looks like a function also works like a function.
>
>
>:)
>--
>Phil Driscoll
>Dial Solutions
>+44 (0)113 294 5112
>http://www.dialsolutions.com
>http://www.dtonline.org

--
Zeev Suraski <[EMAIL PROTECTED]>
CTO &  co-founder, Zend Technologies Ltd. http://www.zend.com/


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Zeev Suraski

At 18:49 23/3/2001, Hartmut Holzgraefe wrote:
>Zeev Suraski wrote:
> > The language constructs PHP supports aren't a moving target, so there's no
> > much sense in having a function that returns them.  You should be quite
> > safe hardcoding these constructs in your application.
>
>it should be even more save to hardcode them in PHP itself

Yeah, but doesn't make sense.  A function is useless (i.e. nothing but 
bloat) if it always returns the same thing.

Zeev


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Phil Driscoll

>it should be even more save to hardcode them in PHP itself

...or better still not to have language constructs at all so that everything
that looks like a function also works like a function.


:)
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Hartmut Holzgraefe

Zeev Suraski wrote:
> The language constructs PHP supports aren't a moving target, so there's no
> much sense in having a function that returns them.  You should be quite
> safe hardcoding these constructs in your application.

it should be even more save to hardcode them in PHP itself

-- 
Hartmut Holzgraefe  [EMAIL PROTECTED]  http://www.six.de  +49-711-99091-77 

Besuchen Sie uns auf der CeBIT 2001 - in Halle 6 Stand F62/4

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Zeev Suraski

At 18:20 23/3/2001, Cynic wrote:
>As for the sensible purpose:
>I'm writing phLXR. It's like LXR, except it's written in PHP, for PHP
>programs, and (me being still firmly rooted in the NT world) with
>portability in mind -> no Glimpse. I want the internal PHP stuff (be
>it a function, a "language construct" (who cares? it feels and tastes
>like a function!), or your coffee cup to be links to PHP documentation.
>And the more I can get automagically through a call, the less maintenance
>work will be required from the user.

The language constructs PHP supports aren't a moving target, so there's no 
much sense in having a function that returns them.  You should be quite 
safe hardcoding these constructs in your application.

Zeev


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Zeev Suraski

unset() is not a function, and using it has very different semantics than a 
function call (e.g., you can't use unset() as a part of a bigger 
expression, but only as a full 'unset();' statement).  There aren't too 
many built-in constructs that behave exactly like functions, as a matter of 
fact, I don't think there are any.  The ones that come close:

- isset() and empty() - their different semantics is that they won't 
display a warning when fed a non existent argument (regardless of error 
reporting).
- print, include, require - do not require parentheses
- echo - does not require parentheses, and still accepts a coma-separated 
list of arguments


At 17:12 23/3/2001, Hartmut Holzgraefe wrote:
>Stefan Livieratos wrote:
> >
> > "Hartmut Holzgraefe" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > > does this return things like unset()?
> > > no it doesn't!
> > >
> > > there's a difference between builtin functions and language constructs
> >
> > You are right of course. I was misled by the example Cynic used. On the
> > other hand I don't know how useful a function that returns all
> > language constructs would be. Could someone give me an example for
> > using such a function in a sensible way?
>
>i just wanted to show that there are things that look like functions
>but aren't
>
>i'd suggest that those few should be added to the result of
>get_defined_functions, either under 'internal' or as a third
>block 'constructs'
>
>--
>Hartmut Holzgraefe  [EMAIL PROTECTED]  http://www.six.de  +49-711-99091-77
>
>Besuchen Sie uns auf der CeBIT 2001 - in Halle 6 Stand F62/4
>
>--
>PHP Development Mailing List 
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Zeev Suraski <[EMAIL PROTECTED]>
CTO &  co-founder, Zend Technologies Ltd. http://www.zend.com/


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Cynic

At 16:12 23.3. 2001, Hartmut Holzgraefe wrote the following:
-- 
>Stefan Livieratos wrote:
>> "Hartmut Holzgraefe" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
>> > there's a difference between builtin functions and language constructs
>> 
>> You are right of course. I was misled by the example Cynic used. On the
>> other hand I don't know how useful a function that returns all
>> language constructs would be. Could someone give me an example for
>> using such a function in a sensible way?

Well, that was a bad example, however, it stemmed from the fact I 
didn't know about get_defined_functions(), and get_loaded_extensions() /
get_extension_funcs() didn't show it (or I didn't find it).

As for the sensible purpose:
I'm writing phLXR. It's like LXR, except it's written in PHP, for PHP 
programs, and (me being still firmly rooted in the NT world) with 
portability in mind -> no Glimpse. I want the internal PHP stuff (be 
it a function, a "language construct" (who cares? it feels and tastes 
like a function!), or your coffee cup to be links to PHP documentation. 
And the more I can get automagically through a call, the less maintenance 
work will be required from the user.

BTW, this reminds me - how do I use the genfuncsummary / genfunclist 
scripts given I'm an NT (l)user?

>i just wanted to show that there are things that look like functions
>but aren't
>
>i'd suggest that those few should be added to the result of 
>get_defined_functions, either under 'internal' or as a third 
>block 'constructs'

good idea. also, makes one feel all warm inside when there's 
someone else of the same mind out there. :))



[EMAIL PROTECTED]
-
And the eyes of them both were opened and they saw that their files
were world readable and writable, so they chmoded 600 their files.
- Book of Installation chapt 3 sec 7 


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Hartmut Holzgraefe

Stefan Livieratos wrote:
> 
> "Hartmut Holzgraefe" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > does this return things like unset()?
> > no it doesn't!
> >
> > there's a difference between builtin functions and language constructs
> 
> You are right of course. I was misled by the example Cynic used. On the
> other hand I don't know how useful a function that returns all
> language constructs would be. Could someone give me an example for
> using such a function in a sensible way?

i just wanted to show that there are things that look like functions
but aren't

i'd suggest that those few should be added to the result of 
get_defined_functions, either under 'internal' or as a third 
block 'constructs'

-- 
Hartmut Holzgraefe  [EMAIL PROTECTED]  http://www.six.de  +49-711-99091-77 

Besuchen Sie uns auf der CeBIT 2001 - in Halle 6 Stand F62/4

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Zeev Suraski

What's the point of returning the language constructs though?  By 
definition, each of them has its own semantics, so I can't see any use for 
that...

Zeev

At 15:08 23/3/2001, Hartmut Holzgraefe wrote:
>Stefan Livieratos wrote:
> >
> > Hi,
> >
> > "Cynic" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Is there a way to get names of available "language constructs"
> > > in a PHP program? I mean, I don't think there's currently
> > > a way a PHP script can know if e. g. zend_version() is available
> > > (other than function_exists( 'zend_version' ), that is).
> > > Is something along get_builtin_constructs() possible?
> >
> > Take a look at get_defined_functions(),
> > http://www.php.net/manual/en/function.get-defined-functions.php .
>
>does this return things like unset()?
>no it doesn't!
>
>there's a difference between builtin functions and language constructs
>
>--
>Hartmut Holzgraefe  [EMAIL PROTECTED]  http://www.six.de  +49-711-99091-77
>
>Besuchen Sie uns auf der CeBIT 2001 - in Halle 6 Stand F62/4
>
>--
>PHP Development Mailing List 
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Zeev Suraski <[EMAIL PROTECTED]>
CTO &  co-founder, Zend Technologies Ltd. http://www.zend.com/


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Stefan Livieratos


"Hartmut Holzgraefe" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Stefan Livieratos wrote:
> >
> > Hi,
> >
> > "Cynic" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Is there a way to get names of available "language constructs"
> > > in a PHP program? I mean, I don't think there's currently
> > > a way a PHP script can know if e. g. zend_version() is available
> > > (other than function_exists( 'zend_version' ), that is).
> > > Is something along get_builtin_constructs() possible?
> >
> > Take a look at get_defined_functions(),
> > http://www.php.net/manual/en/function.get-defined-functions.php .
>
> does this return things like unset()?
> no it doesn't!
>
> there's a difference between builtin functions and language constructs

You are right of course. I was misled by the example Cynic used. On the
other hand I don't know how useful a function that returns all
language constructs would be. Could someone give me an example for
using such a function in a sensible way?

--
Stefan Livieratos [EMAIL PROTECTED]
http://www.ferry24.de



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Hartmut Holzgraefe

Stefan Livieratos wrote:
> 
> Hi,
> 
> "Cynic" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Is there a way to get names of available "language constructs"
> > in a PHP program? I mean, I don't think there's currently
> > a way a PHP script can know if e. g. zend_version() is available
> > (other than function_exists( 'zend_version' ), that is).
> > Is something along get_builtin_constructs() possible?
> 
> Take a look at get_defined_functions(),
> http://www.php.net/manual/en/function.get-defined-functions.php .

does this return things like unset()? 
no it doesn't!

there's a difference between builtin functions and language constructs

-- 
Hartmut Holzgraefe  [EMAIL PROTECTED]  http://www.six.de  +49-711-99091-77 

Besuchen Sie uns auf der CeBIT 2001 - in Halle 6 Stand F62/4

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] builtin functions / constructs

2001-03-23 Thread Stefan Livieratos

Hi,

"Cynic" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is there a way to get names of available "language constructs"
> in a PHP program? I mean, I don't think there's currently
> a way a PHP script can know if e. g. zend_version() is available
> (other than function_exists( 'zend_version' ), that is).
> Is something along get_builtin_constructs() possible?

Take a look at get_defined_functions(),
http://www.php.net/manual/en/function.get-defined-functions.php .

Regards,
Stefan


--
Stefan Livieratos [EMAIL PROTECTED]
http://www.ferry24.de



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] builtin functions / constructs

2001-03-22 Thread Cynic

Is there a way to get names of available "language constructs"
in a PHP program? I mean, I don't think there's currently 
a way a PHP script can know if e. g. zend_version() is available 
(other than function_exists( 'zend_version' ), that is). 
Is something along get_builtin_constructs() possible?


[EMAIL PROTECTED]
-
And the eyes of them both were opened and they saw that their files
were world readable and writable, so they chmoded 600 their files.
- Book of Installation chapt 3 sec 7 


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]