This article mainly introduces the PHP to obtain, check class name, function name, method name function method, this article summarizes 7 functions and the use of the introduction, the need for friends can refer to the
1.function_exists ()-Return
Import# Gets the calling function name linenumber = Sys._getframe (). F_back.f_lineno # Get line number print# Gets the current function nameImportInspectdefget_current_function_name ():returnInspect.stack () [1][3]classMyClass:defFunction_one
Sample code:
function hi () {
var a = 1;
return function () {
console.log (a++);
}
;}; var aaa = hi ();
var bbb = hi;
As above code:
AAA is to assign the running result of hi () to it, that is, the anonymous function returned by
PHP for case sensitive problem processing is messy, write code may occasionally problem, so here is summed up.But I am not encouraging everyone to use these rules. We recommend that you always adhere to the "case sensitive", follow the Uniform Code
PostgreSQL tables, function names are strictly case-sensitive, so when used without notice that the case of the problem is easy to find the function name error, but in the last two days we found that if the function parameters use a custom data type,
This article mainly introduces how to obtain the currently running class name and function name dynamically in python, including the built-in method, sys module, modifier, and inspect module, for more information, see
1. Use the built-in method and
ConfusedBefore parsing the Web page with Sgmllib, I met def do_a (self,attr), which can automatically identify and parse the contents of this kind of function. When you look at Learningpythonthehardway, you also encounter a function name such as
Why can't I remember PHP function names? why can't I remember PHP function names?
Reply to discussion (solution)
Remember when you use moreAlthough php has many functions, dozens of commonly used functions
Well. At the beginning, this was the
Help! When declaring a function, the function name is preceded by an & amp; what does it mean ??? This post was last edited by zx11307 from 2013-12-2417: 57: 24 as described in: for example, function & nbsp; & amp; ret_ref () {$ varphp; return &
How does Python use a variable as the function name? PHP has variable function usage (see http://www.php.net/manual/en/functions.variable-functions.php)
There is a string variable
Now we want to use the value of this variable as a function name
This article describes how to obtain and check the class name, function name, and method name in php. This article summarizes the functions and usage of the seven functions, for more information, see 1. function_exists ()-Return TRUE if the given
Why can't I remember PHP function names? why can't I remember PHP & nbsp; function names? Solution: ------------------ when I use more, I remember that although & nbsp; php & nbsp; there are many functions, but dozens of commonly used solutions -----
This article is due to the answer to a question in the csdn forum. I will sort it out to help my friends who have the same requirements.
If you have dynamically loaded the DLL, you should be clear about the getprocaddress API. Its function is to
Obtain the name of the Javscript execution function. The specific function is as follows:
The function name is getFuncName. You can directly use the getFuncName function to obtain the Javascript function name.
Method for obtaining the name of
PHP notes (1)-Function name
call the function in PHP (I personally think that "function" is more appropriate than "method"), in front of the function name plus @, then error message does not appear when executing function error .
For example:
Event monitoring has been error, suggesting that the defined function name is not a function, tossing a long time to think, the original is the function of the name and JS internal key words caused by the duplicate.Have encountered this situation
Method temporarily sees two types of: ①eval: Def a (): print ' 1 ' func_a = ' a ' eval (func_a) () Results: 1 ②.vars: Gets all the variables in the current environment. Def a (): print ' 1 ' func_a = ' a ' VARs () [func_a] () Results: 1 For
For example, we want to set a method in a class can be stored in a class variable according to the call into a method, and so on, when needed, by accessing the class variable to be obtained.
Usually if we generate an instance
such as: Var temp=new
Today, when tracking a piece of open source code, because the code is not familiar with, so to print some key information. Then I sorted the macro that could print the file name, line number, and function name.
1, print file name, line number,
: http://blog.163.com/zhangjinqing1234@126/blog/static/307302602012111295026614/
--------------------------------------------------------------------------------------------------------------- ----------------------------------
The thing is, in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.