Commit Graph

371 Commits

Author SHA1 Message Date
Andi Gutmans
77b3ffbc5a - Require $this-> when calling a methods. This whole automatic lookup
- first in the class and then in the global scope is confusing, slow and
- not quite BC compatible.
2002-10-07 21:46:44 +00:00
Andi Gutmans
278a00e1d8 - Fix problem with unsetting object members. 2002-10-06 19:55:31 +00:00
Ilia Alshanetsky
ee7b8f906d MFZE1 2002-09-26 18:56:11 +00:00
Andi Gutmans
f78fa50423 - Megapatch to try and support inheritance from sub-classes. Things might
- be *very* buggy now so don't get too upset if that happens.
- I still need to improve some stuff but it's a good step (hopefully).
2002-09-24 19:05:53 +00:00
Andi Gutmans
7f6c2da50a - WS fix - "while (" instead of "while(" 2002-09-15 07:46:20 +00:00
Andi Gutmans
43139dc755 - WS - Always use "if (" and not "if(" 2002-09-15 07:45:26 +00:00
Stanislav Malyshev
d8651c82cd Support for __get, __set and __call in classes.
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.
2002-09-04 09:07:58 +00:00
Stanislav Malyshev
c8a659f8f6 MFZE1 2002-09-02 09:13:53 +00:00
Thies C. Arntzen
10b58f2110 those are set by RETURN_FROM_EXECUTE 2002-08-23 12:18:54 +00:00
Thies C. Arntzen
d88ca858aa zend_execute: make sure that current_execute_data points to the right thing
after coming back from recursion.
2002-08-21 13:58:20 +00:00
Andi Gutmans
2372caf57e MFZE1 2002-08-17 20:20:36 +00:00
Zeev Suraski
b66561c44a MFZE1 2002-08-17 16:22:40 +00:00
Andi Gutmans
52406cb37c - Make new 'is' operator work with classes only and return false when
- the object isn't of the said class or the value isn't an object.
2002-08-08 16:32:34 +00:00
Zeev Suraski
6025b804c2 MFZE1 2002-08-03 09:44:27 +00:00
Stanislav Malyshev
0e7c1f4609 MFZE1 2002-08-01 16:07:19 +00:00
Jason Greene
b0cf6c3112 MFZE1 global declare 2002-07-30 22:19:50 +00:00
Andrei Zmievski
82c72f2799 @- Adding 'is' operator that can be used to check the type of a variable,
@  or its class. (Andrei)
2002-07-30 04:07:15 +00:00
Andi Gutmans
41e3f4f0c3 - Fix problem with debug_backtrace() reported by Stig. We weren't reporting
- 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.
2002-07-26 10:38:25 +00:00
Andi Gutmans
7b68f5108a - Nuke delete(). It was a big mistake to introduce it and I finally
- 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.
2002-07-14 19:23:18 +00:00
Andi Gutmans
35e8d8139e - Nuke some unused code 2002-07-14 18:17:07 +00:00
Andi Gutmans
677a9e8751 - Fix problem where scope was lost in nested function calls.
- Thanks to Timm Friebe for diving into this one.
2002-07-06 17:44:45 +00:00
Andi Gutmans
ede84fa384 - Improve some error messages. 2002-06-29 15:30:27 +00:00
Andi Gutmans
b55a20abf4 - Fix problem with scope's not changing correctly during method calls.
- Reapply a tiny optimization to the allocator so that in non-debug mode
- we clean memory without detecting leaks.
2002-06-26 11:07:35 +00:00
Andi Gutmans
68663bf96b - Revert patch which checks at run-time if you're allowed to assign
- certain values by reference.
- We still need to find a solution for cases when this shouldn't be allowed
- as it might cause leaks.
2002-06-24 17:58:22 +00:00
Andi Gutmans
9c148f0d84 - Fix problem with constructor not being inherited and called correctly. 2002-06-23 15:46:58 +00:00
Andi Gutmans
690c85b406 - Fix bug in class constants
- Start centralizing main class lookups. This will help implement
- __autload()
2002-06-16 18:25:05 +00:00
Andi Gutmans
b2015c5610 - Fix problem with assigning functions by reference. 2002-06-11 17:33:53 +00:00
Stanislav Malyshev
3a419fa8dd Fix leak 2002-06-10 09:15:02 +00:00
Sebastian Bergmann
e449646b68 Remove unused local variable. 2002-06-05 18:17:19 +00:00
Andi Gutmans
2d6404d5b0 - Allow overloaded objects to receive the method name in its original
- case.
2002-06-05 17:34:56 +00:00
Andi Gutmans
14a81f91e3 - Hopefully fix problems with debug_backtrace() 2002-05-08 18:43:19 +00:00
Andi Gutmans
b66c89c47a - More debug backtrace work. It still doesn't work very well... 2002-05-07 18:42:13 +00:00
Andi Gutmans
7e5ec2d761 Initial support for built-in backtracing.
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.
2002-05-02 17:20:48 +00:00
Harald Radi
51e797f1e3 some type cleanup work 2002-04-23 18:06:54 +00:00
Andi Gutmans
c84a4ead95 - Pass TSRMLS to callbacks. 2002-03-15 16:26:17 +00:00
Andi Gutmans
db84afb206 - Scope fix. When calling an imported function the scope will change
- 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();
?>
2002-03-15 15:28:06 +00:00
Andi Gutmans
0ce019f715 - Fix issues with $this when using it by itself without indirection such as
- $this->foo.
2002-03-15 15:09:46 +00:00
Stanislav Malyshev
40becd37e5 fix for delete $this and unset $this 2002-03-14 16:00:48 +00:00
Andi Gutmans
c8c629b3fc - Fix bug introduced with latest class hash table change. 2002-03-12 18:53:27 +00:00
Stanislav Malyshev
92dd5e611b - make class tables contain class_entry *, not class_entry
- fix isset($this)
2002-03-12 10:08:47 +00:00
Andi Gutmans
d77ff9607e - Fix build in ZTS mode. 2002-03-10 21:02:00 +00:00
Stanislav Malyshev
04ed2b520f New stuff for objects API:
- Better assignment handling
- More flexible operations with zval-containing objects
2002-03-10 13:42:37 +00:00
Andi Gutmans
90f6005f58 - Support importing constants. e.g.:
<?php

	class MyOuterClass {
		const Hello = "Hello, World\n";
	}

	import const Hello from MyOuterClass;
	print Hello;
2002-03-08 10:58:24 +00:00
Andi Gutmans
83f102fd9f - Add function * and class * functionality. Only constants are left.
<?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();
2002-03-06 17:08:26 +00:00
Andi Gutmans
b90d80b588 - Initial patch to support importing from class scopes (for Stig).
- 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();
?>
2002-03-02 20:38:52 +00:00
Andi Gutmans
90bd4539c7 - Remove use of C++ reserved words namespace/this 2002-03-01 14:27:26 +00:00
Stanislav Malyshev
6608f07322 Mega-commit: Enter the new object model
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.
2002-02-07 14:08:43 +00:00
Andi Gutmans
8535164f21 - This small patch should also take care of allowing unseting of $this->foo
- and static members. The unset() opcode was luckily already suitable for
- object overloading.
2002-02-04 20:44:24 +00:00
Andi Gutmans
e366f5dbd8 - Fix problem with the objects_destructor called during shutdown. It was
- freeing objects from id 0 instead of id 1. id 0 is not used.
- Change isset/empty opcodes to support static members and the new way of
- doing $this->foobar. Also the opcodes operate now on the hash table
- combined with the variable names so that they can be overloaded by the
- soon to be added overloading patch.
2002-02-04 19:29:56 +00:00
Andi Gutmans
c2b73faade - Fix a bug reported by Sebastian with indirect class names not working. 2002-01-22 18:02:52 +00:00