[PHP] Emulating Java Exceptions

2002-07-12 Thread Garland Foster
Hi All, I'm porting Java Code to PHP, my question is: What is the best approach to emulate Java exceptions in PHP4? (I know ZE2 adds exceptions but I can't wait). When a Java method throws an exception it is difficult to handle as a return of an exception object since then I'd have to check

Re: [PHP] Emulating Java Exceptions

2002-07-12 Thread Alberto Serra
ðÒÉ×ÅÔ! Garland Foster wrote: Hi All, I'm porting Java Code to PHP, my question is: What is the best approach to emulate Java exceptions in PHP4? (I know ZE2 adds exceptions but I can't wait). If the exceptions you have to manage are code generated at runtime you actually may simply

Re: [PHP] Emulating Java Exceptions

2002-07-12 Thread Garland Foster
Alberto, I might have expressed the problem wrongly, if you have lets suposse you have: $obj = new foo(); $obj-some(); And some might return an exception object. The problem is that some may call a lot of other methods from foo and I don't want to check if the return value of each method call

Re: [PHP] Emulating Java Exceptions

2002-07-12 Thread Alberto Serra
ðÒÉ×ÅÔ! Garland Foster wrote: Alberto, I might have expressed the problem wrongly, if you have lets suposse you have: $obj = new foo(); $obj-some(); And some might return an exception object. The problem is that some may call a lot of other methods from foo and I don't want to