Re: [PHP-DEV] Declaration of Bar::__construct() must be

2004-02-27 Thread Greg Beaver
Zeev Suraski wrote: If you take into account that [a] in PHP, you cannot have more than one signature for a method in a given class, and you take into account the fact that [b] your overriding method must be able to satisfy the same interface as the method its overriding The real solution is

Re: [PHP-DEV] SimpleXML & Casting to String

2004-02-27 Thread Sterling Hughes
BP_VAR_R just tells the engine not to through a warning when the property doesn't exist. The problem is that we need to handle cases like: $doc = simplexml_load_string('bar'); echo $doc->name["attr"]; echo $doc->name; Both would be covered by BP_VAR_R AFAIR. What if the string is empty and th

Re: [PHP-DEV] SimpleXML & Casting to String

2004-02-27 Thread Andi Gutmans
Basically SimpleXML should know if the property is being fetched for read or not (type is passed such as BP_VAR_R or BP_VAR_W). If the case is BP_VAR_R (read access) then SimpleXML should return the value and not an object. There might be some places in the engine which aren't covered but it's b

[PHP-DEV] Memory leak with .=

2004-02-27 Thread Timm Friebe
The following script: buf.= ($string instanceof StringBuffer ? $string->buf : $string ); } } $s= new StringBuffer(); $s->append('Hello'); ?> causes: /usr/home/thekid/devel/php/php/Zend/zend_execute.c(4049) : Freeing 0x083B0310 (6 bytes), script=string.php /usr

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Marcus Boerger
Hello Timm, Friday, February 27, 2004, 7:39:26 PM, you wrote: > On Fri, 2004-02-27 at 14:39, Stig S. Bakken wrote: >> On Fri, 2004-02-27 at 14:13, Derick Rethans wrote: > [...] >> What is worse is that many PHP 4 APIs need to be completely redesigned >> for PHP 5, not only the guts of the class.

Re: [PHP-DEV] SimpleXML & Casting to String

2004-02-27 Thread Marcus Boerger
Hello Adam, Friday, February 27, 2004, 7:37:15 PM, you wrote: > I know we discussed this already, but after seeing a couple of bug > reports about SimpleXML, I'm worried our decision only makes sense to > us and not to regular users. :) > Specifically, since elements and attibutes look like stri

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Timm Friebe
On Fri, 2004-02-27 at 14:39, Stig S. Bakken wrote: > On Fri, 2004-02-27 at 14:13, Derick Rethans wrote: [...] > What is worse is that many PHP 4 APIs need to be completely redesigned > for PHP 5, not only the guts of the class. > > IMHO method overloading the the only clean way out of this. Agre

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Andrei Zmievski
On Fri, 27 Feb 2004, Andi Gutmans wrote: > What I suggest is the following: > a) Don't check signature for constructors. > b) By default, don't check signature for inheritance *if* we're not > inheriting from an abstract class. If it is an abstract class we should > check the signature because it

[PHP-DEV] SimpleXML & Casting to String

2004-02-27 Thread Adam Maccabee Trachtenberg
I know we discussed this already, but after seeing a couple of bug reports about SimpleXML, I'm worried our decision only makes sense to us and not to regular users. :) Specifically, since elements and attibutes look like strings, people expect them to act like strings. But since they're not objec

Re: [PHP-DEV] Fw: [PHP-DOC] #27345 [Opn]: Status header with PHP CGI

2004-02-27 Thread Stefan Walk
On Fri, Feb 27, 2004 at 03:56:07PM -, Nuno Lopes wrote: > So, what shall I do? > Mark this bug as bogus or update the documentation. If yes, what should I > add/remove/modify? > > Nuno There's no problem with the documentation, the behaviour is wrong. when doing header('HTTP/1.1 404 Not Fou

Re: [PHP-DEV] Fw: [PHP-DOC] #27345 [Opn]: Status header with PHP CGI

2004-02-27 Thread Nuno Lopes
So, what shall I do? Mark this bug as bogus or update the documentation. If yes, what should I add/remove/modify? Nuno - Original Message - > Unless of course there is code in there to look for HTTP/ and set the > appropriate status code. This code used to be there, but it may have > g

Re: [PHP-DEV] stdClass

2004-02-27 Thread Michael Walter
Hartmut Holzgraefe wrote: Jakes wrote: Oh, yes and special methods that you mentioned would come in handy too but from a object perspective. Maybe explicitly calling some sort finalize() method to clean un-referenced objects would also be handy. finalize() is one of the worst concepts of JAVA

Re: [PHP-DEV] stdClass

2004-02-27 Thread Michael Walter
Jakes wrote: cool, Im going to look more into the engine to see the working. I suppose PHP it isn't as memory intensive as JAVA Quick question, does the zend engine have a garbage collector while we are on the topic? As said, it uses reference counting. Cheers, Michael "Hartmut Holzgraefe" <[EMA

[PHP-DEV] linking with VS.NET: executor_globals_id is an unresolved external symbol

2004-02-27 Thread David Sklar
Using Visual Studio.NET, I can build PHP fine using the php5ts project/solution. I have a problem, however, with another project I've added to the solution which is a custom extension with no external (to PHP) library dependencies. It was working (compiling, linking, and then being loaded into PHP

Re: [PHP-DEV] Declaration of Bar::__construct() must be

2004-02-27 Thread Andi Gutmans
At 10:25 27/02/2004 -0500, Hans Lellelid wrote: Hi - Andi Gutmans wrote: The question is if we should ignore constructors from this check. I think we should but one person here thought we shouldn't. I think constructors should be ignored. OK Is everyone OK with peforming this check for abstract

Re: [PHP-DEV] Declaration of Bar::__construct() must be

2004-02-27 Thread Hans Lellelid
Hi - Andi Gutmans wrote: The question is if we should ignore constructors from this check. I think we should but one person here thought we shouldn't. I think constructors should be ignored. Is everyone OK with peforming this check for abstract classes and interfaces? Or do you think it should

Re: [PHP-DEV] stdClass

2004-02-27 Thread Jakes
cool, Im going to look more into the engine to see the working. I suppose PHP it isn't as memory intensive as JAVA Quick question, does the zend engine have a garbage collector while we are on the topic? "Hartmut Holzgraefe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jakes wrot

Re: [PHP-DEV] stdClass

2004-02-27 Thread Hartmut Holzgraefe
Jakes wrote: You calling it from the base so cleaning you be easier than looking for object referenced variables and setting them to null. Working in a large class hierarchy it could get painful. __destruct() and as far as object references in variables are concerned: the engine destructs all inst

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Derick Rethans
On Fri, 27 Feb 2004, Andi Gutmans wrote: > At 14:13 27/02/2004 +0100, Derick Rethans wrote: > >On Fri, 27 Feb 2004, Andi Gutmans wrote: > > > > > d) Last problem is that using E_STRICT is not a good idea because we find > > > this problem at compile-time and the error_reporting might not be set ye

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread George Schlossnagle
On Feb 27, 2004, at 10:05 AM, Andi Gutmans wrote: Yeah but people are used to setting the error_reporting from prepend's or at the beginning of the script. But you know what, I guess we can live with this because I see a few E_WARNINGS at the compile stage. So I guess we could go with E_STRICT f

Re: [PHP-DEV] stdClass

2004-02-27 Thread Hartmut Holzgraefe
Jakes wrote: Oh, yes and special methods that you mentioned would come in handy too but from a object perspective. Maybe explicitly calling some sort finalize() method to clean un-referenced objects would also be handy. finalize() is one of the worst concepts of JAVA that i can think of: a somehow-

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Andi Gutmans
At 14:13 27/02/2004 +0100, Derick Rethans wrote: On Fri, 27 Feb 2004, Andi Gutmans wrote: > d) Last problem is that using E_STRICT is not a good idea because we find > this problem at compile-time and the error_reporting might not be set yet. The INI system is 'booted' before the script is compile

Re: [PHP-DEV] Fw: [PHP-DOC] #27345 [Opn]: Status header with PHP CGI

2004-02-27 Thread Rasmus Lerdorf
Unless of course there is code in there to look for HTTP/ and set the appropriate status code. This code used to be there, but it may have gotten dropped along the way. -Rasmus On Fri, 27 Feb 2004, Nuno Lopes wrote: > Can anybody clarify this, please? > Nuno > > > - Original Message - >

Re: [PHP-DEV] stdClass

2004-02-27 Thread Jakes
You calling it from the base so cleaning you be easier than looking for object referenced variables and setting them to null. Working in a large class hierarchy it could get painful. "Michael Walter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jakes wrote: > > Oh, yes and special

Re: [PHP-DEV] stdClass

2004-02-27 Thread Michael Walter
Jakes wrote: Oh, yes and special methods that you mentioned would come in handy too but from a object perspective. Maybe explicitly calling some sort finalize() method to clean un-referenced objects would also be handy. How does that differ from $x=null; with a reference-counting garbage collector

Re: [PHP-DEV] stdClass

2004-02-27 Thread Jakes
Oh, yes and special methods that you mentioned would come in handy too but from a object perspective. Maybe explicitly calling some sort finalize() method to clean un-referenced objects would also be handy. - Original Message - From: "Jakes Potgieter" <[EMAIL PROTECTED]> Newsgroups: php.i

Re: [PHP-DEV] stdClass

2004-02-27 Thread Jakes Potgieter
When Im talking about something like this would come in handy obviously doesnt work! The paramter null could be added, to get desired result but to be programmatically correct: class MyOverload{ function __construct($Foo) { $this->Foo = $Foo; } // overload the constructor funct

Re: [PHP-DEV] stdClass

2004-02-27 Thread Hartmut Holzgraefe
Jakes Potgieter wrote: It would be nice to have a base class to inherit some special methods as we do in Java. could you name which ones you think of? being out of the JAVA camp for several years know i no longer know all java.object methods and properties by heart, but PHP mechanisms like __sle

Re: [PHP-DEV] stdClass

2004-02-27 Thread Michael Walter
Jakes Potgieter wrote: It would be nice to have a base class to inherit some special methods as we do in Java. [...] What would be useful methods contained in the base class? Thanks. - Original Message - From: "Stephan Schmidt" <[EMAIL PROTECTED]> Newsgroups: php.internals To: "'Jakes'"

Re: [PHP-DEV] stdClass

2004-02-27 Thread Jakes Potgieter
It would be nice to have a base class to inherit some special methods as we do in Java. The same as method overloading, one of the most important aspects missing in PHP5 and the new object model. Thanks. - Original Message - From: "Stephan Schmidt" <[EMAIL PROTECTED]> Newsgroups: php.i

[PHP-DEV] Fw: [PHP-DOC] #27345 [Opn]: Status header with PHP CGI

2004-02-27 Thread Nuno Lopes
Can anybody clarify this, please? Nuno - Original Message - > ID: 27345 > Updated by: [EMAIL PROTECTED] > Reported By: php_bugs at ecora dot de > Status: Open > Bug Type:Documentation problem > PHP Version: Irrelevant > New Comment: > > I couldn't reproduce thi

RE: [PHP-DEV] stdClass

2004-02-27 Thread Stephan Schmidt
Hi, > > Please can some explain to me what the stdClass is used for in > > PHP 5. I've tried to use the reflection API to reverse engineer it > > but it does not give you much on the stdClass > No. There is no such thing as Java's base class built into PHP. > stdClass is just an empty "dummy cl

Re: [PHP-DEV] stdClass

2004-02-27 Thread Stig S. Bakken
On Fri, 2004-02-27 at 14:15, Jakes wrote: > Please can some explain to me what the stdClass is used for in > PHP 5. I've tried to use the reflection API to reverse engineer it > but it does not give you much on the stdClass > > What methods can be inherited from this class? > > Does it work the

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Stig S. Bakken
On Fri, 2004-02-27 at 14:13, Derick Rethans wrote: > On Fri, 27 Feb 2004, Andi Gutmans wrote: > > > d) Last problem is that using E_STRICT is not a good idea because we find > > this problem at compile-time and the error_reporting might not be set yet. > > The INI system is 'booted' before the sc

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Michael Walter
George Schlossnagle wrote: On Feb 27, 2004, at 4:12 AM, Andi Gutmans wrote: Hey, I'd like to come to some conclusion about the latest changes which break BC (trying to keep it short because some people here wrote long essays and it took me too much time to catch up :) : a) I agree that it does

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread George Schlossnagle
On Feb 27, 2004, at 4:12 AM, Andi Gutmans wrote: Hey, I'd like to come to some conclusion about the latest changes which break BC (trying to keep it short because some people here wrote long essays and it took me too much time to catch up :) : a) I agree that it doesn't make much sense for con

[PHP-DEV] stdClass

2004-02-27 Thread Jakes
Please can some explain to me what the stdClass is used for in PHP 5. I've tried to use the reflection API to reverse engineer it but it does not give you much on the stdClass What methods can be inherited from this class? Does it work the same was as the java base class - Object?

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Derick Rethans
On Fri, 27 Feb 2004, Andi Gutmans wrote: > d) Last problem is that using E_STRICT is not a good idea because we find > this problem at compile-time and the error_reporting might not be set yet. The INI system is 'booted' before the script is compiled, so I doubt that this is a problem. > What I

Re: [PHP-DEV] [Fwd: PATCH: operator precedence test and some wordsize stuff]

2004-02-27 Thread Ard Biesheuvel
Jan Lehnardt wrote: your patch contains more than just the new testcase. That's probably the reason, why it wasn't committed yet. That's why it says '... and some wordsize stuff' in the subject line. -- Ard -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Patrick Schnorbus
On Friday 27 February 2004 11:12, Ferdinand Beyer wrote: > On 27 Feb 2004 at 10:58, Patrick Schnorbus wrote: > > Mhm. Does a signature make sense if the engine ignores it > > anyway? > > > For better readability one can use phpdoc/doxygen like comment > > blocks. > > That's right. But I don't see a

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Patrick Schnorbus
On Friday 27 February 2004 10:12, Andi Gutmans wrote: > What I suggest is the following: > a) Don't check signature for constructors. Okie ;) > b) By default, don't check signature for inheritance *if* we're not > inheriting from an abstract class. > If it is an abstract class we should > check

Re: [PHP-DEV] Declaration of Bar::__construct() must be

2004-02-27 Thread Eric Daspet
Andi Gutmans wrote: b) By default, don't check signature for inheritance *if* we're not inheriting from an abstract class. If it is an abstract class we should check the signature because it's a PHP 5 feature. Do you mean : - check the signature only for methods which were in the abstract class

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Stephane Drouard
== Quote from Andi Gutmans ([EMAIL PROTECTED])'s article > a) Don't check signature for constructors. Constructors are definitely not virtual methods. So no reason to check signature. Moreover, this is a non sense to declare constructors in interfaces or abstract constructors in abstract classes.

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Ferdinand Beyer
On 27 Feb 2004 at 10:58, Patrick Schnorbus wrote: > Mhm. Does a signature make sense if the engine ignores it anyway? > For better readability one can use phpdoc/doxygen like comment blocks. That's right. But I don't see a reason why we should disallow to use a signature in an interface declar

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Patrick Schnorbus
On Friday 27 February 2004 10:41, Ferdinand Beyer wrote: > On 27 Feb 2004 at 11:12, Andi Gutmans wrote: > > Comments? (Please try to keep them short :) > > I think we should just drop the signature check. Interfaces may > include a signature for better readability but the engine should ignore > the

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Stanislav Malyshev
AG>> c) Add a new INI option (zend.strict_inheritance_checks) which AG>> does check signature for methods (except for constructor). I AG>> don't like new INI options but I don't think there's any way AG>> out. There's a dilemma about this option. On one hand, it should be on by default. Otherwise,

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Ferdinand Beyer
On 27 Feb 2004 at 11:12, Andi Gutmans wrote: > Comments? (Please try to keep them short :) I think we should just drop the signature check. Interfaces may include a signature for better readability but the engine should ignore them. PHP4 class trees work fine even without strict inheritance ch

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Andi Gutmans
Hey, I'd like to come to some conclusion about the latest changes which break BC (trying to keep it short because some people here wrote long essays and it took me too much time to catch up :) : a) I agree that it doesn't make much sense for constructors, because one always creates concrete cl

Re: [PHP-DEV] Bogus Error Message?

2004-02-27 Thread Derick Rethans
On Thu, 26 Feb 2004, John Coggeshall wrote: > > $reflect = new Reflection_Class("Object"); > > $docs = $reflect->getDocComment(); > if(!empty($docs)) { > echo "Has Docs.\n"; > } > > if(!empty($reflect->getDocComment())) { > echo "Has Docs.\n"; > } > > ?> >