This should work as follows: if class hasn't member with given name,
__get/__set is called. If class has no method with given name, __call is called.
__get/__set are not recursive, __call can be.
- global function information because it wasn't available. We have to do
- an additional assignment per-function call so that it'll be available.
- Also don't define the global scope as function name _main_ but leave it
- empty so that frameworks like Pear can decide what they want to do.
- understand why Java didn't do so.
- If you still want to control destruction of your object then either make
- sure you kill all references or create a destruction method which you
- call yourself.
There are still a few problems such as includes and calling other functions
from internal functions which aren't seen (will have to think if and how to
fix this).
Also the main scripts filename isn't available. Need to think about that.
- correctly to the scope of the functions class.
<?php
function Hello()
{
print "Wrong one\n";
}
class MyClass {
static $hello = "Hello, World\n";
function Hello()
{
print self::$hello;
}
function Trampoline()
{
Hello();
}
}
import function Trampoline from MyClass;
Trampoline();
?>
<?php
class MyOuterClass {
class MyInnerClass {
function func1()
{
print "func1()\n";
}
function func2()
{
print "func2()\n";
}
}
}
import class * from MyOuterClass;
import function func2 from MyOuterClass::MyInnerClass;
MyInnerClass::func1();
func2();
- It isn't complete yet but I want to work on it from another machine. It
- shouldn't break anything else so just don't try and use it.
- The following is a teaser of something that already works:
<?php
class MyClass
{
function hello()
{
print "Hello, World\n";
}
class MyClass2
{
function hello()
{
print "Hello, World in MyClass2\n";
}
}
}
import function hello, class MyClass2 from MyClass;
MyClass2::hello();
hello();
?>
Note: only standard Zend objects are working now. This is definitely going to
break custom objects like COM, Java, etc. - this will be fixed later.
Also, this may break other things that access objects' internals directly.