Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93411 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62870 invoked from network); 20 May 2016 09:08:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 May 2016 09:08:21 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wm0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:33050] helo=mail-wm0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/39-05406-304DE375 for ; Fri, 20 May 2016 05:08:19 -0400 Received: by mail-wm0-f41.google.com with SMTP id i142so3523213wmf.0 for ; Fri, 20 May 2016 02:08:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=o/7EBtAe/kBYZcBuNfl3EL1Sm2r3x2i3Aj1smXhgBAI=; b=QcfMVthyasTfUIasHpKbzNqyYsWzcDhwPpmQ7LAEIJJbmmHlQmQmhjvm5g+CZD4UZ8 bT5ek1hKHnfekptLGUrRFsUQvyCfGaY61x4dCWYmY+gDRqkqQErii6M0E7a27s7NktOV zMYX67xGQiLVGb8mNAC8xlcLZ6kbFoITOl+U5Ef/+9CtCpMr+IVpOPPJMBX+iTxZ634z DNHn024Opdlnl5ESkhOhRzOlJ3it7PzGP7+WH2/Dk4MyCziRszR+41ILXKwn1vA1R+HK D5kEhWo9f5WR8l1GnQ2VjkZ149Rj0UchM+ublsPOeRxkXZ5iT0II7Mt1ZO4BREQmZWIs 6QpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=o/7EBtAe/kBYZcBuNfl3EL1Sm2r3x2i3Aj1smXhgBAI=; b=nEDrC9VKLawOnZtsEsRSsY8xbCUgIeeLiO7Mn9eqV850rg2mv/bRZCBc8gCFlmvdhr UvQFktZZ6OuwdJmLyV/nJyj8EskRR30sF/gfjQRLxew/r1mDPs3wIHYNj3yuNKWk3vXV 30LoU7CaaMXSF00Klj2+GiQ81KNR5BIG2Gg32yhTvWxbRF7d/3kNVwookfiIUr+C1691 9xU9waiZLl6meQRbBpUXkQAjCF/PD6ndLbqhNOxkLfAxBn6KHN+/87OO55uOS9swFR7W lKWBW12tlhBtbIMtFdY0spBSHnLVD4/BuSygfE/WEh2iwR+m/NySJLsDsJ+kK3+qX+aB ue9Q== X-Gm-Message-State: AOPr4FXH7A8Uh4vepqUS2tPKuqltsvHIW56730ITJZuNYr0sMEC9MfrV3ZXA82U34A5eSQ== X-Received: by 10.28.113.86 with SMTP id m83mr161426wmc.67.1463735296965; Fri, 20 May 2016 02:08:16 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id m3sm18738068wjc.27.2016.05.20.02.08.15 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 May 2016 02:08:16 -0700 (PDT) To: internals@lists.php.net References: <72f547d6-5fcf-3cd2-960d-cb612a429e47@php.net> Message-ID: Date: Fri, 20 May 2016 10:06:05 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Exception::getLine() From: rowan.collins@gmail.com (Rowan Collins) On 20/05/2016 08:22, Niklas Keller wrote: > 2016-05-20 4:13 GMT+02:00 Jesse Schalken : >> The top frame is the construction (get_error) and the site of the throw >> (do_throw) doesn't appear in the stack at all. >> > > The comparison with JavaScript isn't a good one, since you can throw > everything in JS. If they didn't provide the stack trace upon throw, you > would not have a stack trace at all if you throw a plain string. > That explanation justifies completely the opposite behaviour to what Jesse described. According to MDN [1] the "stack" property is completley unstandardised, and some engines may indeed populate it on throw, but there's no hint on that page that they'll attach it to anything not constructed as an Error. So it's not a great comparison for either side (note that it was originally brought up by Rasmus as an example where it *does* come from the throw site) because the language doesn't actually guarantee you a stack trace at all. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack Regards, -- Rowan Collins [IMSoP]