# RC1

- Thread: https://externals.io/message/17552
- Original archive: https://news-web.php.net/php.internals/17552
- Started by Andi Gutmans on 2005-08-05T20:52:13+00:00
- Messages: 9
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #17552 — Andi Gutmans — 2005-08-05T20:52:13+00:00

URL: https://externals.io/message/17552#17552

Hi all,

Another reminder, I'd like to roll RC1 on Monday. Everyone will be back 
from OSCON and we can start the Unicode merge right afterwards.

Andi

---

## #17579 — Pierre-Alain Joye — 2005-08-08T07:32:08+00:00

URL: https://externals.io/message/17552#17579 · In reply to: #17552

On Fri, 05 Aug 2005 13:52:13 -0700
andi@zend.com (Andi Gutmans) wrote:

> Hi all,
> 
> Another reminder, I'd like to roll RC1 on Monday. Everyone will
> be back from OSCON and we can start the Unicode merge right
> afterwards.

One thing I would like to solve in 5.1 is instanceof (or the
deprecation of is_a).

instanceof is useless much of the times as it raises a fatal error
as soon as the tested class does not exist. Since when tests raise
fatal error?

Sample script:
class test{}
$a = new test;
if ($a instanceof Foo) {
        echo "not foo";
}

result:
Fatal error: Class 'Foo' not found in /home/pierre/cvs/builds/
php_head/instanceof.php on line 4


I can write a patch to "fix" it if we agree that the current
behavior is not correct.

Regards,

--Pierre

---

## #17580 — Pierre-Alain Joye — 2005-08-08T09:48:18+00:00

URL: https://externals.io/message/17552#17580 · In reply to: #17579

Hello,

I took a short look to the implementation.

instanceof_ex works as expected, no error display there. The
problem comes from the usage of class_name_reference in the parser.

class_name_reference calls zend_do_fetch_class, which raises this
error as no class is loaded.

Now I'm not sure about a clean solution, it's fine to raise a fatal
error when class_name_reference is used with new, but in the case
of instanceof, it does not make sense.

add a class_name_reference_silent? :)

--Pierre

---

## #17613 — Michael Wallner — 2005-08-08T16:26:30+00:00

URL: https://externals.io/message/17552#17613 · In reply to: #17579

Hi Pierre-Alain Joye, you wrote:

> I can write a patch to "fix" it if we agree that the current
> behavior is not correct.

While you're at it, could you continue on fixing the following:
(another evidence that the current "generic" behaviour is bad)

try {
	// anything
} catch (NonExistantException $e) {
}

Fatal error: Class 'NonExistantException' not found


For reference:
http://marc.theaimsgroup.com/?l=php-dev&m=111887012528058&w=2
http://marc.theaimsgroup.com/?l=php-dev&m=109404375329280&w=2
http://marc.theaimsgroup.com/?l=php-dev&m=109218461900310&w=2

Regards,
--
Michael - < mike(@)php.net

---

## #17618 — Marcus Boerger — 2005-08-08T18:17:03+00:00

URL: https://externals.io/message/17552#17618 · In reply to: #17613

Hello Michael,

Monday, August 8, 2005, 6:26:30 PM, you wrote:

> Hi Pierre-Alain Joye, you wrote:

> > […]

> While you're at it, could you continue on fixing the following:
> (another evidence that the current "generic" behaviour is bad)

> try {
>         // anything
> } catch (NonExistantException $e) {
> }

> Fatal error: Class 'NonExistantException' not found

This is a very different topic. While "instanceof missingclass" can never
result to any problem the former violates hard coded requirements. Thus i
think dropping the message from instanceof is acceptable - but i am not
going to decide this so don't take my second thoughts on this one too
serious.

Best regards,
 Marcus

---

## #17619 — Pierre-Alain Joye — 2005-08-08T18:18:16+00:00

URL: https://externals.io/message/17552#17619 · In reply to: #17613

On Mon, 08 Aug 2005 18:26:30 +0200
mike@php.net (Michael Wallner) wrote:

> Hi Pierre-Alain Joye, you wrote:
> 
> > […]
> 
> While you're at it, could you continue on fixing the following:
> (another evidence that the current "generic" behaviour is bad)
> 
> try {
> 	// anything
> } catch (NonExistantException $e) {
> }
> 
> Fatal error: Class 'NonExistantException' not found

You try to declare (if it get catched) a non existent class. Not
really related to instanceof, it's like a new nonexistantclass;

--Pierre

---

## #17709 — Wez Furlong — 2005-08-09T18:02:58+00:00

URL: https://externals.io/message/17552#17709

Maybe a little late throwing my 2 cents in, but here they are anyway.
If you're writing an app that can optionally use a component that is
not present, there is nothing conceptually wrong with calling
instanceof to determine if that support is present; PHP should not
blow up.  If the class is not loaded, then the object can't possibly
be an instance of it, therefore the operator should return false.

--Wez.


> You are wrong because __autoload() *is* called and you can load the class
> on the-fly. The only problem is if the class does not exist in your code
> base, in which case, your application should blow up!
> 
> Andi
> 
> At 07:44 AM 8/9/2005 +0200, Pierre-Alain Joye wrote:
> > […]

---

## #17757 — Daniel Convissor — 2005-08-09T22:38:49+00:00

URL: https://externals.io/message/17552#17757

> 
> if(class_exists('MyFoo') && $obj instanceof MyFoo) { }

Unfortunately, `class_exists()` still calls __autoload().  Un-deprecating 
 `is_a()` seems to be an easy way to resolve this situation.

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409

---

## #17758 — Marcus Boerger — 2005-08-09T23:03:06+00:00

URL: https://externals.io/message/17552#17758 · In reply to: #17757

Hello Daniel,

  RTFM: try class_exists(..., false)

marcus

Wednesday, August 10, 2005, 12:38:49 AM, you wrote:

> 
> > […]

> Unfortunately, `class_exists()` still calls __autoload().  Un-deprecating 
> `is_a()` seems to be an easy way to resolve this situation.

> --Dan

> -- 
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>             data intensive web and database programming
>                 http://www.AnalysisAndSolutions.com/
>  4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409




Best regards,
 Marcus
