Bug #69991 [Opn->Ver]: Fatal error

From: Date: Sat, 04 Jul 2015 00:52:58 +0000
Subject: Bug #69991 [Opn->Ver]: Fatal error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194113@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69991&edit=1

 ID:                 69991
 Updated by:         requinix@php.net
 Reported by:        dievartg at gmail dot com
 Summary:            Fatal error
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            Reflection related
 Operating System:   linux
 PHP Version:        7.0.0alpha2
 Block user comment: N
 Private report:     N

 New Comment:

Yes, it is raising an error rather than throwing an exception.
http://3v4l.org/f20S1#v700alpha2

Note that it doesn't make sense to extend ReflectionFunctionAbstract because you can't
provide the "reflection object" which the error is talking about.


Previous Comments:
------------------------------------------------------------------------
[2015-07-03 19:46:50] dievartg at gmail dot com

Description:
------------
Hello,

a fatal error (no catchable) is thrown when I attempt to call the mehod getReturnType from a class
inheriting of ReflectionFunctionAbstract

Do you think it's a normal behavior ?

Test script:
---------------
<?php

class MockReflectionMethod extends ReflectionFunctionAbstract
{
    public static function export() {}
    public function __toString() {}
}


try {
    (new MockReflectionMethod)->isStatic();    
} catch(Throwable $e) {
    echo $e->getMessage();
}

try {
    (new MockReflectionMethod)->getReturnType();
} catch(Throwable $e) {
    echo $e->getMessage();
}

// output:
// Call to undefined method MockReflectionMethod::isStatic()
// Fatal error: ReflectionFunctionAbstract::getReturnType(): Internal error: Failed to retrieve the
reflection object

Actual result:
--------------
http://3v4l.org/7LjRK


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



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


Thread (7 messages)

« previous php.bugs (#194113) next »