Jasper Bryant-Greene schrieb:
> Oliver Grätz wrote:
>
>>3. Yes. One can abuse exceptions to return something in a constructor.
>> Just another argument against exceptions ;-) OK, it's unorthodox,
>> if you absolutely need to do that, do it and tell nobody *g*.
>
> This is not "abusing" except
Oliver Grätz wrote:
3. Yes. One can abuse exceptions to return something in a constructor.
Just another argument against exceptions ;-) OK, it's unorthodox,
if you absolutely need to do that, do it and tell nobody *g*.
This is not "abusing" exceptions. If you throw an exception then the
bruce schrieb:
> but then, i'm starting to realize that there's probably a great deal of
> 'opensource' code that's in use that hasn't been thoroughly vetted.
1. Constructors cannot explicitly return anything because
they always return the new object.
2. OpenSource project and the code in them:
to forget!!
-Original Message-
From: Edward Vermillion [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 14, 2005 2:46 PM
To: [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Subject: Re: [PHP] php/mysql object id question..
bruce wrote:
> stephen,
>
> you're correct re
bruce wrote:
in their constructor, they have the 'return false' arrggghh!!! a quick look
at google, and it appears that you can't return any val from a constructor.
in fact, the 'object id' that's being returned appears to simply be (as you
stated) the instance of the class that was created... as
bruce wrote:
stephen,
you're correct regarding what's going on... i had taken some code used in
phpBB, and blindly slammed it into my app to test out their db class... i
had assumed that it worked
guess what!!!
in their constructor, they have the 'return false' arrggghh!!! a quick look
at
Original Message-
From: Stephen Leaf [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 14, 2005 1:51 PM
To: php-general@lists.php.net
Subject: Re: [PHP] php/mysql object id question..
On Wednesday 14 September 2005 03:42 pm, bruce wrote:
> hi...
>
> i have the following psuedo
On Wednesday 14 September 2005 03:42 pm, bruce wrote:
> hi...
>
> i have the following psuedo code...
>
> i'm showing the pertinent parts, and eliminating the rest...
>
> --
> class sql
> {
>
> function sql(...)
> {
> return false
>
> mysql_
hi...
i have the following psuedo code...
i'm showing the pertinent parts, and eliminating the rest...
--
class sql
{
function sql(...)
{
return false
mysql_
mysql_
}
}
$db = new sql(...)
echo "db" = .$db;
-
9 matches
Mail list logo