Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend.c zend_execute_API.c zend_vm_def.h zend_vm_execute.h php-src NEWS

From: Date: Fri, 11 Apr 2008 10:37:29 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend.c zend_execute_API.c zend_vm_def.h zend_vm_execute.h php-src NEWS
References: 1  Groups: php.internals php.zend-engine.cvs 
Request: Send a blank email to internals+get-36936@lists.php.net to get a copy of this message
On Fri, 11 Apr 2008, Dmitry Stogov wrote: > dmitry Fri Apr 11 09:43:31 2008 UTC > > Modified files: (Branch: PHP_5_3) > /php-src NEWS > /ZendEngine2 zend.c zend_execute_API.c zend_vm_def.h > zend_vm_execute.h > Log: > Optimized ZEND_RETURN opcode to not allocate and copy return value if it is not > used. Hmm, I'm not too happy with this, as it breaks some functionality in Xdebug. Xdebug allows you to create a function trace, including all return values. For example the following script: <?php function foo() { return 42; } foo(); echo foo(); ?> Gave a function trace like (with php -d xdebug.auto_trace=1 -dxdebug.collect_return=1 test-ft.php): TRACE START [2008-04-11 10:29:49] 0.0002 650528 -> {main}() /tmp/test-ft.php:0 0.0003 650840 -> foo() /tmp/test-ft.php:8 >=> 42 0.0004 650840 -> foo() /tmp/test-ft.php:9 >=> 42 >=> 1 0.0013 54536 TRACE END [2008-04-11 10:29:49] However, with this change, I only get: TRACE START [2008-04-11 10:32:11] 0.2148 652336 -> {main}() /tmp/test-ft.php:0 0.2907 652648 -> foo() /tmp/test-ft.php:8 0.3178 652648 -> foo() /tmp/test-ft.php:9 >=> 42 0.4802 56344 TRACE END [2008-04-11 10:32:12] Is it still possible to get the return values of the functions that are *not* used? I currently check if EG(return_value_ptr_ptr) and *EG(return_value_ptr_ptr) are not NULL to see if there is a return value, and now (of course) they are empty (null pointer). regards, Derick -- Derick Rethans http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org

« previous php.internals (#36936) next »