ID: 26924
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Bogus
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5CVS-2004-01-15 (dev)
New Comment:
It's all about context..:)
Of course you can call private functions within the class they
belong to. But you can't call the function from 'outside'.
ie. if you tried to call 't::dont();' you'd get that error..
(or maybe I misunderstood this? :)
Previous Comments:
------------------------------------------------------------------------
[2004-01-15 13:27:44] [EMAIL PROTECTED]
Description:
------------
Private class methods can be called by instantiating an object of this
class in an static method.
Reproduce code:
---------------
<?php
class t {
private function dont() {
echo "intended?\n";
}
static function main() {
$t = new t();
$t->dont();
}
}
t::main();
?>
Expected result:
----------------
Fatal error: Call to private method t::dont() ...
Actual result:
--------------
intended?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26924&edit=1