Posted by Oli Filth on 09/26/06 23:29
Charles O'Flynn said the following on 26/09/2006 22:05:
> I thought I'd just try out what I wrote above and loaded this up...
>
> <?php
> $loc_place;
>
> function writesomething()
> {
> global $loc_place;
>
> $loc_place = 'This is a test';
> echo $loc_place.'<br />';
> }
>
> echo $loc_place.' again<br />';
> writesomething();
> ?>
>
> As I wrote earlier, I get no sign of any output from outside the function,
> only inside...
>
> This is a test
Well, in this code, $loc_place has no value assigned before
writesomething() is called. Depending on your error settings and
version, I guess the echo $loc_place.' again<br />' line might fail
silently; although in PHP 5 it just echoes " again<br />". I don't have
PHP 4 running to test the behaviour.
--
Oli
[Back to original message]
|