Bug #70282 [Nab->Fbk]: class not shown in reflection exception

From: Date: Tue, 18 Aug 2015 14:29:33 +0000
Subject: Bug #70282 [Nab->Fbk]: class not shown in reflection exception
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195294@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70282&edit=1

 ID:                 70282
 Updated by:         cmb@php.net
 Reported by:        info at dynasource dot eu
 Summary:            class not shown in reflection exception
-Status:             Not a bug
+Status:             Feedback
 Type:               Bug
 Package:            Reflection related
 Operating System:   W7
 PHP Version:        7.0.0beta3
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

> have you seen my attachment? It says it all.

Um, there is no attachment. Please post the code directly here if
it is short, and otherwise use some other service (e.g. pastebin).


Previous Comments:
------------------------------------------------------------------------
[2015-08-18 14:10:03] info at dynasource dot eu

have you seen my attachment? It says it all.

The error message does not give me any clue about the $class variable, which I wanted to reflect,
but had a wrong namespace so ReflectionClass couldnt find it.

The error message should give me something like:

ReflectionException:
Class "\mynamespace\wrongfolder\MyClass" does not exist.

Instead, I get this:

ReflectionException:
Class does not exist.

IMHO, not very informative ;)

------------------------------------------------------------------------
[2015-08-18 11:59:20] cmb@php.net

In the supplied test script, $class is not defined, so the
exception message is:

| Uncaught ReflectionException: Class  does not exist in [...]

Note the two spaces between "Class" and "does". Actually, the
name of the class is printed between these two spaces, but the
name is an empty string.

------------------------------------------------------------------------
[2015-08-18 10:15:51] info at dynasource dot eu

not in the attachment I posted

------------------------------------------------------------------------
[2015-08-18 09:07:45] laruence@php.net

I don't understand what problem here?

"$class" is  substituted as expected

------------------------------------------------------------------------
[2015-08-17 11:59:22] info at dynasource dot eu

Description:
------------
when creating a new ReflectionClass object with a class that doesnt exist, this class is not showing
in the reflection class exception. This does happen in 5.6.* versions of PHP.

Test script:
---------------
$reflection = new ReflectionClass($class);



Expected result:
----------------
an exception with "$class does not exist"

Actual result:
--------------
an exception with "Class does not exist" (not the variable $class)


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=70282&edit=1


Thread (15 messages)

« previous php.bugs (#195294) next »