Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47727 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93112 invoked from network); 1 Apr 2010 22:09:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Apr 2010 22:09:00 -0000 Authentication-Results: pb1.pair.com header.from=nlgordon@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=nlgordon@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: nlgordon@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-ww0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:41363] helo=mail-ww0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/3A-44965-A7915BB4 for ; Thu, 01 Apr 2010 17:08:59 -0500 Received: by wwc33 with SMTP id 33so1130304wwc.29 for ; Thu, 01 Apr 2010 15:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=uKKtXfTxhBeK7axG6bHrKYtDlVlnS50rHE54q3nMW0Y=; b=CHJN4u/n7j32i7aEf+3PM3iwcZTV8kdMRrYz8gfJ6N+1qdJ6OKenQaQvFpyMeHSc1P dQJIDanF57ZrSHP4qKf6C/Pn1In0N9LHT54lHZjFVfT3M4Nil/5PurrnnQm74pOre7an TE0NTRBJAMWfma9cK+/vnXGpKZ/1/WI/ddIs0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=RI2Nc/YFNqhaKNGgpNh7QUntmHnf0G0HxCk3QqcPpbKitop/UMoLB+T0Pqhf0tFC2t jL5wQ7OQedUAIh9zzZq68wVanESRH1q0OS1fJExDy/G89MzR9LkLwYHY3esVT5RAecwd u0wWALPrCFXZ2FDCbsbi6Jd3ihElQbrt78G48= MIME-Version: 1.0 Received: by 10.216.185.142 with HTTP; Thu, 1 Apr 2010 15:08:55 -0700 (PDT) In-Reply-To: <4BB42028.1050007@zend.com> References: <4BB42028.1050007@zend.com> Date: Thu, 1 Apr 2010 16:08:55 -0600 Received: by 10.216.86.19 with SMTP id v19mr763354wee.218.1270159735438; Thu, 01 Apr 2010 15:08:55 -0700 (PDT) Message-ID: To: Stanislav Malyshev Cc: PHP internals Content-Type: multipart/alternative; boundary=0016e6d99bfed6bc840483341b76 Subject: Re: [PHP-DEV] Serializing Closures From: nlgordon@gmail.com (Nate Gordon) --0016e6d99bfed6bc840483341b76 Content-Type: text/plain; charset=UTF-8 On Wed, Mar 31, 2010 at 10:25 PM, Stanislav Malyshev wrote: > Hi! > > > prevented. The short background of what I'm doing is serializing >> backtraces >> when errors occur so that I can better diagnose bugs my clients report. >> But >> when a closure is passed as a function parameter somewhere in the call >> tree, >> things just flat out exlode with the error: >> > > Hmm, serializing backtrace may be tricky - a lot of stuff there might be > unserializable. In general, serializing is not meant to be used for > debugging. You might have better luck with debug printing functions. > But nevertheless this: > > Fatal error: Exception thrown without a stack frame in Unknown on line *0* >> > > doesn't look good. It'd be nice if you made a short code example and > submitted a bug about it. I think reporting there might be improved. I'm starting to agree with you on serializing a backtrace. custom encoding, or captured text of debug_print_backtrace would probably be better to remove complex arguments. We have a nice backtrace browser that we use that draws the backtrace with the code from the line it was called from. Its handy for reviewing what went wrong from a client perspective, but it is hard to capture the entire state of a running app to store in a database. I've submitted a bug for the other part of this (nested exceptions), and maybe I will even submit a patch, time pending. > > > Thus, would it be possible to degrade this from something as severe as an >> exception to being a simple warning, or just silently ignoring it and >> continuing with the serialization? I would compare this to resource >> handles >> for mysql connections and the like. Those are silently ignored. >> > > Maybe it should be null+warning? > I'm leaning that way, but I'm biased towards making serialization more fool proof. -- -Nathan Gordon If the database server goes down and there is no code to hear it, does it really go down? :wq --0016e6d99bfed6bc840483341b76--