Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25834 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13244 invoked by uid 1010); 26 Sep 2006 11:32:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 13229 invoked from network); 26 Sep 2006 11:32:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2006 11:32:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=prometheus__0@hotmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=prometheus__0@hotmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.54.246.94 as permitted sender) X-PHP-List-Original-Sender: prometheus__0@hotmail.com X-Host-Fingerprint: 65.54.246.94 bay0-omc1-s22.bay0.hotmail.com Windows 2000 SP4, XP SP1 Received: from [65.54.246.94] ([65.54.246.94:15013] helo=bay0-omc1-s22.bay0.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/48-54386-BCF09154 for ; Tue, 26 Sep 2006 07:32:29 -0400 Received: from hotmail.com ([207.46.10.103]) by bay0-omc1-s22.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 26 Sep 2006 04:32:25 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 26 Sep 2006 04:32:25 -0700 Message-ID: Received: from 207.46.10.123 by by121fd.bay121.hotmail.msn.com with HTTP; Tue, 26 Sep 2006 11:32:21 GMT X-Originating-IP: [81.189.9.34] X-Originating-Email: [prometheus__0@hotmail.com] X-Sender: prometheus__0@hotmail.com To: internals@lists.php.net Bcc: Date: Tue, 26 Sep 2006 11:32:21 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 26 Sep 2006 11:32:25.0045 (UTC) FILETIME=[70650850:01C6E15F] Subject: how is a return values stored? From: prometheus__0@hotmail.com ("Prometheus Prometheus") hiho@ll 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 example: class A{ public function __construct(){} public function __destruct(){ // here i want the return value like: $retval = idontknowwhichfunction(); print $retval; // this print's "test" } } function B(){ $classvar = new A(); return "test"; } 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 another option for this, would be just debugging of such applications cause it can be boring to debug big applications and with such a possibility i can reproduce the problem very fast and at any point within my application 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? 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? Q3: anybody has another idea for such a "testing" or debugging environment? the main advantage of such a system would be: i can start debugging from any point within my code and i could very easily create automated test's which can compare the result (what it is and what it should be) "automated" thx@ll