before beta 2

php.internals

(Marcus Börger)

23 years ago
Hello 'internals', In no particular order these are the things i think should be done before releasing the next php 5 beta version: - Include SPL (forach/array hooking). - Implement overloading as suggested by Sterling. - Typehinting with '= NULL' to allow NULL values as discussed - Array and resource type hinting (patch at least for arrays is ready and resources can easily be affed) - Typehinting for return values? This may be usefule especially when working with interfaces. - Fix __clone() visibility. When implementing singletons we must forbid calling __clone() by making it private (private function __clone() is the same to singletons as private function __construct() to factories). Also the clone mechanism must ensure the new object has all properties defined in the class. The current implementation doesn't do so what contradicts the inheritance model. The following example show both errors: php -r 'class t {var $x; private function __clone() {} }; $a = new t; $b = $a->__clone(); var_dump($a);var_dump($b);' object(t)#1 (1) { ["x"]=> NULL } object(t)#2 (0) { } - Complete work on exceptions and find a solution on when to throw exceptions and when to use errors. I still do not see any BC problems with making try/catch blocks to convert E_WARING, E_NOTICE & E_ERROR to exceptions (assumed the problemntaic E_ERRORS are changed to E_CORE or such). Why no BC? Simply becuase using try/catch with old libs and relying on there error capturing is an antilogy in itself. Especially when thinking about the very limited capabilities in handling errors the old way. - Discuss the package proposal and whether we want it or not. We saw that namespaces didn't really fit in our needs and that they are very problematic. To tell the truth some here are sure they can't be implemented correct. The ones thinking the they would obviosly had another idea of them. So let us not make the same mistake again and make instead sure we are all talking about the same thing in the same language. - Finally decide whether we want any other oo feature like aggregation, delegation or what ever. From my point of view they are nice but not necessary and will cause more development trouble then they will bring advantage to the user. So don't lets spend any more efforts in this area. - Most parts of the language are case insensitive, however some parts are not. For instance __construct, __clone,... - Move snprintf.c/spprintf.c into the engine. - Fix static class members. If the are public they need to be accessible from outside the class. If they have an initial value this value should be used and the keyword var should be working as well. php -r 'class t { static public $p = "x";}; $t = new t; var_dump($t->p);' php -r 'class t { static var $p = "x";}; $t = new t; var_dump($t->p);' php -r 'class t { static public $p = "x";}; echo $t::p;' To make this clear: $t->p would add a dynamic propery to instance t while we want to access the static property p which can only be achieved by a different notation which should be <class>'::'<static_member>. - Do we want static methods to be overwritable? php -r 'class t {static function x(){}}; class y {static function x(){}};' - We need to be able to declare method flags from function table for classes (static/public/protected/private/final). - Plug some memleaks.
-- Best regards, Marcus mailto:marcus.boerger@post.rwth-aachen.de

Jon Parise

23 years ago
On Mon, Jun 30, 2003 at 02:28:35AM +0200, Marcus Brger wrote:
> In no particular order these are the things i think should be done before > releasing the next php 5 beta version:
Without going into detail on any of these specific items, I think that the only work that should be undertaken between now and the release of PHP 5 is cleanup and bug fixing. There's plenty of that to go around, and while I realize that everyone wants to get their pet feature added to or expanded in PHP 5, we need to be realistic. Any of the items that include the words "add" or "integrate" should be left for 5.1. Any items marked as "complete" or "finish" are open for debate. Any items marked as "fix" should be addressed as soon as possible.
-- Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)

Rasmus Lerdorf

23 years ago
I agree. I think the beta was extremely premature, but now that it is out we are on a release track as far as I am concerned. Beta in my view means feature-complete full-steam ahead for release. And that means bug fixes only from here on and it also means a PHP_5_0 branch. -Rasmus On Sun, 29 Jun 2003, Jon Parise wrote:

John Coggeshall

23 years ago
Ignore.
-- -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-

John Coggeshall

23 years ago
Since SQLite will be bundled in the future, I sat down and got acquainted with it by writing a module for the session extension which allows users to store their session data in a SQLite database*. To use, just apply the patch to session.c (which adds the reference to the new module and adds the mod_sqlite.c to config.m4) and compile.. To use it set session.save_handler = sqlite. comments welcome. John * = http://www.coggeshall.org/php/mod_sqlite.php
-- -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-

Ilia A.

23 years ago
SQLite sessions are a good idea, however this is a problem with your implementation. Because during inserts/updates sqlite locks the entire database unless you turn of synchronization session mechanism will be extremely slow. My earlier tests, showed 10-15 new sessions per second with synchronization enabled. However, once you turn off synchronization you get a much more respectable 70-80 new sessions per second and up to 100 existing session hits per second. The idea would be that when you initialize the session database for the 1st time you would run "PRAGMA default_synchronous=OFF" query, which would disable synchronization for that database permanently. Additional speed may be gained by using memory only table, that would be persistent for as long as the webserver (Apache) is alive. You can also try using the cache_size option to gain additional speed, under heavy load it may yield additional 5-10 requests per second. Ilia On June 29, 2003 10:43 pm, John Coggeshall wrote:

Sterling Hughes

23 years ago
> On Sun, 29 Jun 2003, Jon Parise wrote: > > > On Mon, Jun 30, 2003 at 02:28:35AM +0200, Marcus Brger wrote: > > > > > In no particular order these are the things i think should be done before > > > releasing the next php 5 beta version: > > > > Without going into detail on any of these specific items, I think that > > the only work that should be undertaken between now and the release of > > PHP 5 is cleanup and bug fixing. There's plenty of that to go around, > > and while I realize that everyone wants to get their pet feature added > > to or expanded in PHP 5, we need to be realistic.
Jon, the overloading issues were left to beta 2, this was already agreed upon. Its still a long way to a release (I'd guestimate 6-9 months). The beta is not at this point solid from an API perspective. But since you seem to think a lot needs fixing up - what would you like fixed up? What's not working for you atm? Marcus is, btw, not proposing new features, just completing the existing feature, integrated overloading.
> > > > Any of the items that include the words "add" or "integrate" should be > > left for 5.1. Any items marked as "complete" or "finish" are open for > > debate. Any items marked as "fix" should be addressed as soon as > > possible. > >
There won't be truly drastic internals rewrites at this point, but we are not 100% feature complete. Things like a modified API for overloading, or clarifications in the type hint model are certainly valid for consideration in the beta process. There will of course be lots of bugfixing, but I don't think we should be overly strict at this point. -Sterling
> >
-- Good judgement comes from experience, and experience comes from bad judgement. - Fred Brooks

Jon Parise

23 years ago
On Sun, Jun 29, 2003 at 11:14:38PM -0400, Sterling Hughes wrote:
> > > Without going into detail on any of these specific items, I think that > > > the only work that should be undertaken between now and the release of > > > PHP 5 is cleanup and bug fixing. There's plenty of that to go around, > > > and while I realize that everyone wants to get their pet feature added > > > to or expanded in PHP 5, we need to be realistic. > > Jon, the overloading issues were left to beta 2, this was already agreed > upon.
Okay. I admit that I don't know much about that feature.
> Its still a long way to a release (I'd guestimate 6-9 months). The > beta is not at this point solid from an API perspective. But since > you seem to think a lot needs fixing up - what would you like fixed > up?
I could have phrased that better. I meant that, now that PHP 5 is on a release track, there's plenty of work to be done with regard to QA testing and responding to testing feedback / bug reports. If PHP 5 really is 6-9 months away than I agree with Rasmus: this beta was premature and gives the false impression that PHP 5 is nearing a final release.
> What's not working for you atm? Marcus is, btw, not proposing new > features, just completing the existing feature, integrated > overloading.
Everything is working well for me now, and I'd prefer to keep it that way. I'm wary of adding new features (I consider integrating SPL to be a new feature, for instance) which may upset the stability that we've just recently achieved.
> There won't be truly drastic internals rewrites at this point, but we > are not 100% feature complete. Things like a modified API for > overloading, or clarifications in the type hint model are certainly > valid for consideration in the beta process. There will of course be > lots of bugfixing, but I don't think we should be overly strict at this > point.
Not to be too picky (after all, I'm not directly involved in any of this code at this point, so I don't have any real authority there), but I'd really like to see a PHP project-wide release roadmap for PHP 5 than a bunch of developers posting their TODO lists. I realize that's what you're trying to generate, but it seems like whatever results will be largely emergent and de facto based on these TODO lists, with very little strategy involved. The fact that this discussion is even happening in the first place is indicative of a lack of developer unity over the issue. This is all just my opinion, of course.
-- Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)

(Marcus Börger)

23 years ago
Hello Jon, Monday, June 30, 2003, 9:58:07 AM, you wrote: JP> Everything is working well for me now, and I'd prefer to keep it that JP> way. If you did had a closer look then you'd've find out that essential things are not working. Did you try the new oo stuff? JP> I'm wary of adding new features (I consider integrating SPL to JP> be a new feature, for instance) which may upset the stability that JP> we've just recently achieved. SPL is older than SQLite for instance and as i said tested very well. What we are speaking about here is to move certain features into the engine to be more efficient. Best regards, Marcus mailto:helly@php.net

Derick Rethans

23 years ago
On Sun, 29 Jun 2003, Rasmus Lerdorf wrote:
> I agree. I think the beta was extremely premature, but now that it is out > we are on a release track as far as I am concerned. Beta in my view means > feature-complete full-steam ahead for release. And that means bug fixes > only from here on and it also means a PHP_5_0 branch.
I don't think this is fair because some things were left out "because there would be a beta 2 anyway". Derick
-- "Interpreting what the GPL actually means is a job best left to those that read the future by examining animal entrails." ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ International PHP Magazine http://php-mag.net/ -------------------------------------------------------------------------

Sebastian Bergmann

23 years ago
Derick Rethans wrote:
> I don't think this is fair because some things were left out "because > there would be a beta 2 anyway".
+1
-- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/

(Marcus Börger)

23 years ago
Hello Rasmus, Monday, June 30, 2003, 3:11:03 AM, you wrote: RL> I agree. I think the beta was extremely premature, but now that it is out RL> we are on a release track as far as I am concerned. Beta in my view means RL> feature-complete full-steam ahead for release. And that means bug fixes RL> only from here on and it also means a PHP_5_0 branch. According to our latest expirience doing a PHP_5_0 branch would be the stupiest idea ever. And i agree it weren't at beta stage yet. There are simply far to many errors.
-- Best regards, Marcus mailto:helly@php.net

Zeev Suraski

23 years ago
At 08:31 30/06/2003, Derick Rethans wrote:
>On Sun, 29 Jun 2003, Rasmus Lerdorf wrote: > > > I agree. I think the beta was extremely premature, but now that it is out > > we are on a release track as far as I am concerned. Beta in my view means > > feature-complete full-steam ahead for release. And that means bug fixes > > only from here on and it also means a PHP_5_0 branch. > >I don't think this is fair because some things were left out "because >there would be a beta 2 anyway".
Needless to say I don't think that the beta was extremely premature but quite the contrary, and I think that the ideas that were left for beta 2 will be reviewed again before beta 2 (there weren't too many of them, and I think all of them were in Andi's sub-list of Marcus' list, that I find quite reasonable). It doesn't mean that all of them will make it into PHP 5, since I consider the time-frame to be pretty important, especially considering how much time we lost with this project, and how many people are waiting for it. It doesn't come to say that all of them will make it into PHP at all, by the way - some of them are open questions... Zeev

Derick Rethans

23 years ago
On Mon, 30 Jun 2003, Zeev Suraski wrote:
> At 08:31 30/06/2003, Derick Rethans wrote: > >On Sun, 29 Jun 2003, Rasmus Lerdorf wrote: > > > > > feature-complete full-steam ahead for release. And that means bug fixes > > > only from here on and it also means a PHP_5_0 branch. > > It doesn't mean that all of them will make it into PHP 5 [snip] It > doesn't come to say that all of them will make it into PHP at all, by > the way - some of them are open questions...
Right, that's what I meant... it was the "only bugfixes" I was referring too. Derick
-- "Interpreting what the GPL actually means is a job best left to those that read the future by examining animal entrails." ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ International PHP Magazine http://php-mag.net/ -------------------------------------------------------------------------

John Coggeshall

23 years ago
Ignore.
-- -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-

John Coggeshall

23 years ago
Ignore.
-- -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-

Dan Kalowsky

23 years ago
Jon, I have to agree with your thinking as well. Although to the rest of internals, a plea. Can we please wait until after a weekend to send out release notifications? On Sunday, June 29, 2003, at 08:59 PM, Jon Parise wrote:
> On Mon, Jun 30, 2003 at 02:28:35AM +0200, Marcus Brger wrote: > >> In no particular order these are the things i think should be done >> before >> releasing the next php 5 beta version: > > Without going into detail on any of these specific items, I think that > the only work that should be undertaken between now and the release of > PHP 5 is cleanup and bug fixing. There's plenty of that to go around, > and while I realize that everyone wants to get their pet feature added > to or expanded in PHP 5, we need to be realistic. > > Any of the items that include the words "add" or "integrate" should be > left for 5.1. Any items marked as "complete" or "finish" are open for > debate. Any items marked as "fix" should be addressed as soon as > possible. > > -- > Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/) > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >---------------------------------------------------------------<
Dan Kalowsky "Momma take this badge offa me, http://www.deadmime.org/~dank I can't use it anymore." dank-nom@aps-deadmime.org - "Knockin on Heavens Door", kalowsky@php.net Bob Dylan

Rasmus Lerdorf

23 years ago
The problem here is just that the PHP notion of a beta is very different from what most of the world expects from a beta. We have cleaned up some aspects or our versioning and I was hoping we could clean this up as well. But I guess not. So, at the very least we need a versioning FAQ where we explain that a PHP beta is what most would consider an alpha, and the PHP release candidates is basically our beta stage. -Rasmus On Sun, 29 Jun 2003, Dan Kalowsky wrote:

Dan Kalowsky

23 years ago
There is no real reason why we can't adapt our habits to reflect the concepts others understand them as. AKA why not just stop calling it a BETA, and refer to it as an ALPHA? At least users would recognize what this is. On Sunday, June 29, 2003, at 11:48 PM, Rasmus Lerdorf wrote:
> The problem here is just that the PHP notion of a beta is very > different > from what most of the world expects from a beta. We have cleaned up > some > aspects or our versioning and I was hoping we could clean this up as > well. > But I guess not. So, at the very least we need a versioning FAQ where > we > explain that a PHP beta is what most would consider an alpha, and the > PHP > release candidates is basically our beta stage. > > -Rasmus > > On Sun, 29 Jun 2003, Dan Kalowsky wrote: > >> Jon, >> >> I have to agree with your thinking as well. >> >> Although to the rest of internals, a plea. Can we please wait until >> after a weekend to send out release notifications? >> >> >> On Sunday, June 29, 2003, at 08:59 PM, Jon Parise wrote: >> >>> On Mon, Jun 30, 2003 at 02:28:35AM +0200, Marcus Brger wrote: >>> >>>> In no particular order these are the things i think should be done >>>> before >>>> releasing the next php 5 beta version: >>> >>> Without going into detail on any of these specific items, I think >>> that >>> the only work that should be undertaken between now and the release >>> of >>> PHP 5 is cleanup and bug fixing. There's plenty of that to go >>> around, >>> and while I realize that everyone wants to get their pet feature >>> added >>> to or expanded in PHP 5, we need to be realistic. >>> >>> Any of the items that include the words "add" or "integrate" should >>> be >>> left for 5.1. Any items marked as "complete" or "finish" are open >>> for >>> debate. Any items marked as "fix" should be addressed as soon as >>> possible. >>> >>> -- >>> Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/) >>> >>> -- >>> PHP Internals - PHP Runtime Development Mailing List >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> ---------------------------------------------------------------< >> Dan Kalowsky "Momma take this badge offa me, >> http://www.deadmime.org/~dank I can't use it anymore." >> dank-nom@aps-deadmime.org - "Knockin on Heavens Door", >> kalowsky@php.net Bob Dylan >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >---------------------------------------------------------------<
Dan Kalowsky "Cause fear is strong and love's http://www.deadmime.org/~dank for everyone, who isn't me." dank-nom@aps-deadmime.org - "Burden In My Hand", kalowsky@php.net Soundgarden

Sterling Hughes

23 years ago
I refer you to the jargon file, which is about as good a definition that you can get: http://info.astrian.net/jargon/terms/b/beta.html "Mostly working, but still under test; usu. used with `in': `in beta'. In the Real World, systems (hardware or software) software often go through two stages of release testing: Alpha (in-house) and Beta (out-house?). Beta releases are generally made to a group of lucky (or unlucky) trusted customers. 2. Anything that is new and experimental. "His girlfriend is in beta" means that he is still testing for compatibility and reserving judgment. 3. Flaky; dubious; suspect (since beta software is notoriously buggy)." This is the definition of a beta. Now, PHP 5 Beta 1 certainly falls well within these parameters. How far you subclassify depends on the project. MySQL betas are often recommended in production environments. PHP Betas are a bit looser about new features and signifigant changes. We aren't violating the definition of a beta, we are just defining our parameters for beta software. "Alpha," "Beta" and "Release" are classifications, and are left to the project to further define. PHP 5 is almost there, and prematurely imposing rules on ourselves because we now labeled a "beta" seems like an unwise choice. The majority of the changes marcus is talking about are not far reaching, and are really about polishing off the object model. Perfectly acceptable discussion for a beta cycle. -Sterling On Sun, 2003-06-29 at 23:54, Dan Kalowsky wrote:
> There is no real reason why we can't adapt our habits to reflect the > concepts others understand them as. AKA why not just stop calling it a > BETA, and refer to it as an ALPHA? At least users would recognize what > this is. > > > On Sunday, June 29, 2003, at 11:48 PM, Rasmus Lerdorf wrote: > > > The problem here is just that the PHP notion of a beta is very > > different > > from what most of the world expects from a beta. We have cleaned up > > some > > aspects or our versioning and I was hoping we could clean this up as > > well. > > But I guess not. So, at the very least we need a versioning FAQ where > > we > > explain that a PHP beta is what most would consider an alpha, and the > > PHP > > release candidates is basically our beta stage. > > > > -Rasmus > > > > On Sun, 29 Jun 2003, Dan Kalowsky wrote: > > > >> Jon, > >> > >> I have to agree with your thinking as well. > >> > >> Although to the rest of internals, a plea. Can we please wait until > >> after a weekend to send out release notifications? > >> > >> > >> On Sunday, June 29, 2003, at 08:59 PM, Jon Parise wrote: > >> > >>> On Mon, Jun 30, 2003 at 02:28:35AM +0200, Marcus Brger wrote: > >>> > >>>> In no particular order these are the things i think should be done > >>>> before > >>>> releasing the next php 5 beta version: > >>> > >>> Without going into detail on any of these specific items, I think > >>> that > >>> the only work that should be undertaken between now and the release > >>> of > >>> PHP 5 is cleanup and bug fixing. There's plenty of that to go > >>> around, > >>> and while I realize that everyone wants to get their pet feature > >>> added > >>> to or expanded in PHP 5, we need to be realistic. > >>> > >>> Any of the items that include the words "add" or "integrate" should > >>> be > >>> left for 5.1. Any items marked as "complete" or "finish" are open > >>> for > >>> debate. Any items marked as "fix" should be addressed as soon as > >>> possible. > >>> > >>> -- > >>> Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/) > >>> > >>> -- > >>> PHP Internals - PHP Runtime Development Mailing List > >>> To unsubscribe, visit: http://www.php.net/unsub.php > >>> > >>> ---------------------------------------------------------------< > >> Dan Kalowsky "Momma take this badge offa me, > >> http://www.deadmime.org/~dank I can't use it anymore." > >> dank-nom@aps-deadmime.org - "Knockin on Heavens Door", > >> kalowsky@php.net Bob Dylan > >> > >> > >> -- > >> PHP Internals - PHP Runtime Development Mailing List > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > >---------------------------------------------------------------< > Dan Kalowsky "Cause fear is strong and love's > http://www.deadmime.org/~dank for everyone, who isn't me." > dank-nom@aps-deadmime.org - "Burden In My Hand", > kalowsky@php.net Soundgarden
-- "Programming today is a race between software engineers stirring to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Unknown

(Marcus Börger)

23 years ago
Hello Sterling, Monday, June 30, 2003, 7:20:37 AM, you wrote: SH> [...] SH> PHP 5 is almost there, and prematurely imposing rules on ourselves SH> because we now labeled a "beta" seems like an unwise choice. The SH> majority of the changes marcus is talking about are not far reaching, SH> and are really about polishing off the object model. Perfectly SH> acceptable discussion for a beta cycle. IMO (1) we already completely rewrote the object model. It shows very good efforts but still needs work. When i said 'Discuss the package proposal' then i clearly meant implementing it is worth being prostponed until 5.1. But on the contray the risk of rewriting to much or changing to much behavior is simply to high. Therefore we should really avoid that at least by discussing on the matter and find a consensus now. IMO (2) many of the things mentioned in my proposal are real errors that need to be fixed as soon as possible. If you ask me we were far to fast with beta. But i am not really interested in the discussion what is a beta here. IMO (3) more new features not mentioned in the proposal? No i guess we have enough. (Just to reply)
-- Best regards, Marcus mailto:helly@php.net

Zeev Suraski

23 years ago
At 08:20 30/06/2003, Sterling Hughes wrote:
>I refer you to the jargon file, which is about as good a definition that >you can get: > >http://info.astrian.net/jargon/terms/b/beta.html > >"Mostly working, but still under test; usu. used with `in': `in beta'. >In the Real World, systems (hardware or software) software often go >through two stages of release testing: Alpha (in-house) and Beta >(out-house?). Beta releases are generally made to a group of lucky (or >unlucky) trusted customers. 2. Anything that is new and experimental. >"His girlfriend is in beta" means that he is still testing for >compatibility and reserving judgment. 3. Flaky; dubious; suspect (since >beta software is notoriously buggy)." > >This is the definition of a beta. Now, PHP 5 Beta 1 certainly falls >well within these parameters. How far you subclassify depends on the >project. MySQL betas are often recommended in production environments. >PHP Betas are a bit looser about new features and signifigant changes. >We aren't violating the definition of a beta, we are just defining our >parameters for beta software. "Alpha," "Beta" and "Release" are >classifications, and are left to the project to further define. > >PHP 5 is almost there, and prematurely imposing rules on ourselves >because we now labeled a "beta" seems like an unwise choice. The >majority of the changes marcus is talking about are not far reaching, >and are really about polishing off the object model. Perfectly >acceptable discussion for a beta cycle.
I agree with every word... Zeev

Sebastian Bergmann

23 years ago
Jon Parise wrote:
> Without going into detail on any of these specific items, I think that > the only work that should be undertaken between now and the release of > PHP 5 is cleanup and bug fixing.
One thing that is IMHO essential for the PHP 5.0.0 is the Reflection API on which George and Andrei work.
-- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/

Andi Gutmans

23 years ago
At 07:15 AM 30/6/2003 +0200, Sebastian Bergmann wrote:
>Jon Parise wrote: > > Without going into detail on any of these specific items, I think that > > the only work that should be undertaken between now and the release of > > PHP 5 is cleanup and bug fixing. > > One thing that is IMHO essential for the PHP 5.0.0 is the Reflection > API on which George and Andrei work.
I'll try and go over it today. Andi

Andi Gutmans

23 years ago
Do you have the URL of the docs? Andi At 07:15 AM 30/6/2003 +0200, Sebastian Bergmann wrote:

Sebastian Bergmann

23 years ago
Andi Gutmans wrote:
> Do you have the URL of the docs?
The current one would be http://www.sebastian-bergmann.de/stuff/reflection-update.png I re-posted Andrei's document a couple of days ago and made the above diagram at the same time.
-- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/

Andi Gutmans

23 years ago
At 07:31 AM 30/6/2003 +0200, Sebastian Bergmann wrote:
>Andi Gutmans wrote: > > Do you have the URL of the docs? > > The current one would be > > http://www.sebastian-bergmann.de/stuff/reflection-update.png > > I re-posted Andrei's document a couple of days ago and made the above > diagram at the same time.
Can you repost the docs? (Nice diagram :) Andi

Sebastian Bergmann

23 years ago
Andi Gutmans wrote:
> Can you repost the docs?
Andrei's document http://www.sebastian-bergmann.de/stuff/reflection.txt and my diagram for it http://www.sebastian-bergmann.de/stuff/reflection.png
-- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/

Andi Gutmans

23 years ago
Hey, In my opinion beta 1 should be labeled as a beta. The fact that we are fixing a few features doesn't mean it's alpha. I know what the definition of alpha is but in real life most beta's do end up having quite a few code changes before release. I agree that we should try and feature freeze as much as possible right now. I'd like to see PHP 5 out before the 6-9 month period Sterling mentioned. I think we can probably do it within about 4 months if we don't mess with the code too much and listen to the feedback of people who are starting to play around with it. In my opinion, half the stuff listed by Marcus should wait for PHP 5.1 (which can be released very quickly after PHP 5): - Include SPL (forach/array hooking) (although we can discuss it and re-evaluate this once we finalize what we want). - Typehinting for return values? This may be useful especially when working with interfaces. (Not sure about this but I think it can wait). - Complete work on exceptions and find a solution on when to throw exceptions and when to use errors. (as I said I think we should keep it purely in user-land until we see how people end up using exceptions and we get enough feedback. I haven't heard any ideas here which are rock solid yet.). - Discuss the package proposal and whether we want it or not. (Don't think this is for PHP 5). - Finally decide whether we want any other oo feature like aggregation, delegation or what ever. (-1 too) I didn't understand the following: - We need to be able to declare method flags from function table for classes (static/public/protected/private/final). The rest of the stuff (which are mainly bug fixes) should be addressed. Andi At 02:28 AM 30/6/2003 +0200, Marcus Börger wrote:

Andi Gutmans

23 years ago
At 07:43 AM 30/6/2003 +0200, Andi Gutmans wrote:
>Hey, > >In my opinion beta 1 should be labeled as a beta. The fact that we are >fixing a few features doesn't mean it's alpha. I know what the definition >of alpha is but in real life most beta's do end up having quite a few code >changes before release. >I agree that we should try and feature freeze as much as possible right >now. I'd like to see PHP 5 out before the 6-9 month period Sterling >mentioned. I think we can probably do it within about 4 months if we don't >mess with the code too much and listen to the feedback of people who are >starting to play around with it. > >In my opinion, half the stuff listed by Marcus should wait for PHP 5.1 >(which can be released very quickly after PHP 5): >- Include SPL (forach/array hooking) (although we can discuss it and >re-evaluate this once we finalize what we want).
After Sterling reminded me that I did say that this should be considered for PHP 5 I'll clarify what I meant. What I meant by re-evaluating is that if everything falls in properly we should re-evaluate the patch before PHP 5. Let's see another iteration of the spec with pretty names and then decide :) Also, how are the benchmarks? What is slowed down and by how much? (it might very well be worth it but I'd like to know more or less). Last but not least, are there any things which won't work with this such as foreach with references and other problems? Andi

(Marcus Börger)

23 years ago
Hello Andi, Monday, June 30, 2003, 8:10:30 AM, you wrote: AG> At 07:43 AM 30/6/2003 +0200, Andi Gutmans wrote:
>>Hey, >> >>In my opinion beta 1 should be labeled as a beta. The fact that we are >>fixing a few features doesn't mean it's alpha. I know what the definition >>of alpha is but in real life most beta's do end up having quite a few code >>changes before release. >>I agree that we should try and feature freeze as much as possible right >>now. I'd like to see PHP 5 out before the 6-9 month period Sterling >>mentioned. I think we can probably do it within about 4 months if we don't >>mess with the code too much and listen to the feedback of people who are >>starting to play around with it. >> >>In my opinion, half the stuff listed by Marcus should wait for PHP 5.1 >>(which can be released very quickly after PHP 5): >>- Include SPL (forach/array hooking) (although we can discuss it and >>re-evaluate this once we finalize what we want).
AG> After Sterling reminded me that I did say that this should be considered AG> for PHP 5 I'll clarify what I meant. What I meant by re-evaluating is that AG> if everything falls in properly we should re-evaluate the patch before PHP 5. AG> Let's see another iteration of the spec with pretty names and then decide AG> :) Also, how are the benchmarks? What is slowed down and by how much? (it AG> might very well be worth it but I'd like to know more or less). Last but AG> not least, are there any things which won't work with this such as foreach AG> with references and other problems? According to foreach hooking a) I couldn't make out any problem that isn't fixed right now b) When included into the engine the differences are 3 additional comparisons in FE_RESET (2 pointers, 1 integer) 1 additional check in FE_FETCH (integer) 2 additional checks and a complex fetch in (SWITCH_FREE) -> that should be near to zero impact. In the early stages when it wasn't that optimized it was already near unmeasurable. c) IT makes no sense letting me do more work in here. I really can't see what i can do more. Of the new oo things it is right now one of the best documented and tested. So others have to test and report :-) Array hooking is somewhat different. The impact is higher and it isn't really optimized right now. That's why i made it optional. The question here is whether we want it or not. But again being integrated in the engine the overhead can be reduced to a level described in foreach hooking. Best regards, Marcus mailto:helly@php.net

Andi Gutmans

23 years ago
At 08:54 AM 30/6/2003 +0200, Marcus Börger wrote:
>Hello Andi, > >Monday, June 30, 2003, 8:10:30 AM, you wrote: > >AG> At 07:43 AM 30/6/2003 +0200, Andi Gutmans wrote: > >>Hey, > >> > >>In my opinion beta 1 should be labeled as a beta. The fact that we are > >>fixing a few features doesn't mean it's alpha. I know what the definition > >>of alpha is but in real life most beta's do end up having quite a few code > >>changes before release. > >>I agree that we should try and feature freeze as much as possible right > >>now. I'd like to see PHP 5 out before the 6-9 month period Sterling > >>mentioned. I think we can probably do it within about 4 months if we don't > >>mess with the code too much and listen to the feedback of people who are > >>starting to play around with it. > >> > >>In my opinion, half the stuff listed by Marcus should wait for PHP 5.1 > >>(which can be released very quickly after PHP 5): > >>- Include SPL (forach/array hooking) (although we can discuss it and > >>re-evaluate this once we finalize what we want). > >AG> After Sterling reminded me that I did say that this should be considered >AG> for PHP 5 I'll clarify what I meant. What I meant by re-evaluating is >that >AG> if everything falls in properly we should re-evaluate the patch before >PHP 5. >AG> Let's see another iteration of the spec with pretty names and then decide >AG> :) Also, how are the benchmarks? What is slowed down and by how much? (it >AG> might very well be worth it but I'd like to know more or less). Last but >AG> not least, are there any things which won't work with this such as >foreach >AG> with references and other problems? > >According to foreach hooking >a) I couldn't make out any problem that isn't fixed right now >b) When included into the engine the differences are > 3 additional comparisons in FE_RESET (2 pointers, 1 integer) > 1 additional check in FE_FETCH (integer) > 2 additional checks and a complex fetch in (SWITCH_FREE) > -> that should be near to zero impact. > In the early stages when it wasn't that optimized it was already near > unmeasurable. >c) IT makes no sense letting me do more work in here. I really can't see what > i can do more. Of the new oo things it is right now one of the best > documented and tested. So others have to test and report :-) > >Array hooking is somewhat different. The impact is higher and it isn't >really optimized right now. That's why i made it optional. The question here >is whether we want it or not. But again being integrated in the engine the >overhead can be reduced to a level described in foreach hooking.
Can you please post a patch for the foreach() stuff (i.e. collection and iterator)? I don't exactly remember what you mean by array hooking. Is that what Andrei wants or does it also include a user-land interface to overload? Andi

(Marcus Börger)

23 years ago
Hello Andi, Monday, June 30, 2003, 5:58:42 PM, you wrote: AG> At 08:54 AM 30/6/2003 +0200, Marcus Börger wrote:
>>Hello Andi, >> >>Monday, June 30, 2003, 8:10:30 AM, you wrote: >> >>AG> At 07:43 AM 30/6/2003 +0200, Andi Gutmans wrote: >> >>Hey, >> >> >> >>In my opinion beta 1 should be labeled as a beta. The fact that we are >> >>fixing a few features doesn't mean it's alpha. I know what the definition >> >>of alpha is but in real life most beta's do end up having quite a few code >> >>changes before release. >> >>I agree that we should try and feature freeze as much as possible right >> >>now. I'd like to see PHP 5 out before the 6-9 month period Sterling >> >>mentioned. I think we can probably do it within about 4 months if we don't >> >>mess with the code too much and listen to the feedback of people who are >> >>starting to play around with it. >> >> >> >>In my opinion, half the stuff listed by Marcus should wait for PHP 5.1 >> >>(which can be released very quickly after PHP 5): >> >>- Include SPL (forach/array hooking) (although we can discuss it and >> >>re-evaluate this once we finalize what we want). >> >>AG> After Sterling reminded me that I did say that this should be considered >>AG> for PHP 5 I'll clarify what I meant. What I meant by re-evaluating is >>that >>AG> if everything falls in properly we should re-evaluate the patch before >>PHP 5. >>AG> Let's see another iteration of the spec with pretty names and then decide >>AG> :) Also, how are the benchmarks? What is slowed down and by how much? (it >>AG> might very well be worth it but I'd like to know more or less). Last but >>AG> not least, are there any things which won't work with this such as >>foreach >>AG> with references and other problems? >> >>According to foreach hooking >>a) I couldn't make out any problem that isn't fixed right now >>b) When included into the engine the differences are >> 3 additional comparisons in FE_RESET (2 pointers, 1 integer) >> 1 additional check in FE_FETCH (integer) >> 2 additional checks and a complex fetch in (SWITCH_FREE) >> -> that should be near to zero impact. >> In the early stages when it wasn't that optimized it was already near >> unmeasurable. >>c) IT makes no sense letting me do more work in here. I really can't see what >> i can do more. Of the new oo things it is right now one of the best >> documented and tested. So others have to test and report :-) >> >>Array hooking is somewhat different. The impact is higher and it isn't >>really optimized right now. That's why i made it optional. The question here >>is whether we want it or not. But again being integrated in the engine the >>overhead can be reduced to a level described in foreach hooking.
AG> Can you please post a patch for the foreach() stuff (i.e. collection and AG> iterator)? AG> I don't exactly remember what you mean by array hooking. Is that what AG> Andrei wants or does it also include a user-land interface to overload? Please look into spl. You can check it out spl (cvs co spl) into your extension directory and recompile with --enable-spl --enable-spl-hook-all. Then run the tests or play with the examples. Then you'll see. Documentation and profiling results can be found in the readme files. Best regards, Marcus mailto:helly@php.net

Andi Gutmans

23 years ago
At 07:54 PM 30/6/2003 +0200, Marcus Börger wrote:
>AG> Can you please post a patch for the foreach() stuff (i.e. collection and >AG> iterator)? >AG> I don't exactly remember what you mean by array hooking. Is that what >AG> Andrei wants or does it also include a user-land interface to overload? > >Please look into spl. You can check it out spl (cvs co spl) into your >extension directory and recompile with --enable-spl --enable-spl-hook-all. >Then run the tests or play with the examples. Then you'll see. Documentation >and profiling results can be found in the readme files.
I meant a patch for the Zend Engine. I can't really look over the code of spl because it's not a diff against the current engine :) Andi Andi

(Marcus Börger)

23 years ago
Hello Andi, you asked for a spl patch against ZE2. Ok, i spent some hours to move spl-foreach hooking into the engine. Here is the diff: http://marcus-boerger.de/php/ext/ze2/ze2-spl-20030630.diff.tgz Here are modified tests: http://marcus-boerger.de/php/ext/ze2/ze2-spl-tests-20030630.tgz Here is the diff needed for sqlite: http://marcus-boerger.de/php/ext/ze2/ze2-spl-sqlite-20030630.tgz As soon as i find some more time i'll give the array stuff a go. Anyway it would be good to receive some feedback before doing it. As you can see easily, the impact on the foreah opcode handlers is even less than i thought. So i guess it is more than acceptable when compared to what we gain. Happy experimenting Best regards, Marcus mailto:helly@php.net

Andi Gutmans

23 years ago
Hi, It is still not possible to understand from this .diff what the impact on the Engine will be because the code it still saturated with copying of code from the Engine. My intentation was to review a patch that is ready to be commited. You shouldn't have to replace opcodes anymore and you shouldn't have to make copies of functions from within Zend. Also, does the array overloading stuff allow extension developers like Andrei also to hook into this? Andi At 02:06 AM 1/7/2003 +0200, Marcus Börger wrote:

(Marcus Börger)

23 years ago
Hello Andi, Tuesday, July 1, 2003, 7:33:45 AM, you wrote: AG> Hi, AG> It is still not possible to understand from this .diff what the impact on AG> the Engine will be No? There a simply 4 additional checks/calls inside zend_execute.c. You can't see the impact of them? strange! But see down below. AG> because the code it still saturated with copying of code AG> from the Engine. No! The code works quite a bit different. If something should be changed then the code inside the engine should be changed - but again it's different. And all we are speeking about here is a) code inside spl_functions.c/h which is also needed for the spl extension. b) spl_call_method() which works quite different from fast_call_user_function() -> the spl code assumes a loop and: - only works with methods (no function support) - expects the class type (zend_class_entry) to be known prior to calling - stores the fetched function if not already known c) some additional static inlines around spl_call_method() d) however with the following you might be correct: - spl_is_instance_of() - spl_unlock_zval_ptr_ptr() - spl_get_zval_ptr_ptr() but that would make it necessary to move some macros and inlines of the engine around. So i supposed that would be a good thing to do in step 2. AG> My intentation was to review a patch that is ready to be AG> commited. You shouldn't have to replace opcodes anymore I don't replace any opcode.... AG> and you shouldn't AG> have to make copies of functions from within Zend. Read above... AG> Also, does the array overloading stuff allow extension developers like AG> Andrei also to hook into this? ATM i act like if hooking weren't possible and emit an error if a wrong object is used. Since spl was an extension before and showed that this is no problem because the hooks get executed before the original handlers and becuse we need errors if noone handles the objects - i guess that's the way to go. Or in quick yes he can do what ever he wants to do. Only by using spl code it's easier for him and it will be compatible with other things if he uses the same interfaces. Just for clearification here is the part of the diff that causes impact on the runtime behaviour (i've removed the includes and WS): Index: Zend/zend_execute.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute.c,v retrieving revision 1.481 diff -u -p -r1.481 zend_execute.c --- Zend/zend_execute.c 30 Jun 2003 20:22:35 -0000 1.481 +++ Zend/zend_execute.c 1 Jul 2003 00:16:33 -0000 @@ -3099,6 +3101,11 @@ int zend_case_handler(ZEND_OPCODE_HANDLE int zend_switch_free_handler(ZEND_OPCODE_HANDLER_ARGS) { + zval **obj = get_zval_ptr_ptr(&EX(opline)->op2, EX(Ts), BP_VAR_R); + + if (obj) { + spl_switch_free_handler(obj , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + } zend_switch_free(EX(opline), EX(Ts) TSRMLS_CC); NEXT_OPCODE(); } # # This is one additional fetch and check at the end of each foreach loop. # @@ -3515,18 +3522,30 @@ int zend_fe_reset_handler(ZEND_OPCODE_HA { zval *array_ptr, **array_ptr_ptr; HashTable *fe_ht; + zend_class_entry *instance_ce; if (EX(opline)->extended_value) { array_ptr_ptr = get_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_R); if (array_ptr_ptr == NULL) { MAKE_STD_ZVAL(array_ptr); } else { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; + if ((instance_ce = spl_get_class_entry(*array_ptr_ptr TSRMLS_CC)) != NULL) { + if (!spl_fe_reset_handler(array_ptr_ptr, instance_ce, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)) { + return 0; + } + } else { + SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); + array_ptr = *array_ptr_ptr; + array_ptr->refcount++; + } } } else { array_ptr = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); + if ((instance_ce = spl_get_class_entry(array_ptr TSRMLS_CC)) != NULL) { + if (!spl_fe_reset_handler(&array_ptr, instance_ce, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)) { + return 0; + } + } if (EG(free_op1)) { /* IS_TMP_VAR */ zval *tmp; # # One additional zend_class_entry fetch per foreach loop begin. # In both cases the fetch is done by a static inline function which does two # simple comparisons and one complex (if you want i can eliminate on of the # simple checks, but i wouldn't like it). # @@ -3560,6 +3580,10 @@ int zend_fe_fetch_handler(ZEND_OPCODE_HA char *str_key; ulong int_key; HashTable *fe_ht; + + if (Z_TYPE_P(array) == IS_STRING) { + return spl_fe_fetch_handler(&array, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + } PZVAL_LOCK(array); # # This is one additional integer comparison and one assembler jump per foreach # loop iteration. Hey that is definitley near zero impact. # Best regards, Marcus mailto:helly@php.net

(Marcus Börger)

23 years ago
Hello Marcus, Tuesday, July 1, 2003, 2:07:38 PM, you wrote: MB> Hello Andi, MB> Tuesday, July 1, 2003, 7:33:45 AM, you wrote: AG>> Hi, AG>> It is still not possible to understand from this .diff what the impact on AG>> the Engine will be MB> No? There a simply 4 additional checks/calls inside zend_execute.c. You can't MB> see the impact of them? strange! But see down below. AG>> because the code it still saturated with copying of code AG>> from the Engine. I have shuffeled some code around. Moved some zend code into a new file called zend_execute_helpers.h and removed some spl code (hopefully this is what you wanted to see). The whole patch becomes harder to understand now. But anyway the impact is the same, only the codesize is same 10 bytes less and if there are more such things the code size can now be kept smaller. Also i included the test files into the patch. http://marcus-boerger.de/php/ext/ze2/ze2-spl-20030701.diff.tgz Best regards, Marcus mailto:helly@php.net

Brad LaFountain

23 years ago
--- Andi Gutmans <andi@zend.com> wrote:
> Hi, > > It is still not possible to understand from this .diff what the impact on > the Engine will be because the code it still saturated with copying of code > from the Engine. My intentation was to review a patch that is ready to be > commited. You shouldn't have to replace opcodes anymore and you shouldn't > have to make copies of functions from within Zend. > Also, does the array overloading stuff allow extension developers like > Andrei also to hook into this?
I think a callback like __array($index) { } for all objects would be a nice feature, so Andrei for gtk and spl wouldn't have to overload the opcode for each application of this. I think it could become a pretty popular feature when developers see that it can be done. - Brad __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com

(Marcus Börger)

23 years ago
Hello Marcus, Monday, June 30, 2003, 2:28:35 AM, you wrote: MB> - Fix __clone() visibility. When implementing singletons we must forbid calling MB> __clone() by making it private (private function __clone() is the same to MB> singletons as private function __construct() to factories). Also the clone MB> mechanism must ensure the new object has all properties defined in the class. MB> The current implementation doesn't do so what contradicts the inheritance MB> model. The following example show both errors: MB> php -r 'class t {var $x; private function __clone() {} }; $a = new t; $b = $a->__clone(); var_dump($a);var_dump($b);' MB> object(t)#1 (1) { MB> ["x"]=> MB> NULL MB> } MB> object(t)#2 (0) { MB> } I looked into the way it works and was able to fix the visibility. However there is still the problem that properties are not copied. I thing there are two possible solutions: a) create all properties in the new object before calling __clone b) create all missing propertis after calling __clone. This way (i fear) we would need a new opcode....
-- Best regards, Marcus mailto:helly@php.net

(Marcus Börger)

23 years ago
Hello Marcus, Wednesday, July 2, 2003, 12:54:12 AM, you wrote: MB> Hello Marcus, MB> Monday, June 30, 2003, 2:28:35 AM, you wrote: MB>> - Fix __clone() visibility. When implementing singletons we must forbid calling MB>> __clone() by making it private (private function __clone() is the same to MB>> singletons as private function __construct() to factories). Also the clone MB>> mechanism must ensure the new object has all properties defined in the class. MB>> The current implementation doesn't do so what contradicts the inheritance MB>> model. The following example show both errors: MB>> php -r 'class t {var $x; private function __clone() {} }; $a = new t; $b = $a->__clone(); var_dump($a);var_dump($b);' MB>> object(t)#1 (1) { MB>> ["x"]=> MB>> NULL MB>> } MB>> object(t)#2 (0) { MB>> } MB> I looked into the way it works and was able to fix the visibility. However MB> there is still the problem that properties are not copied. I thing there are MB> two possible solutions: MB> a) create all properties in the new object before calling __clone MB> b) create all missing propertis after calling __clone. This way (i fear) we MB> would need a new opcode.... After i've spent soem time on the thing i found out that we don't need CG(in_clone_method). So if you don't need it in one of your applications or extensions we can remove it.
-- Best regards, Marcus mailto:helly@php.net

(Marcus Börger)

23 years ago
Hello Marcus, Wednesday, July 2, 2003, 1:13:11 AM, you wrote: MB> Hello Marcus, MB> Wednesday, July 2, 2003, 12:54:12 AM, you wrote: MB>> Hello Marcus, MB>> Monday, June 30, 2003, 2:28:35 AM, you wrote: MB>>> - Fix __clone() visibility. When implementing singletons we must forbid calling MB>>> __clone() by making it private (private function __clone() is the same to MB>>> singletons as private function __construct() to factories). Also the clone MB>>> mechanism must ensure the new object has all properties defined in the class. MB>>> The current implementation doesn't do so what contradicts the inheritance MB>>> model. The following example show both errors: MB>>> php -r 'class t {var $x; private function __clone() {} }; $a = new t; $b = $a->__clone(); var_dump($a);var_dump($b);' MB>>> object(t)#1 (1) { MB>>> ["x"]=> MB>>> NULL MB>>> } MB>>> object(t)#2 (0) { MB>>> } MB>> I looked into the way it works and was able to fix the visibility. However MB>> there is still the problem that properties are not copied. I thing there are MB>> two possible solutions: MB>> a) create all properties in the new object before calling __clone MB>> b) create all missing propertis after calling __clone. This way (i fear) we MB>> would need a new opcode.... HA! I lied there was plan c. Fixed now for normal properties.
-- Best regards, Marcus mailto:helly@php.net

Andi Gutmans

23 years ago
At 01:13 AM 2/7/2003 +0200, Marcus Börger wrote:
>After i've spent soem time on the thing i found out that we don't need >CG(in_clone_method). So if you don't need it in one of your applications or >extensions we can remove it.
I think I used it in the compiler to work around something in clone. This code must have been replaced with other code so I will nuke it. Andi

(Marcus Börger)

23 years ago
Hello Marcus, Monday, June 30, 2003, 2:28:35 AM, you wrote: MB> - Include SPL (forach/array hooking). I tested the current patch: http://marcus-boerger.de/php/ext/ze2/ze2-spl-20030701.diff.tgz and profiled it again. What i did (in case someone doesn't know yet) was to read 10 rows of three columns from a sqlite database 10 times. Further more profiled a 'php -h' call and substracted that timing. So i only have the looping and some very little overhead. Using a normal for loop (minus php -h) is used for 100%. Then i did the same with sqlite_array_query() and got 87%. Then i did it with spl-forach hooking and got 57%. Wow that's nearly 2 times faster...
-- Best regards, Marcus mailto:helly@php.net

(Marcus Börger)

23 years ago
Hello Marcus, Monday, June 30, 2003, 2:28:35 AM, you wrote: MB> - Fix static class members. If the are public they need to be accessible from MB> outside the class. If they have an initial value this value should be used MB> and the keyword var should be working as well. MB> php -r 'class t { static public $p = "x";}; $t = new t; var_dump($t->p);' MB> php -r 'class t { static var $p = "x";}; $t = new t; var_dump($t->p);' MB> php -r 'class t { static public $p = "x";}; echo $t::p;' MB> To make this clear: $t->p would add a dynamic propery to instance t while we MB> want to access the static property p which can only be achieved by a MB> different notation which should be <class>'::'<static_member>. Aha, using <class>::$<member> works....
-- Best regards, Marcus mailto:helly@php.net