473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Geting current function name

Hi,

I'd like to get the name of the class & method I'm using.
For example :
class myclass{
function myfunction()
{
echo "class name : " . get_class($this) ;
echo "method name : " . ?????? ;
}
}

How can I get it ?
Many thanks in advance,

--
Alex
Aug 27 '05 #1
2 40060
You want the magic constant __FUNCTION__

More info here:

http://www.php.net/manual/en/languag...predefined.php

Aug 27 '05 #2
"ZeldorBlat" <ze********@gmail.com> a écrit dans le message de news:
11**********************@f14g2000cwb.googlegroups. com...
You want the magic constant __FUNCTION__

More info here:

http://www.php.net/manual/en/languag...predefined.php


thanks :-)
Aug 28 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Brian Donovan | last post by:
Hi all, Is there a way to identify the current function. For example: class A: def B(self): print current_function_name
3
by: Norton | last post by:
Dear All, Does anyone know hoe to get the current procedure name in Vb.Net ? Example Private Function TestingMe() as string Return thisProcedureName End Function and the function can...
2
by: Jozef | last post by:
Hello, Is there a way to find the current machine name using VB? I'm trying to log user activity, but I'd also like to log the location as well i.e. if errors occur, then I can get an idea what...
7
by: Kumaravel | last post by:
Can I print the current function name in c? something like __LINE__? for e.g can I do printf( " the current file is %s : function is : %s and line # is :%d\n", __FILE__, __FUNC__, __LINE__);
11
by: Ken Varn | last post by:
I want to be able to determine my current line, file, and function in my C# application. I know that C++ has the __LINE__, __FUNCTION__, and __FILE___ macros for getting this, but I cannot find a...
0
by: Ezequiel, Justin | last post by:
See module inspect
1
by: Scott McFadden | last post by:
C++ has some nice macros for obtaining the current function name, current source file, and current line number (__FUNCTION__, __FILE__, __LINE__). Does C# have any comparable MACROS?
15
by: dspfun | last post by:
Hi, Is it possible to print the function name of the calling function? For example, f1() and f2() both calls f3(), in f3() I would like to print the name of the function calling f3() which...
1
by: Gary Robinson | last post by:
Alex Martelli has a cookbook recipe, whoami, for retrieving the name of the current function: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66062. It uses sys._getframe(). I'm a little wary...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.