#48392 [Opn->Bgs]: Reflection API does not see parameter list for __get()

From: Date: Tue, 26 May 2009 00:53:02 +0000
Subject: #48392 [Opn->Bgs]: Reflection API does not see parameter list for __get()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-137731@lists.php.net to get a copy of this message
ID: 48392 Updated by: felipe@php.net Reported By: php at adamashley dot name -Status: Open +Status: Bogus Bug Type: Reflection related Operating System: Ubuntu 9.04 PHP Version: 5.2.9 New Comment: Hello, You mistyped 'parameters': print_r($prarmeters); Previous Comments: ------------------------------------------------------------------------ [2009-05-26 00:33:18] php at adamashley dot name Description: ------------ The Reflection API does not return details of the parameter list for __get() Reproduce code: --------------- <? class testReflect { function get( $name ) { return $name; } function __get( $name ) { switch( $name ) { case 'one': return 1; case 'two': return 2; } } } $class = new ReflectionClass('testReflect'); $method = $class->getMethod('__get'); $parameters = $method->getParameters(); print "testReflect::__get()\n"; print_r($prarmeters); $method = $class->getMethod('get'); $parameters = $method->getParameters(); print "testReflect::get()\n"; print_r($parameters); ?> Expected result: ---------------- testReflect::__get() Array ( [0] => ReflectionParameter Object ( [name] => name ) ) testReflect::get() Array ( [0] => ReflectionParameter Object ( [name] => name ) ) Actual result: -------------- testReflect::__get() testReflect::get() Array ( [0] => ReflectionParameter Object ( [name] => name ) ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48392&edit=1

« previous php.bugs (#137731) next »