Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-18 Thread Lukas Kahwe Smith
Hello All, I just want to bring in a different perception on the proposed feature. I think people are very focused on what I call "library code". This is the kind of code that should in theory be worked on less, than the glue code that you write in every project to finish up the applicati

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-18 Thread Arvids Godjuks
+1 for strict types. That way it will be simple: * Don't need - then don't use at all * You need it - you use it fully. One thing than left to clearfy - do we allow to hint only part of args or do we go the road "if hint args, then hint them all!" (I'm personaly for second one - be strict)

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-18 Thread Arvids Godjuks
2008/4/18, Lukas Kahwe Smith <[EMAIL PROTECTED]>: > > Hello All, > > I just want to bring in a different perception on the proposed feature. I > think people are very focused on what I call "library code". This is the > kind of code that should in theory be worked on less, than the glue code > that

[PHP-DEV] Help with a PHP extension

2008-04-18 Thread Matt Parlane
Hi all... I am developing a PHP extension and I must confess that my C skills are not all that great. Is there anyone out there who would be able to lend a hand? The extension is very simple, it's only four functions and the whole thing comes to just over 300 lines of C. It's pretty much comple

Re: [PHP-DEV] Help with a PHP extension

2008-04-18 Thread Pierre Joye
Hi Matt, On Fri, Apr 18, 2008 at 9:55 AM, Matt Parlane <[EMAIL PROTECTED]> wrote: > I would be willing to make it worth your while - perhaps if you had an > Amazon wishlist (or similar), I could help out that way. > > Please reply privately if you can help me out. If it is open source, you ma

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-18 Thread Paul Biggar
On Fri, Apr 18, 2008 at 9:03 AM, Lukas Kahwe Smith <[EMAIL PROTECTED]> wrote: > Suddenly I need to ensure that all my variables have the proper types. So > what will people do? > > So maybe an "(int)" here or there > is not so much more code to type, but you can already see that code you safe

Re: [PHP-DEV] Help with a PHP extension

2008-04-18 Thread Matt Parlane
On Fri, Apr 18, 2008 at 8:00 PM, Pierre Joye <[EMAIL PROTECTED]> wrote: > If it is open source, you may consider to publish the code and ask for > help or advices in the PECL developer list or here. If it is not, > well, there is little hope to get any help :) I'm planning on open-sourcing it,

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-18 Thread Richard Quadling
On 18/04/2008, Arvids Godjuks <[EMAIL PROTECTED]> wrote: > +1 for strict types. > > That way it will be simple: > * Don't need - then don't use at all > * You need it - you use it fully. > > One thing than left to clearfy - do we allow to hint only part of args or do > we go the road "if hint

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-18 Thread Sam Barrow
On Fri, 2008-04-18 at 12:33 +0100, Richard Quadling wrote: > On 18/04/2008, Arvids Godjuks <[EMAIL PROTECTED]> wrote: > > +1 for strict types. > > > > That way it will be simple: > > * Don't need - then don't use at all > > * You need it - you use it fully. > > > > One thing than left to clearf

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-18 Thread Felipe Pena
Em Sex, 2008-04-18 às 10:22 +0300, Arvids Godjuks escreveu: > +1 for strict types. > > That way it will be simple: > * Don't need - then don't use at all > * You need it - you use it fully. > > One thing than left to clearfy - do we allow to hint only part of args > or do we go the road "if hint

[PHP-DEV] [PATCH] No runtime fetching of built-in global constants

2008-04-18 Thread Matt Wilmas
Hi all, I changed things so that the many "built-in" constants (CONST_PERSISTENT ones) will be replaced at compile-time, saving the FETCH_CONSTANT opcode, if these changes are usable. This was added for TRUE/FALSE/NULL 2 years ago, but seems like it can be done for "lots" of others too. Since th

[PHP-DEV] CVS Account Request: tetsuya

2008-04-18 Thread Tetsuya Nakase
Recently, my pear package has been accepted. So please give me the CVS account. Package: Services_Yahoo_JP My proposal is here. http://pear.php.net/pepr/pepr-proposal-show.php?id=545 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Object instantiation

2008-04-18 Thread Sam Barrow
I had a question about object instantiation. You can do this: function createObject() { return new myObject; } $result = createObject() -> myMethod(); But you can't do this: $result = new myObject -> myMethod(); Is there a technical reaosn as to why this can't be done? If not can this

[PHP-DEV] Array access on function returns

2008-04-18 Thread Kalle Sommer Nielsen
Hey Internals I've been wondering for quite some time why PHP doesn't allow you to access arrays when you assign it to a value like in Javascript: function ArrayTest(Array $range) { return($range); } $range = Array(1337 => Array('Hello World')); echo ArrayTest($range)[1337}; I would

Re: [PHP-DEV] Array access on function returns

2008-04-18 Thread Sam Barrow
On Fri, 2008-04-18 at 10:40 -0700, Kalle Sommer Nielsen wrote: > Hey Internals > > I've been wondering for quite some time why PHP doesn't allow you to access > arrays when you assign it to a value like in Javascript: > > function ArrayTest(Array $range) > { > return($range); > } > > $rang

Re: [PHP-DEV] Object instantiation

2008-04-18 Thread Stanislav Malyshev
Hi! $result = new myObject -> myMethod(); Is there a technical reason as to why this can't be done? If not can this be changed? I think this can not be parsed unambiguously. This could be new (expression with ->) or (new expression)->expression. E.g., what this means: $a = new $foo->bar();

Re: [PHP-DEV] Object instantiation

2008-04-18 Thread Sam Barrow
On Fri, 2008-04-18 at 11:42 -0700, Stanislav Malyshev wrote: > Hi! > > > $result = new myObject -> myMethod(); > > > > Is there a technical reason as to why this can't be done? If not can > > this be changed? > > I think this can not be parsed unambiguously. This could be new > (expression with

[PHP-DEV] FileInfo in 5.3/6.0

2008-04-18 Thread Kevin Waterson
Back in Jan/Feb of 2007 I raised the issue of including the pecl fileinfo package into 5.3 and 6.0. This idea was mostly regarded as a good idea as PHP lacks any method of checking file types, aside from checking the file extension. The lack of checking is, I feel, a major oversite in the package

Re: [PHP-DEV] json_encode() bug

2008-04-18 Thread Alan Knowles
This should really be fixed similar to the iconv //IGNORE flag - so that bad characters are just replaced with '?' We use it to render spam email summaries, and dont really care if the encoding is incorrect, just as long as it shows something. Throwing a warning without having a fix/workarou

Re: [PHP-DEV] Array access on function returns

2008-04-18 Thread Arvids Godjuks
2008/4/18, Sam Barrow <[EMAIL PROTECTED]>: > > On Fri, 2008-04-18 at 10:40 -0700, Kalle Sommer Nielsen wrote: > > Hey Internals > > > > I've been wondering for quite some time why PHP doesn't allow you to > access > > arrays when you assign it to a value like in Javascript: > > > > function ArrayTe