note 36011 deleted from functions by pollita
| From: | pollita@php.net | Date: | Tue, 23 Sep 2003 01:45:40 +0000 |
| Subject: | note 36011 deleted from functions by pollita | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56930@lists.php.net to get a copy of this message | ||
Note Submitter: jon
----
I could be missing a basic principle here, but I thought I'd point this out, as the behavior is
far from what I would expect... Hope it helps.
A lil' bug(?) I seemed to notice is that if you declare a function within a class method, the
function becomes globally available, rather than availble through the class...
<?php
Class Lame {
function Lame()
{
print "I am the constructor.";
}
function foo()
{
function bar()
{
print "I am BAR.\n";
}
print "I am FOO.\n";
}
}
$lame = new Lame;
$lame->foo(); // now "bar" exists.
$lame->bar(); // doesn't work.
bar(); // works! Weird.
?>