Re: [PHP] php_check_syntax loads functions and classes

2004-08-08 Thread John Holmes
Michael Scholl wrote:
I'm running PHP 5.0.0 with Apache 2.0.50 and have a problem with the
php_check_syntax function. When I use it, it loads all functions ans
classes. But I only want to check the syntax, not to load the files.
Is this a bug or a feature ?
Actually I found this bug (http://bugs.php.net/bug.php?id=27406) which 
has the answer we're all looking for: Don't misuse the function. Very 
helpful, eh? I added a comment to please enlighten us what the proper 
usage was, so maybe that'll help.

--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php_check_syntax loads functions and classes

2004-08-08 Thread John Holmes
Michael Scholl wrote:
I'm running PHP 5.0.0 with Apache 2.0.50 and have a problem with the
php_check_syntax function. When I use it, it loads all functions ans
classes. But I only want to check the syntax, not to load the files.
Is this a bug or a feature ?
I'd say it was a bug, but since the function isn't really documented, 
it's hard to say what the intent of the function is.

There's already this bug regarding the second parameter: 
http://bugs.php.net/bug.php?id=29454

This function seems really screwy anyhow. If I have a function foo() in 
the file I'm checking and a function foo() in the main PHP file declared 
after I check the syntax... I'll get a failure for checking the syntax 
of the file... even though there isn't one.

test.php

test1.php

I get the "Error in syntax" message although test1.php loads without 
error on it's own and the foo() call outputs "test.php::foo"...

I'm going to open up a bug report and go over some of this. Seems like a 
very handy function to have if it worked correctly.

--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php_check_syntax loads functions and classes

2004-08-08 Thread Michael Scholl
Hi,
I'm running PHP 5.0.0 with Apache 2.0.50 and have a problem with the
php_check_syntax function. When I use it, it loads all functions ans
classes. But I only want to check the syntax, not to load the files.
Is this a bug or a feature ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php