Hi!
I think by now, whatever you think on strict typing/typehints, it is
clear to everybody that there's no consensus about this feature, and
with Rasmus, Zeev & Andi, along with many others, being against it, as
of now it can not be a part of an official PHP release.
On the other hand, we have tons of cool features in trunk which aren't
controversial and that we do want people to try out.
So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current
trunk and then rolling back the typing part in the trunk). - Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
People that like the typing can still have them in the branch (and they
can keep the branch as current as they want) and if we ever See The
Light (TM) and want typed scalar parameters back, they're only a merge
away.
What do you think?
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Hi
2010/8/11 Stas Malyshev smalyshev@sugarcrm.com:
So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current trunk
and then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
+1 for moving the type hinting to a feature branch, and merging it
back when the discussions about the implementations are over. I don't
think type hinting should be the show stopper here and we can always
change the code afterwards like we did with namespaces in the 5.3
development days.
--
regards,
Kalle Sommer Nielsen
kalle@php.net
So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current trunk and
then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
A little bit; yes. There is indeed 0 consensus for having the strict
typehints. However, instead of removing it altogether, and instead
answering every mail in this thread :P, I wrote/am writing a patch that
removes the hard type checks. It however keeps the parsed structures and
reflection API for it. In this sense, they're actually real hints. The
patch also adds a mechanism similariy to the zend_error_cb mechanism so
that extensions could override the argument type checking. As my use
case for strict checking is development I'd be happy to just move the
hard checks into an extension. I could even offer a soft check. It also
allows some type inference which might be useful for webservice
introspecition generation. I am sure SOAP might have some benefit of
this, and I know that at least pecl/dbus does. The patch is attached,
but not ready (I haven't remove the hard checks yet because things got
busy at work).
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Derick,
How is it different from having both options? Given enough time
isn't it exactly the same thing? Argument verification should not be
a customizable feature.
Collecting the info (for documentation purposes and reflection) is
something else and I think that's fine - and then the only question
that remains is the syntax (which IIRC includes modifiers for
strict/weak that we should probably clean up).
Zeev
At 21:38 11/08/2010, Derick Rethans wrote:
So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching
current trunk and
then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
A little bit; yes. There is indeed 0 consensus for having the strict
typehints. However, instead of removing it altogether, and instead
answering every mail in this thread :P, I wrote/am writing a patch that
removes the hard type checks. It however keeps the parsed structures and
reflection API for it. In this sense, they're actually real hints. The
patch also adds a mechanism similariy to the zend_error_cb mechanism so
that extensions could override the argument type checking. As my use
case for strict checking is development I'd be happy to just move the
hard checks into an extension. I could even offer a soft check. It also
allows some type inference which might be useful for webservice
introspecition generation. I am sure SOAP might have some benefit of
this, and I know that at least pecl/dbus does. The patch is attached,
but not ready (I haven't remove the hard checks yet because things got
busy at work).Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
(after clarification on what Zeev meant, there was a bit of a follow up
that I'm posting as reply):
How is it different from having both options? Given enough time isn't
it exactly the same thing? Argument verification should not be a
customizable feature.Collecting the info (for documentation purposes and reflection) is
something else and I think that's fine - and then the only question
that remains is the syntax (which IIRC includes modifiers for
strict/weak that we should probably clean up).If I understood the idea behind the patch, you want to pass on the
argument validation function to the engine on startup. That means
that overnight there'll be a version of PHP supporting different
validation functions. Or am I missing something?
Well, PHP wouldn't support it directly. But it would allow a zend
extension like Xdebug to provide a strict validation function while
debugging and development. Very similar to the overloaded zend_error_cb
and var_dump()
function. During production you'd obviously not have a
caster/strict type validator.
It seems quite clear that "you lot" don't like a strict type check;
whereas another lot don't like a casting typecast. I'd be much for your
option #3 (no scalar type hint/cast/strict check by default); but still
allow other tools to access the information that's been supplied by the
parser. That doesn't even necessarily have to be an argument
validator/cast/type check of course; but simple introspection tools that
makes marshalling data to other more type-sensitive data sources. I've
been working with MongoDB here for the past week, and that'd be such a
data source.
Derick
At 21:38 11/08/2010, Derick Rethans wrote:
So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current trunk
and
then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
A little bit; yes. There is indeed 0 consensus for having the strict
typehints. However, instead of removing it altogether, and instead
answering every mail in this thread :P, I wrote/am writing a patch that
removes the hard type checks. It however keeps the parsed structures and
reflection API for it. In this sense, they're actually real hints. The
patch also adds a mechanism similariy to the zend_error_cb mechanism so
that extensions could override the argument type checking. As my use
case for strict checking is development I'd be happy to just move the
hard checks into an extension. I could even offer a soft check. It also
allows some type inference which might be useful for webservice
introspecition generation. I am sure SOAP might have some benefit of
this, and I know that at least pecl/dbus does. The patch is attached,
but not ready (I haven't remove the hard checks yet because things got
busy at work).Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug--
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Am 12.08.2010 10:31, schrieb Derick Rethans:
Well, PHP wouldn't support it directly. But it would allow a zend
extension like Xdebug to provide a strict validation function while
debugging and development. Very similar to the overloaded zend_error_cb
andvar_dump()
function. During production you'd obviously not have a
caster/strict type validator.
Sounds reasonable to me.
--
Sebastian Bergmann Co-Founder and Principal Consultant
http://sebastian-bergmann.de/ http://thePHP.cc/
Sebastian Bergmann wrote:
Am 12.08.2010 10:31, schrieb Derick Rethans:
Well, PHP wouldn't support it directly. But it would allow a zend
extension like Xdebug to provide a strict validation function while
debugging and development. Very similar to the overloaded zend_error_cb
andvar_dump()
function. During production you'd obviously not have a
caster/strict type validator.Sounds reasonable to me.
It's funny how you and Derick agree on this, just as I've finished a new
tool which doesn't implement the exact functionality (certainly not in
the PHP core), but uses Xdebug and PHPUnit to perform parameter type
verification.
You could call it an in-between solution between the current situation,
where we have no scalar type hinting, and the proposed type hinting
solution that was discussed in the past few weeks, with an added benefit
that it doesn't require PHP core changes and doesn't cause any
production performance degradation.
Basically, I got fed up with developers writing functions with
ever-changing parameter types, parameter order and return types, causing
unit tests to fail (best-case) or untested code to fail (worst-case).
Short example (crappy code, without error handling) :
-
We have a CSV formatted data file, generated from an external source,
that we need to process (fields are : employeeId, firstname, lastname,
wage, pay) :
1, Claire, Clarckson, 2900, 1
2, Tom, Whitney, 1932, 1
4, Jules, Verne, 2131, 0
6, Gregory, Jameson, 2143, 1 -
People with 'pay' set to 1 should be paid. So we have some code :
public function processFile($filename)
{
$data = file($filename);
foreach ($data as $line) {
processLine($line[0], $line[3], $line[4]);
}
}
public function processLine($employeeId, $wage, $pay)
{
if ($pay) {
sendPayCheck($employeeId, $wage);
}
}
- Not the best code, but it's the kind of code you see everywhere. And
it will work just fine, until someone decides to export the data like this :
1, Claire, Clarckson, 2900, true
2, Tom, Whitney, 1932, true
4, Jules, Verne, 2131, false
6, Gregory, Jameson, 2143, true - From that point onwards, everyone will be paid, since the string
"false" is boolean true. - If you wrote unit tests to test the above code with some sample
(non-live) data you keep in a file (which is the case for most mock
tests), they will still pass, since they don't anticipate the changing
format. - We should probably validate the incoming data, but as I said this is
an example to illustrate the type of issues that exist.
This is where my little PHPUnit addon comes in : it uses Xdebug's trace
functionality to verify if the parameters being passed to and returned
from a function/method are of the same type as the one(s) specified in
the docblock.
The advantages of doing this are :
- Verification that you're not passing data with different data types
than the one expected - Verification that the docblock is correct (a developer might have
changed code, but forgotten to update the docblock), so your API docs
will be consistent - You can actually rely on the correct type being passed to your
function, which basically means that, if everyone inside your company
uses this tool, you can get rid of tons of is_bool, is_int, etc tests
that a lot of people build into their code now (except when using
external data sources)
Having some level of type validation can greatly improve consistency and
stability, especially for libraries that are used across multiple
projects. We use the same base library for each project and usign this
addon we have discovered a few issues with incorrect type usage, one of
which explained an elusive bug.
Anyways, for those of you interested in checking it out :
- I made a github fork on the PHPUnit project :
http://github.com/wimg/phpunit - If you want to verify return types, you will need an Xdebug patch :
http://xdebug.org/archives/xdebug-general/1870.html (hoping Derick will
include it in the next Xdebug release) - More information about the whole addon --> see my blog post here :
http://techblog.wimgodden.be/2010/08/15/using-phpunit-to-verify-parameter-types-revisited/
Looking forward to any feedback !
Am 15.08.2010 15:42, schrieb Wim Godden:
Looking forward to any feedback !
Have you looked at http://github.com/troelskn/php-tracer-weaver? It is
similar to what you are doing (though not integrated with PHPUnit).
--
Sebastian Bergmann Co-Founder and Principal Consultant
http://sebastian-bergmann.de/ http://thePHP.cc/
Sebastian Bergmann wrote:
Am 15.08.2010 15:42, schrieb Wim Godden:
Looking forward to any feedback !
Have you looked at http://github.com/troelskn/php-tracer-weaver? It is
similar to what you are doing (though not integrated with PHPUnit).
First time I came across this. But there's a significant difference : it
generates docblocks based on runtime analysis, which is exactly what you
don't want to be doing (unless you have an old project which has no
docblocks and you don't want to go over the code manually to see which
types would be appropriate in which function/method).
Additionally, it will work on single PHP files, but (as far as I can
tell) it won't work on anything that has more than a 1-on-1 relationship
between file and generated page.
The only other tool I discovered that did some sort of type validation
is Phantm (see
http://www.colder.ch/news/08-18-2010/38/phantm-continued.html), which
does static analysis, but again only in single files... and it uses
Scala (java required) to do all this.
I've been thinking about building a tool that just uses Xdebug output on
a development or testing environment to detect type issues on the actual
runtime code, but that's just plain idiotic : it creates massive files
if you run it using frameworks and unless you built the entire codebase
from scratch while having the system enabled, even a single external
library will throw tons of warnings.
That's basically why I wrote it as a PHPUnit patch. Too bad I can't
actually build it as a true pluggable extension.
Do you see this as having a possible future within PHPUnit ?
Kind regards,
Wim
So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current trunk and
then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
A little bit; yes. There is indeed 0 consensus for having the strict
typehints. However, instead of removing it altogether, and instead
answering every mail in this thread :P, I wrote/am writing a patch that
removes the hard type checks. It however keeps the parsed structures and
reflection API for it. In this sense, they're actually real hints. The
patch also adds a mechanism similariy to the zend_error_cb mechanism so
that extensions could override the argument type checking. As my use
case for strict checking is development I'd be happy to just move the
hard checks into an extension. I could even offer a soft check. It also
allows some type inference which might be useful for webservice
introspecition generation. I am sure SOAP might have some benefit of
this, and I know that at least pecl/dbus does. The patch is attached,
but not ready (I haven't remove the hard checks yet because things got
busy at work).
I've spend some more time on this, and have attached a new patch that:
- Removes the strict type verification, changing it back into typehints
only. - Keeps the current syntax so that typehints create structures in the
function entries. - Keeps the reflection API for the syntax, so that you can query the
typehints. - Changed the API so that the verification function can also modify the
variables.
I've also written a proof of concept extension at
svn://svn.xdebug.org/svn/php/typed and
http://svn.xdebug.org/cgi-bin/viewvc.cgi/typed/?root=php that implements
both the current strict-type verification, and a form of the "option 1"
from
http://wiki.php.net/rfc/typecheckingstrictandweak#option_1_current_type_juggeling_rules_with_e_strict_on_data_loss
(I've not done the E_STRICT
warnings for all, as the RFC didn't specifiy
when data loss was considered to occur).
Here follows an example script:
<?php
function errorHandler( $errno, $string )
{
global $ok;
$ok = $errno;
return true;
}
set_error_handler( 'errorHandler' );
$twelve = 12;
settype( $twelve, 'float' );
$values = array(
true, false,
0, 1, 12, $twelve, 12.23,
'true', 'false',
'0', '1', '12', '12abc', '12.0', '12.34', 'foo',
array(1,2,3), array('345' => 12),
NULL, ''
);
$funcs = array(
'testString', 'testFloat', 'testInt', 'testNumeric', 'testScalar', 'testBool', 'testArray',
);
function testString( string $a ) { }
function testFloat( float $a ) { }
function testInt( int $a ) { }
function testBool( boolean $a ) { }
function testArray( array $a ) { }
function testNumeric( numeric $a ) { }
function testScalar( scalar $a ) { }
echo "string float int numeric scalar bool array\n";
foreach( $values as $value )
{
foreach( $funcs as $func )
{
$ok = true;
$func($value);
echo $ok === true ? "pass " : ( $ok === 0x1000 ? "fail " : "warn " );
}
echo ' ', str_replace( "\n", '', var_export( $value, true ) );
echo "\n";
}
?>
And the output (with the three different validation/verification methods:
No validation/verification:
derick@kossu:/home/httpd/html/test/verify-arg$ php -dextension=typed.so -dtyped.mode=0 option2.php
string float int numeric scalar bool array
pass pass pass pass pass pass fail true
pass pass pass pass pass pass fail false
pass pass pass pass pass pass fail 0
pass pass pass pass pass pass fail 1
pass pass pass pass pass pass fail 12
pass pass pass pass pass pass fail 12
pass pass pass pass pass pass fail 12.23
pass pass pass pass pass pass fail 'true'
pass pass pass pass pass pass fail 'false'
pass pass pass pass pass pass fail '0'
pass pass pass pass pass pass fail '1'
pass pass pass pass pass pass fail '12'
pass pass pass pass pass pass fail '12abc'
pass pass pass pass pass pass fail '12.0'
pass pass pass pass pass pass fail '12.34'
pass pass pass pass pass pass fail 'foo'
pass pass pass pass pass pass pass array ( 0 => 1, 1 => 2, 2 => 3,)
pass pass pass pass pass pass pass array ( 345 => 12,)
pass pass pass pass pass pass fail `NULL`
pass pass pass pass pass pass fail ''
Script type-checks:
derick@kossu:/home/httpd/html/test/verify-arg$ php -dextension=typed.so -dtyped.mode=1 option2.php
string float int numeric scalar bool array
fail fail fail fail pass pass fail true
fail fail fail fail pass pass fail false
fail fail pass pass pass fail fail 0
fail fail pass pass pass fail fail 1
fail fail pass pass pass fail fail 12
fail pass fail pass pass fail fail 12
fail pass fail pass pass fail fail 12.23
pass fail fail fail pass fail fail 'true'
pass fail fail fail pass fail fail 'false'
pass fail fail pass pass fail fail '0'
pass fail fail pass pass fail fail '1'
pass fail fail pass pass fail fail '12'
pass fail fail fail pass fail fail '12abc'
pass fail fail pass pass fail fail '12.0'
pass fail fail pass pass fail fail '12.34'
pass fail fail fail pass fail fail 'foo'
fail fail fail fail fail fail pass array ( 0 => 1, 1 => 2, 2 => 3,)
fail fail fail fail fail fail pass array ( 345 => 12,)
fail fail fail fail fail fail fail `NULL`
pass fail fail fail pass fail fail ''
"Option 1" type-casting:
derick@kossu:/home/httpd/html/test/verify-arg$ php -dextension=typed.so -dtyped.mode=2 option2.php
string float int numeric scalar bool array
pass pass pass fail pass pass fail true
pass pass pass fail pass pass fail false
pass pass pass pass pass pass fail 0
pass pass pass pass pass pass fail 1
pass pass pass pass pass pass fail 12
pass pass warn pass pass pass fail 12
pass pass warn pass pass pass fail 12.23
pass fail warn fail pass pass fail 'true'
pass fail warn fail pass pass fail 'false'
pass pass pass pass pass pass fail '0'
pass pass pass pass pass pass fail '1'
pass pass pass pass pass pass fail '12'
pass fail warn fail pass pass fail '12abc'
pass pass pass pass pass pass fail '12.0'
pass pass pass pass pass pass fail '12.34'
pass fail warn fail pass pass fail 'foo'
fail fail fail fail fail fail pass array ( 0 => 1, 1 => 2, 2 => 3,)
fail fail fail fail fail fail pass array ( 345 => 12,)
pass pass pass fail fail pass fail `NULL`
pass fail warn fail pass pass fail ''
I'd hope to commit this patch in the next week or so, so that we can get
started with 5.4.
regards,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Hi Derick,
We had a long discussion on RFC and hear you can see the summary of my
opinion:
I think removing the "strict" type hinting (reverting semantic back to
5.3), but keeping the new syntax and reflection API is a good decision.
However I definitely against of "delegation" of type-hinting logic into
different location. PHP should be a solid language with single semantic.
This delegation (zend_verify_arg_type callback) allows any extension to
change schematic as it want and this may lead us into situation when
some scripts will work properly only with or without Xdebug (or other
extension). It also restricts possibilities to optimize ZE and introduce
performance lose (now each ZEND_RECV opcode have to call this callback).
Anyway performance is not the main problem because the patch may be
optimized to call callback only if it's defined.
I would suggest to go forward with this decision partially (without
callback and without zval** instead of zval*)
I hope in some point we will come to conclusion about type-hinting...
Thanks. Dmitry.
Derick Rethans wrote:
So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current trunk and
then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
A little bit; yes. There is indeed 0 consensus for having the strict
typehints. However, instead of removing it altogether, and instead
answering every mail in this thread :P, I wrote/am writing a patch that
removes the hard type checks. It however keeps the parsed structures and
reflection API for it. In this sense, they're actually real hints. The
patch also adds a mechanism similariy to the zend_error_cb mechanism so
that extensions could override the argument type checking. As my use
case for strict checking is development I'd be happy to just move the
hard checks into an extension. I could even offer a soft check. It also
allows some type inference which might be useful for webservice
introspecition generation. I am sure SOAP might have some benefit of
this, and I know that at least pecl/dbus does. The patch is attached,
but not ready (I haven't remove the hard checks yet because things got
busy at work).I've spend some more time on this, and have attached a new patch that:
- Removes the strict type verification, changing it back into typehints
only.- Keeps the current syntax so that typehints create structures in the
function entries.- Keeps the reflection API for the syntax, so that you can query the
typehints.- Changed the API so that the verification function can also modify the
variables.I've also written a proof of concept extension at
svn://svn.xdebug.org/svn/php/typed and
http://svn.xdebug.org/cgi-bin/viewvc.cgi/typed/?root=php that implements
both the current strict-type verification, and a form of the "option 1"
from
http://wiki.php.net/rfc/typecheckingstrictandweak#option_1_current_type_juggeling_rules_with_e_strict_on_data_loss
(I've not done theE_STRICT
warnings for all, as the RFC didn't specifiy
when data loss was considered to occur).Here follows an example script:
<?php
function errorHandler( $errno, $string )
{
global $ok;
$ok = $errno;
return true;
}set_error_handler( 'errorHandler' );
$twelve = 12;
settype( $twelve, 'float' );$values = array(
true, false,
0, 1, 12, $twelve, 12.23,
'true', 'false',
'0', '1', '12', '12abc', '12.0', '12.34', 'foo',
array(1,2,3), array('345' => 12),
NULL, ''
);
$funcs = array(
'testString', 'testFloat', 'testInt', 'testNumeric', 'testScalar', 'testBool', 'testArray',
);function testString( string $a ) { }
function testFloat( float $a ) { }
function testInt( int $a ) { }
function testBool( boolean $a ) { }
function testArray( array $a ) { }
function testNumeric( numeric $a ) { }
function testScalar( scalar $a ) { }echo "string float int numeric scalar bool array\n";
foreach( $values as $value )
{
foreach( $funcs as $func )
{
$ok = true;
$func($value);
echo $ok === true ? "pass " : ( $ok === 0x1000 ? "fail " : "warn " );
}
echo ' ', str_replace( "\n", '', var_export( $value, true ) );
echo "\n";
}
?>And the output (with the three different validation/verification methods:
No validation/verification:
derick@kossu:/home/httpd/html/test/verify-arg$ php -dextension=typed.so -dtyped.mode=0 option2.php
string float int numeric scalar bool array
pass pass pass pass pass pass fail true
pass pass pass pass pass pass fail false
pass pass pass pass pass pass fail 0
pass pass pass pass pass pass fail 1
pass pass pass pass pass pass fail 12
pass pass pass pass pass pass fail 12
pass pass pass pass pass pass fail 12.23
pass pass pass pass pass pass fail 'true'
pass pass pass pass pass pass fail 'false'
pass pass pass pass pass pass fail '0'
pass pass pass pass pass pass fail '1'
pass pass pass pass pass pass fail '12'
pass pass pass pass pass pass fail '12abc'
pass pass pass pass pass pass fail '12.0'
pass pass pass pass pass pass fail '12.34'
pass pass pass pass pass pass fail 'foo'
pass pass pass pass pass pass pass array ( 0 => 1, 1 => 2, 2 => 3,)
pass pass pass pass pass pass pass array ( 345 => 12,)
pass pass pass pass pass pass failNULL
pass pass pass pass pass pass fail ''Script type-checks:
derick@kossu:/home/httpd/html/test/verify-arg$ php -dextension=typed.so -dtyped.mode=1 option2.php
string float int numeric scalar bool array
fail fail fail fail pass pass fail true
fail fail fail fail pass pass fail false
fail fail pass pass pass fail fail 0
fail fail pass pass pass fail fail 1
fail fail pass pass pass fail fail 12
fail pass fail pass pass fail fail 12
fail pass fail pass pass fail fail 12.23
pass fail fail fail pass fail fail 'true'
pass fail fail fail pass fail fail 'false'
pass fail fail pass pass fail fail '0'
pass fail fail pass pass fail fail '1'
pass fail fail pass pass fail fail '12'
pass fail fail fail pass fail fail '12abc'
pass fail fail pass pass fail fail '12.0'
pass fail fail pass pass fail fail '12.34'
pass fail fail fail pass fail fail 'foo'
fail fail fail fail fail fail pass array ( 0 => 1, 1 => 2, 2 => 3,)
fail fail fail fail fail fail pass array ( 345 => 12,)
fail fail fail fail fail fail failNULL
pass fail fail fail pass fail fail ''"Option 1" type-casting:
derick@kossu:/home/httpd/html/test/verify-arg$ php -dextension=typed.so -dtyped.mode=2 option2.php
string float int numeric scalar bool array
pass pass pass fail pass pass fail true
pass pass pass fail pass pass fail false
pass pass pass pass pass pass fail 0
pass pass pass pass pass pass fail 1
pass pass pass pass pass pass fail 12
pass pass warn pass pass pass fail 12
pass pass warn pass pass pass fail 12.23
pass fail warn fail pass pass fail 'true'
pass fail warn fail pass pass fail 'false'
pass pass pass pass pass pass fail '0'
pass pass pass pass pass pass fail '1'
pass pass pass pass pass pass fail '12'
pass fail warn fail pass pass fail '12abc'
pass pass pass pass pass pass fail '12.0'
pass pass pass pass pass pass fail '12.34'
pass fail warn fail pass pass fail 'foo'
fail fail fail fail fail fail pass array ( 0 => 1, 1 => 2, 2 => 3,)
fail fail fail fail fail fail pass array ( 345 => 12,)
pass pass pass fail fail pass failNULL
pass fail warn fail pass pass fail ''I'd hope to commit this patch in the next week or so, so that we can get
started with 5.4.regards,
Derick
Hi!
I would suggest to go forward with this decision partially (without
callback and without zval** instead of zval*)
Actually, if we have the information in the data structures, wouldn't it
be pretty easy for xdebug (or any other extension), while intercepting
function entrance (which everybody knows how to do by now) just go ahead
and check the args without needing extra stuff done?
I'm not sure from the top of my head about the modification, but since
zend_parse_parameters manages to do it maybe it's possible?
In any case, I guess leaving the syntax in could be a compromise, though
I foresee people complaining about "consistency".
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Hi!
I've spend some more time on this, and have attached a new patch that:
- Removes the strict type verification, changing it back into typehints
only.- Keeps the current syntax so that typehints create structures in the
function entries.- Keeps the reflection API for the syntax, so that you can query the
typehints.- Changed the API so that the verification function can also modify the
variables.
I've just committed that patch, the implements the 3 first elements from
this list. I've also updated my little extension to behave in the same
way as it did with the previous patch:
I've also written a proof of concept extension at
svn://svn.xdebug.org/svn/php/typed and
http://svn.xdebug.org/cgi-bin/viewvc.cgi/typed/?root=php that implements
both the current strict-type verification, and a form of the "option 1"
from
http://wiki.php.net/rfc/typecheckingstrictandweak#option_1_current_type_juggeling_rules_with_e_strict_on_data_loss
(I've not done theE_STRICT
warnings for all, as the RFC didn't specifiy
when data loss was considered to occur).Here follows an example script:
<?php
function errorHandler( $errno, $string )
{
global $ok;
$ok = $errno;
return true;
}set_error_handler( 'errorHandler' );
$twelve = 12;
settype( $twelve, 'float' );$values = array(
true, false,
0, 1, 12, $twelve, 12.23,
'true', 'false',
'0', '1', '12', '12abc', '12.0', '12.34', 'foo',
array(1,2,3), array('345' => 12),
NULL, ''
);
$funcs = array(
'testString', 'testFloat', 'testInt', 'testNumeric', 'testScalar', 'testBool', 'testArray',
);function testString( string $a ) { }
function testFloat( float $a ) { }
function testInt( int $a ) { }
function testBool( boolean $a ) { }
function testArray( array $a ) { }
function testNumeric( numeric $a ) { }
function testScalar( scalar $a ) { }echo "string float int numeric scalar bool array\n";
foreach( $values as $value )
{
foreach( $funcs as $func )
{
$ok = true;
$func($value);
echo $ok === true ? "pass " : ( $ok === 0x1000 ? "fail " : "warn " );
}
echo ' ', str_replace( "\n", '', var_export( $value, true ) );
echo "\n";
}
?>And the output (with the three different validation/verification methods:
No validation/verification:
derick@kossu:/home/httpd/html/test/verify-arg$ php -dextension=typed.so -dtyped.mode=0 option2.php
string float int numeric scalar bool array
pass pass pass pass pass pass fail true
pass pass pass pass pass pass fail false
pass pass pass pass pass pass fail 0
pass pass pass pass pass pass fail 1
pass pass pass pass pass pass fail 12
pass pass pass pass pass pass fail 12
pass pass pass pass pass pass fail 12.23
pass pass pass pass pass pass fail 'true'
pass pass pass pass pass pass fail 'false'
pass pass pass pass pass pass fail '0'
pass pass pass pass pass pass fail '1'
pass pass pass pass pass pass fail '12'
pass pass pass pass pass pass fail '12abc'
pass pass pass pass pass pass fail '12.0'
pass pass pass pass pass pass fail '12.34'
pass pass pass pass pass pass fail 'foo'
pass pass pass pass pass pass pass array ( 0 => 1, 1 => 2, 2 => 3,)
pass pass pass pass pass pass pass array ( 345 => 12,)
pass pass pass pass pass pass failNULL
pass pass pass pass pass pass fail ''Script type-checks:
derick@kossu:/home/httpd/html/test/verify-arg$ php -dextension=typed.so -dtyped.mode=1 option2.php
string float int numeric scalar bool array
fail fail fail fail pass pass fail true
fail fail fail fail pass pass fail false
fail fail pass pass pass fail fail 0
fail fail pass pass pass fail fail 1
fail fail pass pass pass fail fail 12
fail pass fail pass pass fail fail 12
fail pass fail pass pass fail fail 12.23
pass fail fail fail pass fail fail 'true'
pass fail fail fail pass fail fail 'false'
pass fail fail pass pass fail fail '0'
pass fail fail pass pass fail fail '1'
pass fail fail pass pass fail fail '12'
pass fail fail fail pass fail fail '12abc'
pass fail fail pass pass fail fail '12.0'
pass fail fail pass pass fail fail '12.34'
pass fail fail fail pass fail fail 'foo'
fail fail fail fail fail fail pass array ( 0 => 1, 1 => 2, 2 => 3,)
fail fail fail fail fail fail pass array ( 345 => 12,)
fail fail fail fail fail fail failNULL
pass fail fail fail pass fail fail ''"Option 1" type-casting:
derick@kossu:/home/httpd/html/test/verify-arg$ php -dextension=typed.so -dtyped.mode=2 option2.php
string float int numeric scalar bool array
pass pass pass fail pass pass fail true
pass pass pass fail pass pass fail false
pass pass pass pass pass pass fail 0
pass pass pass pass pass pass fail 1
pass pass pass pass pass pass fail 12
pass pass warn pass pass pass fail 12
pass pass warn pass pass pass fail 12.23
pass fail warn fail pass pass fail 'true'
pass fail warn fail pass pass fail 'false'
pass pass pass pass pass pass fail '0'
pass pass pass pass pass pass fail '1'
pass pass pass pass pass pass fail '12'
pass fail warn fail pass pass fail '12abc'
pass pass pass pass pass pass fail '12.0'
pass pass pass pass pass pass fail '12.34'
pass fail warn fail pass pass fail 'foo'
fail fail fail fail fail fail pass array ( 0 => 1, 1 => 2, 2 => 3,)
fail fail fail fail fail fail pass array ( 345 => 12,)
pass pass pass fail fail pass failNULL
pass fail warn fail pass pass fail ''
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Hi,
2010/10/19 Derick Rethans derick@php.net
Hi!
I've spend some more time on this, and have attached a new patch that:
- Removes the strict type verification, changing it back into typehints
only.- Keeps the current syntax so that typehints create structures in the
function entries.- Keeps the reflection API for the syntax, so that you can query the
typehints.- Changed the API so that the verification function can also modify the
variables.I've just committed that patch, the implements the 3 first elements from
this list. I've also updated my little extension to behave in the same
way as it did with the previous patch:
There is a BC in the changes, I don't know if it is expected for the next
version, at least it is very strange.
<?php
class int { }
function f(int $a) { }
f(new int); // no error
f('foo'); // no error
f(null); // no error
?>
--
Regards,
Felipe Pena
+1, I think that's the most sensible solution for now that would allow
us to proceed with 5.4, something we all seem to be in agreement on.
Hi!
I think by now, whatever you think on strict typing/typehints, it is clear
to everybody that there's no consensus about this feature, and with Rasmus,
Zeev & Andi, along with many others, being against it, as of now it can not
be a part of an official PHP release.On the other hand, we have tons of cool features in trunk which aren't
controversial and that we do want people to try out.So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current trunk
and then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
People that like the typing can still have them in the branch (and they can
keep the branch as current as they want) and if we ever See The Light (TM)
and want typed scalar parameters back, they're only a merge away.What do you think?
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Ilia Alshanetsky wrote:
+1, I think that's the most sensible solution for now that would allow
us to proceed with 5.4, something we all seem to be in agreement on.
A slight aside here, as I have not be bothering about what HAS been implemented
typing wise ... A large section of the code a work with passes a range of data
to functions and classes. If the function gets an integer it looks up the record
with that id, an array assumes the data is already loaded, and perhaps a string
value defines that a new record of that name is to be created. So I don't want
the parameters passed to be tied to a single type. Is THAT affected by any of
the current typing actions?
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
Ilia Alshanetsky wrote:
+1, I think that's the most sensible solution for now that would allow
us to proceed with 5.4, something we all seem to be in agreement on.A slight aside here, as I have not be bothering about what HAS been
implemented typing wise ... A large section of the code a work with passes a
range of data to functions and classes. If the function gets an integer it
looks up the record with that id, an array assumes the data is already
loaded, and perhaps a string value defines that a new record of that name is
to be created. So I don't want the parameters passed to be tied to a single
type. Is THAT affected by any of the current typing actions?
both suggested type-hinting strategies are optional.
so, you, as developer, are free to not use type-hinting and accept any
data you like
--
Alexey Zakhlestin
http://www.milkfarmsoft.com/
At 22:50 11/08/2010, Alexey Zakhlestin wrote:
Ilia Alshanetsky wrote:
+1, I think that's the most sensible solution for now that would allow
us to proceed with 5.4, something we all seem to be in agreement on.A slight aside here, as I have not be bothering about what HAS been
implemented typing wise ... A large section of the code a work
with passes a
range of data to functions and classes. If the function gets an integer it
looks up the record with that id, an array assumes the data is already
loaded, and perhaps a string value defines that a new record of
that name is
to be created. So I don't want the parameters passed to be tied to a single
type. Is THAT affected by any of the current typing actions?both suggested type-hinting strategies are optional.
so, you, as developer, are free to not use type-hinting and accept any
data you like
Alexey,
It's been explained countless times why this is WRONG.
Please read the archives.
If you have and you disagree with it, please take it as an axiom - a
feature being 'optional' does not take away from any confusion or
complexity associated with it. It's been a design guideline in PHP
from the get go, we're not going to give up on it now.
Zeev
At 22:50 11/08/2010, Alexey Zakhlestin wrote:
Ilia Alshanetsky wrote:
+1, I think that's the most sensible solution for now that would allow
us to proceed with 5.4, something we all seem to be in agreement on.A slight aside here, as I have not be bothering about what HAS been
implemented typing wise ... A large section of the code a work with
passes a
range of data to functions and classes. If the function gets an integer
it
looks up the record with that id, an array assumes the data is already
loaded, and perhaps a string value defines that a new record of that
name is
to be created. So I don't want the parameters passed to be tied to a
single
type. Is THAT affected by any of the current typing actions?both suggested type-hinting strategies are optional.
so, you, as developer, are free to not use type-hinting and accept any
data you likeAlexey,
It's been explained countless times why this is WRONG.
Please read the archives.
If you have and you disagree with it, please take it as an axiom - a feature
being 'optional' does not take away from any confusion or complexity
associated with it. It's been a design guideline in PHP from the get go,
we're not going to give up on it now.
You misunderstood my comment.
Lester asked if he can still have his APIs without type-hinting and I
told him that he can.
That's all
We're not talking about complexities of understanding
--
Alexey Zakhlestin
http://www.milkfarmsoft.com/
You're absolutely right, sorry about that!
Zeev
At 23:11 11/08/2010, Alexey Zakhlestin wrote:
You misunderstood my comment.
Lester asked if he can still have his APIs without type-hinting and I
told him that he can.
That's allWe're not talking about complexities of understanding
--
Alexey Zakhlestin
http://www.milkfarmsoft.com/
Zeev Suraski wrote:
You're absolutely right, sorry about that!
Zeev
However if this is something controlled by php setup, it becomes another
'register_global'. If my users have to have it off for my projects and on for
others ... complexity in managing instead :(
At 23:11 11/08/2010, Alexey Zakhlestin wrote:
You misunderstood my comment.
Lester asked if he can still have his APIs without type-hinting and I
told him that he can.
That's allWe're not talking about complexities of understanding
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
Zeev Suraski wrote:
You're absolutely right, sorry about that!
Zeev
However if this is something controlled by php setup, it becomes another
'register_global'. If my users have to have it off for my projects and on
for others ... complexity in managing instead :(
Nothing is controlled by php setup.
It is perfectly ok to not specify type-hints in your functions.
both of these are fine:
function a($var) {}
function b(int $var) {}
you just keep using syntax of "a" and everything works. you CAN
specify typehint like in "b" but you don't have to.
p.s. if something is still not clear, let's take this talk away from list
--
Alexey Zakhlestin
http://www.milkfarmsoft.com/
Hi!
I think by now, whatever you think on strict typing/typehints, it is
clear to everybody that there's no consensus about this feature, and
with Rasmus, Zeev & Andi, along with many others, being against it, as
of now it can not be a part of an official PHP release.On the other hand, we have tons of cool features in trunk which aren't
controversial and that we do want people to try out.So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current
trunk and then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
People that like the typing can still have them in the branch (and they
can keep the branch as current as they want) and if we ever See The
Light (TM) and want typed scalar parameters back, they're only a merge
away.What do you think?
+1.
--Larry Garfield
On Wed, Aug 11, 2010 at 2:30 PM, Stas Malyshev smalyshev@sugarcrm.comwrote:
Hi!
I think by now, whatever you think on strict typing/typehints, it is clear
to everybody that there's no consensus about this feature, and with Rasmus,
Zeev & Andi, along with many others, being against it, as of now it can not
be a part of an official PHP release.On the other hand, we have tons of cool features in trunk which aren't
controversial and that we do want people to try out.So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current trunk
and then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
People that like the typing can still have them in the branch (and they can
keep the branch as current as they want) and if we ever See The Light (TM)
and want typed scalar parameters back, they're only a merge away.What do you think?
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227--
+1
--
Nephtali: PHP web framework that functions beautifully
http://nephtaliproject.com
At 21:30 11/08/2010, Stas Malyshev wrote:
Hi!
I think by now, whatever you think on strict typing/typehints, it is
clear to everybody that there's no consensus about this feature, and
with Rasmus, Zeev & Andi, along with many others, being against it,
as of now it can not be a part of an official PHP release.On the other hand, we have tons of cool features in trunk which
aren't controversial and that we do want people to try out.So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current
trunk and then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
People that like the typing can still have them in the branch (and
they can keep the branch as current as they want) and if we ever See
The Light (TM) and want typed scalar parameters back, they're only a
merge away.What do you think?
+1
Stas Malyshev wrote:
Hi!
I think by now, whatever you think on strict typing/typehints, it is
clear to everybody that there's no consensus about this feature, and
with Rasmus, Zeev & Andi, along with many others, being against it, as
of now it can not be a part of an official PHP release.On the other hand, we have tons of cool features in trunk which aren't
controversial and that we do want people to try out.So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current
trunk and then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
People that like the typing can still have them in the branch (and they
can keep the branch as current as they want) and if we ever See The
Light (TM) and want typed scalar parameters back, they're only a merge
away.What do you think?
Coming from a PHP user, +1. I would like to see annual releases with the
new features. However, I think the typehint debate should be put to
rest. Have a vote and be done with it...
Hi!
I think by now, whatever you think on strict typing/typehints, it is clear
to everybody that there's no consensus about this feature, and with Rasmus,
Zeev & Andi, along with many others, being against it, as of now it can not
be a part of an official PHP release.On the other hand, we have tons of cool features in trunk which aren't
controversial and that we do want people to try out.So I'd propose doing the following:
- Moving parameter typing to a feature branch (by branching current trunk
and then rolling back the typing part in the trunk).- Starting 5.4 alpha process after that basing on trunk.
Any objections to this?
Yes.
People that like the typing can still have them in the branch (and they can
keep the branch as current as they want) and if we ever See The Light (TM)
and want typed scalar parameters back, they're only a merge away.What do you think?
I think using trunk as base is a mistake. We should begin using a
stable branch (5.3) and merge what we want for the next release. It is
also too early to begin to think about 5.4 as there is still a couple
of things to clarify before. The most important ones being:
- What are the top new things we like to have in
- Define a clear release process (not going to go through a 5.3.0 or 6.0 again).
- Define the RMs, I do want a good, honest and respectful RMs.
The last point can wait as we are a couple of months away of defining
the first two. For example I have a couple of very important things to
add to the stack but I won't be able to describe them fully before
September (I'm in holidays now, remember that 5.3.3 is a couple of
weeks old...).
Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
- What are the top new things we like to have in
I would say
* Traits
* Aray dereferencing
* $this support inclosures
As language changes, in combination with performance improvements make a
good package.
This combined with removal of register_globals and safe mode make it a
really big release already.
johannes
Hi!
I think using trunk as base is a mistake. We should begin using a
stable branch (5.3) and merge what we want for the next release. It is
also too early to begin to think about 5.4 as there is still a couple
of things to clarify before. The most important ones being:
Why have trunk then? 5.4 has a lot of things added to 5.3, merging them
one-by-one to 5.3 would be just waste of time.
- What are the top new things we like to have in
- Define a clear release process (not going to go through a 5.3.0 or 6.0 again).
- Define the RMs, I do want a good, honest and respectful RMs.
Go ahead, do that :)
The last point can wait as we are a couple of months away of defining
the first two. For example I have a couple of very important things to
add to the stack but I won't be able to describe them fully before
September (I'm in holidays now, remember that 5.3.3 is a couple of
weeks old...).
It'd be alpha, you have enough time.
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
It'd be alpha, you have enough time.
Is it really the new way to do things in php.net? Totally ignore other
developers, discuss things privately, act like the last of the last
and drop a mail to "officially" announce a new release/big change? And
then we feel forced to act?
I cannot talk for the other, but for me it is a no-go, period.
I'm totally against an alpha at this stage. Not before we have
clarified all we need to get a clean release.
Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
Pierre,
With all due respect, there are plenty of things already in trunk to
make it a worth while effort to start planning the 5.4 release. Just
because you disagree, an opinion you are entitled to (like everyone
else), does not mean it is a no go, last I checked no one had veto
powers on the future release process. Johannes had already outlined a
number of major features/changes in 5.4 branch that are IMHO are
definitely enough to start thinking about a new version. Waiting until
we got every feature, idea considered will take an indefinite amount
of time and unlikely to result in a release. Additionally, a really
BIG 5.4 with tons of features will take that much longer to make
stable that something with a more manageable changeset. 5.4 is not the
last PHP release, there will defiantly be others and those version
can encompass features that didn't make it into 5.4.
The "strict type / type hinting" discussion aside there definitely
appears to be a consensus among the core devs that 5.4 release process
should start.
It'd be alpha, you have enough time.
Is it really the new way to do things in php.net? Totally ignore other
developers, discuss things privately, act like the last of the last
and drop a mail to "officially" announce a new release/big change? And
then we feel forced to act?I cannot talk for the other, but for me it is a no-go, period.
I'm totally against an alpha at this stage. Not before we have
clarified all we need to get a clean release.Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
Pierre,
With all due respect, there are plenty of things already in trunk to
make it a worth while effort to start planning the 5.4 release. Just
because you disagree, an opinion you are entitled to (like everyone
else), does not mean it is a no go, last I checked no one had veto
powers on the future release process. Johannes had already outlined a
number of major features/changes in 5.4 branch that are IMHO are
definitely enough to start thinking about a new version. Waiting until
we got every feature, idea considered will take an indefinite amount
of time and unlikely to result in a release. Additionally, a really
BIG 5.4 with tons of features will take that much longer to make
stable that something with a more manageable changeset. 5.4 is not the
last PHP release, there will defiantly be others and those version
can encompass features that didn't make it into 5.4.The "strict type / type hinting" discussion aside there definitely
appears to be a consensus among the core devs that 5.4 release process
should start.
I think you missed the point.
Pierre isn't against the release, but against the current process.
Tyrael
Pierre,
With all due respect, there are plenty of things already in trunk to
make it a worth while effort to start planning the 5.4 release. Just
because you disagree, an opinion you are entitled to (like everyone
else), does not mean it is a no go, last I checked no one had veto
powers on the future release process.
Right, and no one can decide alone when we have to begin a release.
Please understand my point: I'm not saying we won't need to begin
soon, but I do not accept the way it is done, the total lack of
respect of the other core developers and the total lack of roadap,
consensus or general agreement about what will be php-next.
I have worked with all RMs since years as part of the release process
(windows and other things like pear before). We are so bad at release
management, dead lines, QA, BC between releases, etc. And what do we
do to improve the situation? Absolutely nothing, however we prefer to
let one person decides again what and when we have to do. Sorry, I
can't and won't accept that.
For the rest of this discussion, I will come back in time with
proposals, obviously and as I have to.
Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
Pierre,
With all due respect, there are plenty of things already in trunk to
make it a worth while effort to start planning the 5.4 release. Just
because you disagree, an opinion you are entitled to (like everyone
else), does not mean it is a no go, last I checked no one had veto
powers on the future release process.Right, and no one can decide alone when we have to begin a release.
Please understand my point: I'm not saying we won't need to begin
soon, but I do not accept the way it is done, the total lack of
respect of the other core developers and the total lack of roadap,
consensus or general agreement about what will be php-next.
+1
regards,
Lukas Kahwe Smith
mls@pooteeweet.org
Hi!
I'm totally against an alpha at this stage. Not before we have
clarified all we need to get a clean release.
OK, so what do you propose to do? I.e., if you think there are things to
be discussed, set the agenda. I think that besides typing, trunk is ok
for alpha, you obvious don't think so. So, in your opinion:
- What's missing and should be added?
- What should be removed?
- When you expect/want it to happen?
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Stas Malyshev wrote:
I'm totally against an alpha at this stage. Not before we have
clarified all we need to get a clean release.OK, so what do you propose to do? I.e., if you think there are things to
be discussed, set the agenda. I think that besides typing, trunk is ok
for alpha, you obvious don't think so. So, in your opinion:
- What's missing and should be added?
First thing perhaps ... which IS Pierre's problem ... Windows snapshots
But short of trawling the commit tree ... what HAS already been added?
( links to the CURRENT release notes from the windows site are broken by the way )
- What should be removed?
Without a clean list of what has been added ....
Although I do seem to have missed something in 5.3.3 - where is the constructor
in a namespaced class if it's not going to use the those that already exist in
the source non-namespaced one. Not having been able to move TO php5.3 yet I seem
to have missed that discussion.
- When you expect/want it to happen?
Perhaps some time after PHP5.3 is actually complete on all windows builds?
Creating an Alpha of PHP-Trunk may be a way of creating the documentation that
is currently missing to even discuss the above questions, but how many of those
changes have even been tested on windows builds? Perhaps a move to a DVCS
approach WOULD be a good thing. Nothing gets allowed back into the master
without the necessary cross checks that there is agreement ... AND it has been
fully tested across all builds? However I am personally of the opinion that DVCS
is just creating a much bigger minefield for those projects that now depend on
it completely :( A single master IS essential for stable production releases.
Currently I am still working my way through the holes in PHP5.3.x which is why
PHP5.2 is STILL the last stable release as far as my ( windows ) customer sites
are concerned. SO sensible debate on the next step forward IS more important and
simply pulling PHP even further apart?
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
Hi!
- What's missing and should be added?
First thing perhaps ... which IS Pierre's problem ... Windows snapshots
But short of trawling the commit tree ... what HAS already been added?
( links to the CURRENT release notes from the windows site are broken by the way )
We have NEWS for this, don't we?
Although I do seem to have missed something in 5.3.3 - where is the constructor
in a namespaced class if it's not going to use the those that already exist in
the source non-namespaced one. Not having been able to move TO php5.3 yet I seem
to have missed that discussion.
Discussion starts here:
http://marc.info/?l=php-internals&m=127014823111792&w=2
The change is that if you have class Foo\Bar\Baz then Baz() isn't its
ctor (which it shouldn't be, since it's not the name of the class,
Foo\Bar\Baz is).
Currently I am still working my way through the holes in PHP5.3.x which is why
PHP5.2 is STILL the last stable release as far as my ( windows ) customer sites
are concerned. SO sensible debate on the next step forward IS more important and
What's wrong with 5.3 on windows (separate topic please :)
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Stas Malyshev wrote:
- What's missing and should be added?
First thing perhaps ... which IS Pierre's problem ... Windows snapshots
But short of trawling the commit tree ... what HAS already been added?
( links to the CURRENT release notes from the windows site are broken
by the way )We have NEWS for this, don't we?
If you are referring to the release notes, yes, I was just pointing out that
people who are directed to windows.php.net do not get the same level of support
as Linux users and currently those links are broken.
But the main point was ... where is the NEWS for all the features added to
trunk? We need the alpha to create the news to decide what needs changing before
releasing.
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
Stas Malyshev wrote:
- What's missing and should be added?
First thing perhaps ... which IS Pierre's problem ... Windows snapshots
But short of trawling the commit tree ... what HAS already been added?
( links to the CURRENT release notes from the windows site are broken
by the way )We have NEWS for this, don't we?
If you are referring to the release notes, yes, I was just pointing out that
people who are directed to windows.php.net do not get the same level of
support as Linux users and currently those links are broken.But the main point was ... where is the NEWS for all the features added to
trunk? We need the alpha to create the news to decide what needs changing
before releasing.
http://svn.php.net/viewvc/php/php-src/trunk/NEWS?view=markup
--
Alexey Zakhlestin
http://www.milkfarmsoft.com/
Alexey Zakhlestin wrote:
But the main point was ... where is the NEWS for all the features added to
trunk? We need the alpha to create the news to decide what needs changing
before releasing.
http://svn.php.net/viewvc/php/php-src/trunk/NEWS?view=markup
Simple example of the problem with that ...
line 53
- Added scalar typehinting. (Ilia, Derick)
Where there is a bug fix, there is at least a bug report to pick up on, but new
features with just a single line reference then mean spending time trying to
find the details.
Most of the 'added' lines mean nothing to me,and I can probably ignore them, but
that is then when I get bitten later simply because the implications are not
easily located?
At the moment I'm not seeing any real reason there that this isn't just a 5.3.4
release? If you take out the controversial stuff.
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
Am 11.08.2010 20:30, schrieb Stas Malyshev:
What do you think?
+1 :-)
--
Sebastian Bergmann Co-Founder and Principal Consultant
http://sebastian-bergmann.de/ http://thePHP.cc/