Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67346 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87999 invoked from network); 7 May 2013 19:05:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 May 2013 19:05:23 -0000 Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-wg0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:64089] helo=mail-wg0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A1/F2-06696-27059815 for ; Tue, 07 May 2013 15:05:23 -0400 Received: by mail-wg0-f54.google.com with SMTP id x12so979001wgg.21 for ; Tue, 07 May 2013 12:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=s32/gTrWxb1Z7dVnrDW/Mt8eiNxNka9MUIFZRUNn2JQ=; b=0TDERWq0vE914WhvGHEtXDgJJSh9oIab8LGNzHQq6M395zHE9lyN5/6WrTzd+j3XT4 ZMkw4LnMClZk3fWVFHz8uIipAmq1WSOpK2IYw72A/3Q22FFXvX5qTfiJcqbo8NSGWLCW Vt3lQqTlN4f2KvQE75pDJ75IhV49Jb5+5gw0k0PMEteLkjVw8EPh+vCKvSq7v6l+kKVD UQUzeTmMIZ31sYjLhD400Ee7/9x53j9Z0pS9E8tWXmOLfRsRD5InT2Xx04PXm/iEBK6q EzMPieHeYzNqWOaWiwehZetrI9K5tbbK/TWG+9JgCJU9Vis+GlXLhrm7Ks/KrzNTxF3Z nVXg== X-Received: by 10.180.185.207 with SMTP id fe15mr5344333wic.33.1367953519833; Tue, 07 May 2013 12:05:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.217.79.142 with HTTP; Tue, 7 May 2013 12:04:59 -0700 (PDT) In-Reply-To: References: Date: Tue, 7 May 2013 21:04:59 +0200 Message-ID: To: Thomas Anderson Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11c367609e784604dc257f58 Subject: Re: [PHP-DEV] idea: letting the line number and file name be set via user_error From: krebs.seb@gmail.com (Sebastian Krebs) --001a11c367609e784604dc257f58 Content-Type: text/plain; charset=ISO-8859-1 2013/5/7 Thomas Anderson > If you do user_error('whatever') it'll show, as the line number for that > error, the line number on which that user_error() call is made. It'd be > nice if you could control the line number and file name that was displayed. > eg. > > function test() { > user_error('whatever'); > } > > test(); > ?> > > That'll say "Notice: whatever in ... on line 4" (ie. the line that the > user_error is on) instead of "Notice: whatever in ... on line 7" (ie. the > line that the call to the test() function is made). > Something I don't understand: You call test() in line 7 and line triggers the error, so in fact it is _really_ line 3, that causes the message. So why should it display "line 7", when it is obvious the wrong line? > > If the displayed line numbers could be controlled by user_error then > debug_backtrace could be used to get the desired line number / file name to > display. > -- github.com/KingCrunch --001a11c367609e784604dc257f58--