Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25837 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96084 invoked by uid 1010); 26 Sep 2006 16:24:55 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 96069 invoked from network); 26 Sep 2006 16:24:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2006 16:24:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 82.94.239.5 cause and error) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Linux 2.5 (sometimes 2.4) (4) Received: from [82.94.239.5] ([82.94.239.5:50603] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/40-25907-35459154 for ; Tue, 26 Sep 2006 12:24:53 -0400 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id k8QGH7V7020340; Tue, 26 Sep 2006 18:17:07 +0200 Date: Tue, 26 Sep 2006 18:16:46 +0200 (CEST) X-X-Sender: derick@localhost To: Prometheus Prometheus cc: PHP Developers Mailing List In-Reply-To: Message-ID: References: X-Face: "L'&?Ah3MYF@FB4hU'XhNhLB]222(Lbr2Y@F:GE[OO;"F5p>qtFBl|yVVA&D{A(g3[C}mG:199P+5C'v.M/u@Z\![0b:Mv.[l6[uWl' MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] how is a return values stored? From: derick@php.net (Derick Rethans) On Tue, 26 Sep 2006, Prometheus Prometheus wrote: > i was just asking myself, if it is possible, to get the return value of a > function after the function calls "return" (or throws an exception) and before > the value is returned Only through an extension. > i thought it would be a very impressive function for that purpose > for what i would need it: > think about testing a big php application > calling hundreds of functions and debugging them takes very long > but if i could track the arguments (debug_back_trace() function) AND the > return values (that's what i'm asking for) i could run a complete test and > after this i could change the input values automated and compare it with the > output i got before Xdebug (http://xdebug.org) does this with trace files storing both function/method name, parameters and return values to a file on disk. See: http://xdebug.org/docs-settings.php#auto_trace (and the 3 settings after it in the docs) > the question is: > Q1: how is the return value (return or throw) stored within php? > or another question would be: is it possible to write an extension which > can retrieve every variable set within my php session? (i know of the security > problems this produces, but until know, i'm evaluating if it can work) and > would be the return value within this variables? > any hint on this would be great! > since it's possible to create a sandbox within php (runkit extension) i think > it should be possible to get the return value (or exception object) before the > calling function receives it, not? Yes, this is possible with an extension. You would need to reimplement the zend_execute function. Again, you can find on how to do that in the Xdebug sources. > Q2: maybe i didn't find it, but is there a finished php function which i can > use like debug_back_trace but for the return value? There is none. regards, Derick