Bug #62637 [NEW]: Cannot use return command with variables

From: Date: Mon, 23 Jul 2012 02:32:57 +0000
Subject: Bug #62637 [NEW]: Cannot use return command with variables
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-172166@lists.php.net to get a copy of this message
From: brandonskypimenta at gmail dot com Operating system: Mac OS X PHP version: Irrelevant Package: Scripting Engine problem Bug Type: Bug Bug description:Cannot use return command with variables Description: ------------ When using return command under PHP 5.3.0, the command will not work. Using return $string or return($string) will not work. Test script: --------------- <?php error_reporting( E_ALL ); ini_set( 'display_errors', 1 ); $hello = 'Hello World!'; return $hello; ?> Expected result: ---------------- The text should have appeared on the page. Actual result: -------------- Either: 1) A blank page is given to the user. 2) You get an error message meaning "unexpected T_RETURN". -- Edit bug report at https://bugs.php.net/bug.php?id=62637&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62637&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62637&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62637&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62637&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62637&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62637&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62637&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62637&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62637&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62637&r=support Expected behavior: https://bugs.php.net/fix.php?id=62637&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62637&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62637&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62637&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62637&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62637&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62637&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62637&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62637&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62637&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62637&r=mysqlcfg

« previous php.bugs (#172166) next »