#38185 [Opn->Bgs]: variables not set from function
| From: | martin dot dreier at web dot de | Date: | Sun, 23 Jul 2006 12:23:46 +0000 |
| Subject: | #38185 [Opn->Bgs]: variables not set from function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99789@lists.php.net to get a copy of this message | ||
ID: 38185
User updated by: martin dot dreier at web dot de
Reported By: martin dot dreier at web dot de
-Status: Open
+Status: Bogus
Bug Type: Output Control
Operating System: Mac OS X 10.4.7
PHP Version: 5.1.4
New Comment:
Well, somehow the caracter 'Ê' got in there, but was displayed
as space in my editor.
<?php
$abcÊ= $_SERVER['HTTP_HOST'];
....
Works now. Sorry for the inconvenience.
Previous Comments:
------------------------------------------------------------------------
[2006-07-23 12:05:11] martin dot dreier at web dot de
With error_reporting(E_ALL), output is now:
localhostx/
Notice: Undefined variable: abc in /Library/WebServer/
Documents/dCMS/test.php on line 6
y/no/abcd
------------------------------------------------------------------------
[2006-07-22 13:05:32] sniper@php.net
Works fine for me. Try adding error_reporting(E_ALL); as first line in
your script and try again.
------------------------------------------------------------------------
[2006-07-22 10:39:17] martin dot dreier at web dot de
Description:
------------
When trying to set a variable from a function return value,
this variable is not set. I am using a local Apache 1.3.3 on a
Mac OS X 10.4.7 Client.
Reproduce code:
---------------
<?php
$abc = $_SERVER['HTTP_HOST'];
echo $_SERVER['HTTP_HOST'] . "x";
echo "/";
echo $abc . "y";
echo "/";
echo isset($abc) ? "yes" : "no";
echo "/";
$abc = "abc";
echo $abc . "d";
exit;
?>
Expected result:
----------------
127.0.0.1x/127.0.0.1y/yes/abcd
Actual result:
--------------
127.0.0.1x/y/no/abcd
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38185&edit=1