Bug #76414 [Nab]: return echo("foo"); ought to work as expected

From: Date: Tue, 05 Jun 2018 11:16:17 +0000
Subject: Bug #76414 [Nab]: return echo("foo"); ought to work as expected
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215496@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76414&edit=1 ID: 76414 User updated by: aleemb at gmail dot com Reported by: aleemb at gmail dot com Summary: return echo("foo"); ought to work as expected Status: Not a bug Type: Bug Package: *General Issues Operating System: OSX PHP Version: 7.2.6 Block user comment: N Private report: N New Comment: @requinix, is there any reason echo can't be tweaked to behave in the same manner? Previous Comments: ------------------------------------------------------------------------ [2018-06-05 10:32:39] requinix@php.net Use print(). ------------------------------------------------------------------------ [2018-06-05 10:30:22] aleemb at gmail dot com Description: ------------ This is either a bug or a feature request, either way the following should work as expected: return echo("foo"); It should echo "foo" and return. Test script: --------------- return echo("foo"); Expected result: ---------------- foo Actual result: -------------- PHP Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting ';' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76414&edit=1

« previous php.bugs (#215496) next »