From:             Progman2002 at gmx dot de
Operating system: 
PHP version:      5.2.9RC2
PHP Bug Type:     Feature/Change Request
Bug description:  A new language construct for var_dump'ing and returning a 
value

Description:
------------
During debugging and helping other users you want to print/debug/var_dump
a value to check its value. Currently you write something like
var_dump($sql); before you use the variable to check its content. But it
may be better to just use a language construct which
1. output the parameter as like var_dump do
2. return the parameter as like without the language construct. As an
example this language construct could be named "debugprint" and be used as
followed.

// original code
mysql_query(a_function_which_generates_a_query());

// old-debugging style
var_dump($sql = a_function_which_generates_a_query());
mysql_query($sql);

// using of "debugprint"
mysql_query(debugprint a_function_with_generates_a_query());

It must be a language construct and not a function as it should be easily
prepended before any possible value without writing a closing parentheses
for a function call.

// bad
mysql_query(debugprint(a_function_with_generates_a_query()));

// good
mysql_query(debugprint a_function_with_generates_a_query());

So you can simply remove this keyword/statement if not needed anymore (and
dont need to check which parenthese you must remove aswell).

Note: I'm not talking here about using a professional debugger as other
people may help other people with their scripts they wrote. These people
may don't use a professional debugger at all and only know
"echo-debugging". So instead of saying "save the return value of the
function in a variable and output it with var_dump for debugging" it could
be just "write 'debugprint' before your function to check the return value"
and the script itself is still running (as the language construct returns
the value, too)


-- 
Edit bug report at http://bugs.php.net/?id=47453&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47453&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47453&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47453&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47453&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47453&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47453&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47453&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47453&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47453&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47453&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47453&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47453&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47453&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47453&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47453&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47453&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47453&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47453&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47453&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47453&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47453&r=mysqlcfg

Reply via email to