www.webdeveloper.com
Results 1 to 3 of 3

Thread: Calling Functions & Filenames

  1. #1
    Join Date
    Oct 2005
    Location
    Gold Coast, Australia
    Posts
    2,115

    Calling Functions & Filenames

    Hia, is there a more efficent method of retrieving the line number and script filename in the literal call of a function then this?
    PHP Code:
    // call to function
    error((__LINE__), (__FILE__), 'some error...');

    function 
    error($line_num$filename$error_msg$error_type E_USER_WARNING) {
     
    // 
    Any insight or suggestions would be much appreciated, thanks.

  2. #2
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    i'm pretty sure using a constant is extremely efficient...

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,537
    Code-execution-wise, this may not be more efficient, but it potentially gives you a few more pieces of information to work with:
    PHP Code:
    error(debug_backtrace(), "Oops, I did it again!");

    function 
    error($debug$error_msg$error_type E_USER_WARNING)
    {
      
    print_r($debug);

    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles