You are here: Re: List of PHP functions and classes « PHP Programming Language « IT news, forums, messages
Re: List of PHP functions and classes

Posted by ImOk on 05/16/06 07:29

I tried the test according to the docs. It seems the method of
ReflectionFunction->getParameters() does not work for internal
functions although it detects the parameters. Any ideas? Is this a bug
or am i doing something wrong?

<?php
print phpversion(); // 5.1.4

function baz(ReflectionFunction $a, $b = 1, $c = null) { }

// Create an instance of Reflection_Function with the
// parameter given from the command line.
$reflect = new ReflectionFunction("baz"); // works for this one.
//$reflect = new ReflectionFunction("strncmp"); // e.g. does not work
for this function

echo $reflect;

foreach ($reflect->getParameters() as $i => $param) {
printf(
"-- Parameter #%d: %s {\n".
" Class: %s\n".
" Allows NULL: %s\n".
" Passed to by reference: %s\n".
" Is optional?: %s\n".
"}\n",
$i,
$param->getName(),
var_export($param->getClass(), 1),
var_export($param->allowsNull(), 1),
var_export($param->isPassedByReference(), 1),
$param->isOptional() ? 'yes' : 'no'
);
}

?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация