Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Christian Kaps
On Sun, 12 Sep 2010 11:55:16 -0700, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! 1. In Java annotations are a special type of an interface. But due the lack of type hinting for scalar values we cannot use this construct, because we cannot put some validation logic in an interface. My

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Nick Pope
Hi All, There seems to be a lot of discussion as to syntax for annotations at the moment. Firstly I'd like to say that I've never delved into PHP internals so may not understand some of the reasons why some of my suggestions may not work, so please don't give me a hard time about it! I

[PHP-DEV] [PATCH] Reduce heap memory consumption

2010-09-13 Thread Dmitry Stogov
Hi, The attached patch modifies internal ZE data structures. It gives 4% less heap memory usage on waiting PHP process (2210KB instead of 2304KB) and up to 7% improvement on applications with many classes (ZendFramework benchmark uses 17.7M instead of 19M). It also makes small speedup on some

[PHP-DEV] WSGI-like SAPI for PHP ?

2010-09-13 Thread FGM at GMail
Hello, Having to do some work in Python recently, I had to dig into WSGI and found that its model, much similar to what JSGI, PSGI, Rack do, seemed likely to bring a potentially high performance improvement on my usual (Drupal) environment. This also happened to match a remark done by Rasmus

答复: [PHP-DEV] WSGI-like SAPI for PHP ?

2010-09-13 Thread 高春辉
Support WSGI SAPI, WSGI more simple. -邮件原件- 发件人: FGM at GMail [mailto:fgmar...@gmail.com] 发送时间: 2010年9月13日 20:25 收件人: internals@lists.php.net 主题: [PHP-DEV] WSGI-like SAPI for PHP ? Hello, Having to do some work in Python recently, I had to dig into WSGI and found that its model, much

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Zeev Suraski
At 20:24 11/09/2010, Pierre Joye wrote: On Sat, Sep 11, 2010 at 8:19 PM, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! The separator never was a problem... but I definately don't want to see another 6 months just to define what would the separator be. If we need to drop [] in favor of

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Sebastian Bergmann
On 09/13/2010 09:05 AM, Zeev Suraski wrote: I for one don't see the huge gain annotations bring on top of PHPDoc. Same here, I am satisfied with the way that annotations work, for instance, in PHPUnit. -- Sebastian BergmannCo-Founder and Principal Consultant

Re: [PHP-DEV] WSGI-like SAPI for PHP ?

2010-09-13 Thread Dennis Hotson
On Mon, Sep 13, 2010 at 10:24 PM, FGM at GMail fgmar...@gmail.com wrote: Hello, Having to do some work in Python recently, I had to dig into WSGI and found that its model, much similar to what JSGI, PSGI, Rack do, seemed likely to bring a potentially high performance improvement on my usual

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Pierre Joye
hi, On Mon, Sep 13, 2010 at 3:05 PM, Zeev Suraski z...@zend.com wrote: I'm not sure we've seen a good reason to add annotations instead of using PHPDoc.  Sure, PHPDoc isn't a perfect fit for certain purposes, but I think it certainly falls in the good-enough fit for most purposes.  It's also

Re: [PHP-DEV] WSGI-like SAPI for PHP ?

2010-09-13 Thread Rasmus Lerdorf
On 9/13/10 5:24 AM, FGM at GMail wrote: Having to do some work in Python recently, I had to dig into WSGI and found that its model, much similar to what JSGI, PSGI, Rack do, seemed likely to bring a potentially high performance improvement on my usual (Drupal) environment. This also happened

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Zeev Suraski
At 16:39 13/09/2010, Pierre Joye wrote: You are not serioulsy suggesting to use phpdoc for runtime annotation support? Are you? I actually am (either that or get what you want done in some other way). It's a rare enough use case that I think it's a very reasonable compromise. The

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Benjamin Eberlei
I strongly disagree! PHPDocs are for what their name suggests, for comments, not for runtime code information. They allow arbitrary characters, their intent is for human-readible documentation only. Yet they are used for service description (Zend_Soap_Autodiscover, Zend_XmlRpc), metadata

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Zeev Suraski
Benjamin, Strictly speaking annotations are not *needed*. They simply aren't - you can do anything and everything you might want to do without them. You can argue that the value they bring is very important, and that it outweighs the complexity they bring upon to the language - in which

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Benjamin Eberlei
On Mon, 13 Sep 2010 17:28:47 +0200, Zeev Suraski z...@zend.com wrote: At 16:39 13/09/2010, Pierre Joye wrote: You are not serioulsy suggesting to use phpdoc for runtime annotation support? Are you? I actually am (either that or get what you want done in some other way). It's a rare

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Christian Kaps
Hi Benjamin, I agree with you 100 percent. Greetings, Christian On Mon, 13 Sep 2010 17:38:37 +0200, Benjamin Eberlei kont...@beberlei.de wrote: I strongly disagree! PHPDocs are for what their name suggests, for comments, not for runtime code information. They allow arbitrary characters,

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Gustavo Lopes
On Mon, 13 Sep 2010 16:28:47 +0100, Zeev Suraski z...@zend.com wrote: At 16:39 13/09/2010, Pierre Joye wrote: You are not serioulsy suggesting to use phpdoc for runtime annotation support? Are you? I actually am (either that or get what you want done in some other way). It's a rare enough

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Zeev Suraski
At 17:47 13/09/2010, Benjamin Eberlei wrote: This only applies to the weird suggestions of % or ! for the operator and new syntax constructs for arrays and such. Are there any objections to implementing them to actually look like PHP code? Yep. It's a whole new branch of syntax even w/o the

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Zeev Suraski
At 17:51 13/09/2010, Gustavo Lopes wrote: On Mon, 13 Sep 2010 16:28:47 +0100, Zeev Suraski z...@zend.com wrote: At 16:39 13/09/2010, Pierre Joye wrote: You are not serioulsy suggesting to use phpdoc for runtime annotation support? Are you? I actually am (either that or get what you want

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Gustavo Lopes
On Mon, 13 Sep 2010 16:59:13 +0100, Zeev Suraski z...@zend.com wrote: At 17:51 13/09/2010, Gustavo Lopes wrote: On Mon, 13 Sep 2010 16:28:47 +0100, Zeev Suraski z...@zend.com wrote: At 16:39 13/09/2010, Pierre Joye wrote: You are not serioulsy suggesting to use phpdoc for runtime annotation

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Zeev Suraski
At 17:51 13/09/2010, Gustavo Lopes wrote: On Mon, 13 Sep 2010 16:28:47 +0100, Zeev Suraski z...@zend.com wrote: The fact that PHP is not C# or Java doesn't mean we shouldn't look for useful features in those languages, Right. so it's not an argument. I think it is very much an argument -

[PHP-DEV] undefined function pcntl_fork

2010-09-13 Thread Bharat Nagwani
Hello, I am getting this error when using pcntl_fork. The OS is bsd and php ver is 5.2.3 used in cgi mode. Fatal error: Call to undefined function pcntl_fork() in... I have included the ext/pcntl files in the php make. Do I need another flag/library to include pcntl? Thanks

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Rasmus Lerdorf
On 9/13/10 8:38 AM, Benjamin Eberlei wrote: The primary target for annotations are framework and library integrations: validation, forms, metadata mapping, static mvc configuration such as routing, view selection or acls. Why do these features not exist with current php libraries yet? Because

Re: [PHP-DEV] undefined function pcntl_fork

2010-09-13 Thread Brian Moon
On 9/13/10 11:59 AM, Bharat Nagwani wrote: Hello, I am getting this error when using pcntl_fork. The OS is bsd and php ver is 5.2.3 used in cgi mode. Fatal error: Call to undefined function pcntl_fork() in... I have included the ext/pcntl files in the php make. Do I need another flag/library

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Stas Malyshev
Hi! [ExpectedException(InvalidArgumentException)] [ExpectedException(InvalidArgumentException, Expected message, 40)] [Validation(array(type = EMail, options = array(checkMX = true))] This doesn't look like PHP code. In PHP code, nether [] by itself, nor [ClassName('string')] mean

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Gustavo Lopes
On Mon, 13 Sep 2010 17:46:42 +0100, Zeev Suraski z...@zend.com wrote: I wasn't talking about the patch, I was talking about the need of end users to understand yet another new concept and syntax. PHP used to be a language one could pick up over a weekend. I'm happy it didn't stagnate

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Benjamin Eberlei
Hello Rasmus, Isn't any configuration by xml or ini files runtime configuration? Any configuration that is not resulting in code being generated or code being op-code cached will be-executed on every single request. That applies to almost any configuration mechanism used in PHP applications.

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Guilherme Blanco
Hi Zeev, On Mon, Sep 13, 2010 at 12:44 PM, Zeev Suraski z...@zend.com wrote: Benjamin, Strictly speaking annotations are not *needed*.  They simply aren't - you can do anything and everything you might want to do without them.  You can argue that the value they bring is very important, and

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Stas Malyshev
Hi! - LSB. Can you explain from the top of your head when when the called scope is reset or not (e.g. with parent::, self::, className::, possibly in non-static contexts) in a function call? I can't. It's not that hard. Keywords forward, classnames don't. - Namespaces. It takes a while to

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Zeev Suraski
At 19:25 13/09/2010, Gustavo Lopes wrote: On Mon, 13 Sep 2010 17:46:42 +0100, Zeev Suraski z...@zend.com wrote: I wasn't talking about the patch, I was talking about the need of end users to understand yet another new concept and syntax. PHP used to be a language one could pick up over a

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Stas Malyshev
Hi! PHPDocs are for what their name suggests, for comments, not for runtime code information. They allow arbitrary characters, their intent is for human-readible documentation only. Nothing prevents us from using phpdocs for non-human-reading purposes. Actually, there is quite a lot of code

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Benjamin Eberlei
Strictly speaking yes, you can implement everything you want with PHP Docblocks. But that argument is comparable to telling a nearly blind man that his glasses are good enough although a more suited treatment exists. Just because there exists an approach that stumbles half the way in a bad way,

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Gustavo Lopes
On Mon, 13 Sep 2010 19:20:31 +0100, Stas Malyshev smalys...@sugarcrm.com wrote: The proposed annotations are basically object instances that are returned when you call getAnnotations. There are no itemized lists of rules. I don't see how this is complex. They aren't just object

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Stas Malyshev
Hi! The best (in the sense of most similar to what we have today) syntax I can think of is to define annotations exactly the same way was you'd define arrays, but replace array with the annotation name (plus a prefix). I think this looks like PHP: We have here at least two non-PHP constructs

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Gustavo Lopes
On Mon, 13 Sep 2010 21:02:34 +0100, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! The best (in the sense of most similar to what we have today) syntax I can think of is to define annotations exactly the same way was you'd define arrays, but replace array with the annotation name (plus a

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Stas Malyshev
Hi! If I'm not mistaken, the current implementation instantiates an object each time getAnnotation() is called, but it was proposed to change this into a lazy-loading mechanism with the same instance returned every time for each annotation. In that case, we'd only need to validate that one

Re: [PHP-DEV] Re: PHP Annotations RFC + Patch

2010-09-13 Thread Gustavo Lopes
On Mon, 13 Sep 2010 21:51:32 +0100, Stas Malyshev smalys...@sugarcrm.com wrote: If I'm not mistaken, the current implementation instantiates an object each time getAnnotation() is called, but it was proposed to change this into a lazy-loading mechanism with the same instance returned every