Commit Graph

1682 Commits

Author SHA1 Message Date
Derick Rethans
1f9464e345 - MFZE1 2002-03-02 13:48:13 +00:00
Derick Rethans
0c6be86747 - MFZE1 2002-03-02 13:26:37 +00:00
8ff2ad53f2 ChangeLog update 2002-03-02 01:20:39 +00:00
Andrei Zmievski
a8609b1ba7 MFZE1 2002-03-01 17:34:52 +00:00
Andrei Zmievski
2310414868 MFZE1 2002-03-01 17:26:31 +00:00
Andi Gutmans
90bd4539c7 - Remove use of C++ reserved words namespace/this 2002-03-01 14:27:26 +00:00
Andi Gutmans
d1eea3de9c - Fix bug in nested try/catch's
- Infrastructure for implementing imports of methods.
2002-03-01 14:04:51 +00:00
Andi Gutmans
2505f6b400 - Fix crash reported by Sebastian when destructor function causes a fatal
- error. I hope this does it and we don't find any other problems.
2002-03-01 10:26:10 +00:00
71139b307d ChangeLog update 2002-02-27 01:33:13 +00:00
Andi Gutmans
7df1601239 - MFZE1 2002-02-26 19:17:26 +00:00
8ca013f2ae ChangeLog update 2002-02-22 01:29:52 +00:00
Sebastian Bergmann
6a59c7fcd3 Maintain ZEND_CHANGES to account for the addition of private member variables. 2002-02-21 13:10:31 +00:00
Andi Gutmans
00e90f2ff3 - Experimental support for private members.
<?
	class MyClass {
		private $Hello = "Hello, World!\n";

		function printHello()
		{
			print $this->Hello;
		}
	}

	class MyClass2 extends MyClass {
		function printHello()
		{
			MyClass::printHello(); /* Should print */
			print $this->Hello; /* Shouldn't print out anything */
		}
	}

	$obj = new MyClass();
	print $obj->Hello; /* Shouldn't print out anything */
	$obj->printHello(); /* Should print */

	$obj = new MyClass2();
	print $obj->Hello; /* Shouldn't print out anything */
	$obj->printHello();
?>
2002-02-21 11:50:44 +00:00
37a929e5dd ChangeLog update 2002-02-15 01:22:47 +00:00
Stanislav Malyshev
cefbdccb98 Pass TSRM to create_object 2002-02-14 09:20:51 +00:00
Andrei Zmievski
68a82f14a2 Fix the bug where the declared properties without init values were not
entered into the table.
2002-02-14 04:01:53 +00:00
6578efea09 ChangeLog update 2002-02-14 01:20:35 +00:00
Andi Gutmans
21b04ff2a6 @ Allow a series of consecutive catch() statements (Andi, Zend Engine)
<?php
	class MyException1 {

	}

	class MyException2 {

	}

	try {
		throw new MyException2();
	} catch (MyException1 $m) {
		print "Caught MyException1";
	} catch (MyException2 $m) {
		print "Caught MyException2";
	}
2002-02-13 19:26:07 +00:00
3b01fd8973 Adding automagically updated ChangeLog. 2002-02-12 17:28:41 +00:00
Sebastian Bergmann
1fd542fd38 Export lex_scan(). Both the PHPDoc and tokenizer extension need this. I hope this is okay with Z&A. 2002-02-10 12:54:02 +00:00
Andi Gutmans
b04238698f - Remove object debug messages. 2002-02-08 00:22:37 +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
Adam Dickmeiss
4935636521 Zend config sets ZEND_EXTRA_LIBS. Bugs 14452, 14602, 14616, 14824 2002-02-03 20:42:10 +00:00
Sebastian Bergmann
cb2124be7c Revert per Andi's request. Sorry :-( 2002-02-02 19:55:21 +00:00
Sebastian Bergmann
fd884e2bea Fix warning. Again :-) 2002-02-02 19:47:24 +00:00
Andi Gutmans
2c95fc2d55 - Please don't use strcmp() and friends in Zend but only the mem*
- functions. I didn't check this patch so please check that it works.
2002-02-02 19:35:18 +00:00
Sebastian Bergmann
86469a0dfb Fix a warning. 2002-02-02 19:18:25 +00:00
Andi Gutmans
180f91bac8 - Nice catch by Derick. GINIT is dead. 2002-02-02 16:56:17 +00:00
Sebastian Bergmann
031784c687 MFZE1: is_a() 2002-02-01 22:55:02 +00:00
Sebastian Bergmann
55cdbf3a6d MFZE1: define a couple of macros under win32. (Patch By: Jon Parise <jon@php.net>) 2002-01-27 20:20:19 +00:00
Andi Gutmans
7309a6ed21 - First destructor hell fix. There was a situation where an object's
- destructor could be run after its class was already dead. Right now
- object destructors is the first thing whic happens during shutdown in
- order to prevent this problem. It's very likely that destructors will
- cause more grief and we'll have to outline exactly when you should use
- them and what kind of logic you're allowed to do inside of them.
- This bug was reported by sebastian.
2002-01-25 12:55:03 +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
Andi Gutmans
2131b019c7 - Improve performance of functions that use $GLOBALS[]
- Please check this and make sure it doesn't break anything.
2002-01-20 20:42:15 +00:00
Thies C. Arntzen
a0ab80ab80 MFZE1 2002-01-19 10:35:51 +00:00
Andi Gutmans
65f01545a8 - Fix crash bug in call_user_function_ex(). Thanks to Sebastian for the
- very nice and short reproducing script.
<?php
	$array = array('foo', 'bar');

	uasort($array, 'cmp');

	function cmp($a, $b)
	{
		return (strcmp($a[1], $b[1]));
	}
?>
2002-01-14 16:55:23 +00:00
Sebastian Bergmann
7e1957044d Update Exceptions example. 2002-01-14 12:14:18 +00:00
Andi Gutmans
f1e8815c26 - Change exception handling to use the Java-like catch(MyException $exception)
- semantics. Example:
<?php

	class MyException {
		function __construct($exception)
		{
			$this->exception = $exception;
		}

		function Display()
		{
			print "MyException: $this->exception\n";
		}

	}
	class MyExceptionFoo extends MyException {
		function __construct($exception)
		{
			$this->exception = $exception;
		}
		function Display()
		{
			print "MyException: $this->exception\n";
		}
	}

	try {
		throw  new MyExceptionFoo("Hello");
	} catch (MyException $exception) {
		$exception->Display();
	}
?>
2002-01-13 20:21:55 +00:00
Andi Gutmans
1f2f2571e4 - MFZE1 2002-01-13 17:51:18 +00:00
Andi Gutmans
b9355b9a11 - Output error when there's an uncaught exception (by Timm Friebe) 2002-01-06 20:30:41 +00:00
Andi Gutmans
0f398e4d4a - Make sure $this is passed on to methods 2002-01-06 19:52:22 +00:00
Sebastian Bergmann
62dc854bb0 Happy New Year. 2002-01-06 15:21:36 +00:00
Andi Gutmans
e1876cba4d - Small fix 2002-01-05 20:55:56 +00:00
Andi Gutmans
e56fb1639b - Allow passing of $this as function arguments.
- Fix a bug which I introduced a couple of months ago
2002-01-05 19:59:09 +00:00
Andi Gutmans
a4248dd584 - Significantly improve the performance of method calls and $this->member
- lookups.
2002-01-05 15:18:30 +00:00
Andi Gutmans
eb08cb956b - Improve performance of indirect-referenced function calls 2002-01-04 09:21:16 +00:00
Andi Gutmans
878f78a6d6 - Nuke C++ comments 2002-01-04 08:07:39 +00:00
Andi Gutmans
6203a250f7 - Separate other kinds of function calls too.
- Significantly improve performance of function calls by moving lowercasing
- the function name to compile-time when possible.
2002-01-04 08:05:21 +00:00
Andi Gutmans
0ab9d11225 - Start splitting up different kinds of function calls into different
- opcodes.
2002-01-04 06:44:19 +00:00
Derick Rethans
9b391a83c2 - MFZE1 for exit fix, exposing current function name in error messages and
exposing zend_zval_type_name().
2002-01-03 14:19:13 +00:00
Sebastian Bergmann
7c2fef7020 Consistency. 2001-12-31 07:50:42 +00:00
Andi Gutmans
c54f216ecd - Add example of default argument for argument passed by-ref 2001-12-31 05:28:18 +00:00
Sebastian Bergmann
4af1b42bc0 Typo. 2001-12-30 10:43:27 +00:00
Andi Gutmans
8a0c756c58 - #define to help #ifdef stuff in PHP sources to make them work w/ ZE1 and
- 2
2001-12-29 18:07:08 +00:00
Andi Gutmans
c6f1e68e75 - A few clarifications 2001-12-29 09:48:07 +00:00
Sebastian Bergmann
1d4793e5e8 Integrate Andi's examples and some notes by Stig. 2001-12-29 09:21:54 +00:00
Sebastian Bergmann
76cfd48f72 Update Exceptions example. 2001-12-29 08:17:57 +00:00
Andi Gutmans
ae1a702501 - Fix some case insensitivity stuff in respect to classes 2001-12-28 16:36:04 +00:00
Andi Gutmans
b14f6cf79f - Support default arguments for reference parameters
- Fix two compile warnings
2001-12-28 13:28:33 +00:00
Andi Gutmans
9a83837391 - Wasn't adding the lower case version of the class name to the hash 2001-12-28 13:18:19 +00:00
Andi Gutmans
e322abdd63 - Use two underscores for __construct(), __clone and friends... 2001-12-27 16:35:07 +00:00
Andi Gutmans
3d89072c7e - Only check refcount of object if the destructor was called. 2001-12-27 14:44:39 +00:00
Andi Gutmans
73b159e056 - Experimental support for destructors. We need to see if destructors
- will actually work well in the context of PHP so we should consider this
- as experimental. Possible problems might be that when the constructor is
- run PHP might not be in a stable state.
2001-12-27 14:35:09 +00:00
Andi Gutmans
b3fd2faac0 - Support parent:: again 2001-12-27 13:12:45 +00:00
Andi Gutmans
a5f7a383bf - Support unified constructor name _construct() 2001-12-27 12:23:03 +00:00
Andi Gutmans
5cb454a8ad - Fix scoping issue. The following works now:
<?
	class MyClass {
		static $id = 0;

		function MyClass()
		{
			$this->id = self::$id++;
		}

		function _clone()
		{
			$this->name = $clone->name;
			$this->address = "New York";
			$this->id = self::$id++;
		}
	}



	$obj = new MyClass();

	$obj->name = "Hello";
	$obj->address = "Tel-Aviv";

	print $obj->id;
	print "\n";

	$obj = $obj->_clone();

	print $obj->id;
	print "\n";
	print $obj->name;
	print "\n";
	print $obj->address;
	print "\n";
2001-12-26 20:17:34 +00:00
Andi Gutmans
b04acdadf4 - Print out object id for easier debugging 2001-12-26 20:06:06 +00:00
Andi Gutmans
29ea3da2f8 - Pretty much finish _clone() support 2001-12-26 19:54:20 +00:00
Andi Gutmans
2ce4b47657 - Initial support for _clone() 2001-12-26 17:49:22 +00:00
Andi Gutmans
f85c818fe8 - Start fixing the parsing rules so that function and method calls
- can't be used in a write context.
2001-12-26 14:46:18 +00:00
Andi Gutmans
76b9acc165 - Fix crash correctly. 2001-12-26 11:18:00 +00:00
Andi Gutmans
e1e02af55b - Revert delete syntax patch 2001-12-25 17:10:58 +00:00
Andi Gutmans
ee44180fc6 - Fix a crash (not a thorough fix).
- Commented old code
2001-12-25 16:51:37 +00:00
Andi Gutmans
df38ce3727 - Fixed bug where global functions weren't called if they didn't exist
- in the class scope
2001-12-24 17:39:16 +00:00
Andi Gutmans
3458373ed6 - Fix a bug where function's didn't work anymore in multi-threaded
- servers after the latest startup changes.
2001-12-23 18:39:52 +00:00
Andi Gutmans
9e7c0d67d0 - Add initial capability of defining nested classes as class foo::bar 2001-12-22 15:31:44 +00:00
Zeev Suraski
43617d0d50 MFZE1 2001-12-18 19:56:23 +00:00
Sebastian Bergmann
cc01431199 I'm too trigger-happy. 2001-12-16 20:28:18 +00:00
Sebastian Bergmann
7920d4fc7e delete is now function 2001-12-16 19:57:53 +00:00
Andi Gutmans
1e56cac358 - Seems like most people prefer delete($obj) over delete $obj. 2001-12-16 19:53:06 +00:00
Andi Gutmans
ac7ed464b5 - Start adding parsed variable checks. 2001-12-16 19:45:49 +00:00
Andi Gutmans
880e7d8ce7 - Framework for knowing what kind of variable we just parsed.
- This will be used in compile-time error checking which couldn't be done
- at the level of the grammar.
2001-12-16 19:18:19 +00:00
Andi Gutmans
7c749c1897 - Rearrange grammar to allow dereferencing of objects returned from
- functions. It still crashes though.
2001-12-13 22:21:50 +00:00
Andi Gutmans
f4b832d277 - Fix crash bug in startup code.
- Start work on being able to reference global and local scope
2001-12-13 16:55:04 +00:00
Andi Gutmans
ce98c73f82 - Infrastructure changes for allowing to access the global scope from
- within a class scope.
- Fix the Zend.dsp project a bit. It seems someone pretty much killed it
- when commiting their own personal configuration. Please be careful in
- future.
2001-12-12 20:45:38 +00:00
Andi Gutmans
74efc41fc3 - Make classes have scope and function/constant lookups default to the class 2001-12-12 17:38:37 +00:00
Andi Gutmans
4214a056a1 - Merge from ZE1 2001-12-11 18:51:02 +00:00
Andi Gutmans
4cb97fa3b9 - Rename zend_class_entry.constants -> zend_class_entry.constants_table 2001-12-11 18:46:43 +00:00
Andi Gutmans
1dcef1e4ea - Start making scope change correctly when calling namespace functions.
- When inside a namespace fallback to global namespace when function
- or constant is not found.
2001-12-11 17:56:57 +00:00
Sebastian Bergmann
5b0b5b6ed5 Forgot to update the LICENSE. 2001-12-11 17:38:49 +00:00
Sebastian Bergmann
d863d52a5d Update headers. 2001-12-11 15:16:21 +00:00
Sebastian Bergmann
4345f8a0b5 MFZE1 (AIX fixes) 2001-12-11 09:17:38 +00:00
Sebastian Bergmann
ff4cc2c6e2 MFZE1 (added zend_strip mode in the highliter) 2001-12-11 06:30:30 +00:00
Andi Gutmans
3bfee898db - More namespaces work.
- Nuke memory leak.
2001-12-10 18:57:17 +00:00
Andi Gutmans
8460372395 - Fix crash with unhandled exceptions 2001-12-08 20:58:20 +00:00
Andi Gutmans
055709538c - Support constants. The following works now:
<?
	class foo {
		const GC = "foo constant\n";
	}

	define("GC", "Global constant\n");

	namespace;
	print GC;
	namespace foo;
	print GC;
	namespace;
	print foo::GC;

?>
2001-12-06 18:05:18 +00:00
Andi Gutmans
42486196ad - Initial work on changing namespace scope. Only methods & variables
- right now.
<?
	$hey = "Global hey\n";

	class foo {
		static $hey = "Namespace hey\n";
		function bar()
		{
			print "in foo::bar()\n";
		}
	}
	function bar()
	{
		print "in bar()\n";
	}

	bar();
	namespace foo;
	bar();
	namespace;
	bar();
	namespace foo;
	$bar_indirect = "bar";
	$bar_indirect();

	namespace;
	print $hey;
	namespace foo;
	print $hey;
	$hey = "Namespace hey #2\n";
	namespace;
	print $hey;
	$hey = "Global hey #2\n";
	namespace foo;
	print $hey;
?>
2001-12-06 17:47:04 +00:00
Andi Gutmans
fe94f59427 - Nuke the namespace work I did. It'll be redone differently. 2001-12-06 17:23:08 +00:00
Sebastian Bergmann
8b34428167 Document recent changes. 2001-12-05 07:04:16 +00:00
Andi Gutmans
5476706142 - Damn Zeev :) 2001-12-04 17:58:32 +00:00
Andi Gutmans
94cfe03da5 - Revert one of the changes because it might be before the memory
- manager has started.
2001-12-01 08:46:02 +00:00
Andi Gutmans
bb9a36cad1 - Use alloca() when possible. 2001-12-01 08:33:48 +00:00
Andi Gutmans
e858d27888 - Initial support for class constants. There are still a few semantic
- issues which need to be looked into but basically it seems to work.
- Example:
<?php
	class foo
	{
		const hey = "hello";
	}

	print foo::hey;
?>
2001-11-30 16:29:47 +00:00
Andi Gutmans
7f66d5e99a - Fix typo 2001-11-30 11:42:30 +00:00
Andi Gutmans
f289014922 - Support syntax for class constants (doesn't do anything yet but
- required some reworking of the grammar).
2001-11-27 17:46:31 +00:00
Andi Gutmans
7cd6ccc0ec - Support static $var = 0; style initialization of static class
- members. For example:
-	class foo {
-		static $my_static = 5;
-
-	}
-
-	print foo::$my_static;
2001-11-26 18:05:01 +00:00
Andi Gutmans
0d559f17cd - Fix crash and leak 2001-11-25 12:29:08 +00:00
Andi Gutmans
4f3eaaa854 - Whitespace 2001-11-25 08:58:59 +00:00
Andi Gutmans
d2da63f629 - Support static members. The following script works:
<?
	class foo
	{
		class bar
		{
			function init_values()
			{
				for ($i=1; $i<10; $i++) {
					foo::bar::$hello[$i] = $i*$i;
				}
			}

			function print_values()
			{
				for ($i=1; $i<10; $i++) {
					print foo::bar::$hello[$i] . "\n";
				}
			}
		}
	}

	foo::bar::init_values();
	foo::bar::print_values();

	for ($i=1; $i<10; $i++) {
		print $hello[$i]?"Shouldn't be printed\n":"";
	}
?>
2001-11-25 08:49:09 +00:00
Andi Gutmans
559d611a86 - MFZE1 2001-11-24 18:27:20 +00:00
Zeev Suraski
08615c6f68 MFZE1 2001-11-15 23:26:52 +00:00
Stig S. Bakken
78f108d31a add newline at end of file to avoid warnings 2001-11-05 00:17:28 +00:00
Stig S. Bakken
9382ddec52 non-zts compile fix 2001-11-05 00:16:33 +00:00
Andi Gutmans
a332f826a7 - Support instantiation of nested class. The following script now should
- work:
-<?php
-	class foo
-	{
-		function bar()
-		{
-			print "bar() in class bar\n";
-		}
-
-		class barbara
-		{
-			function bar()
-			{
-				print "bar() in class foo::barbara\n";
-			}
-		}
-	}
-
-	$obj = new foo();
-	$obj->bar();
-
-	$obj = new foo::barbara();
-	$obj->bar();
-
2001-11-04 19:30:49 +00:00
Andi Gutmans
48e54e0c7a - RISC OS patch by Alex Waugh 2001-11-03 13:35:14 +00:00
Andi Gutmans
2eccd95ca4 - Add some initializations 2001-11-03 12:19:52 +00:00
Andi Gutmans
b87194e0c6 - Add constructor to the zend_class_entry instead of looking it up each
- time by name.
- This will allow the next patch of being able to instantiate nested
- classes such as new foo::bar::barbara();
2001-11-03 11:59:14 +00:00
Andi Gutmans
0a682c6d70 - Fix internal classes 2001-10-29 18:10:36 +00:00
Andi Gutmans
26578c386d - Initial support for nested class definitions 2001-10-29 17:19:02 +00:00
Zeev Suraski
8b53a129f7 MFTGZE1 2001-10-27 09:43:38 +00:00
Andi Gutmans
89a0e85251 - Fix Zeev's MFZE1 2001-10-26 14:13:42 +00:00
Zeev Suraski
aecd5b89ee MFZE1 2001-10-23 01:23:36 +00:00
Andrei Zmievski
3ead31449f MFHZ1 2001-10-20 13:55:47 +00:00
Sebastian Bergmann
01850714ee MFZE1: Introduced extension version numbers (Stig) 2001-10-12 18:40:30 +00:00
Sebastian Bergmann
43c7615c51 MFZE1 2001-10-04 14:18:52 +00:00
Andi Gutmans
2eabb14dc7 - Merge the NAMESPACES_BRANCH. It wasn't a good idea to have a branch when
- the whole CVS tree is work in progress
2001-09-30 17:29:55 +00:00
Andi Gutmans
279b468bf7 - Bump it up in the right place 2001-09-27 08:08:33 +00:00
Sebastian Bergmann
76ccb015e8 Keep ZEND_CHANGES up-to-date. 2001-09-22 17:03:05 +00:00
Zeev Suraski
e42ab2c95f MFZE1 2001-09-22 14:03:27 +00:00
Zeev Suraski
17352812a3 MFZE1 2001-09-22 00:09:24 +00:00
Andi Gutmans
d58240d0f5 - Nuke unused enum 2001-09-20 15:50:11 +00:00
Zeev Suraski
483fc4c73a MFZE1 2001-09-19 22:34:11 +00:00
Andi Gutmans
88d408ee11 - MFZE1 2001-09-19 10:41:35 +00:00
Sebastian Bergmann
3bdddb4910 MFZE1 2001-09-19 10:25:04 +00:00
Sebastian Bergmann
da5a79d185 MFZE1 2001-09-19 10:06:09 +00:00
Brian Moon
b285fae0bc adding RFC for loose type requirements for functions 2001-09-17 16:01:20 +00:00
Zeev Suraski
f88c25b60e MFZE1 2001-09-16 16:48:38 +00:00
Zeev Suraski
9f61e47c24 MFZE1 (nuke cplusplus code) 2001-09-10 00:08:24 +00:00
Zeev Suraski
b06440bceb MFZE1 (support return value in execute_scripts) 2001-09-10 00:07:32 +00:00
Stig S. Bakken
d07cfabce4 remove bogus comment :) 2001-09-08 11:17:25 +00:00
Stig S. Bakken
b07b4c6029 RFC document for namespaces 2001-09-08 11:02:06 +00:00
Stig S. Bakken
4585ae9fb1 wrapped to 80 columns :) 2001-09-08 08:55:42 +00:00
Andi Gutmans
d7536a8a5f - Shift around the variable parsing code to make it simpler. 2001-09-07 14:46:12 +00:00
Andi Gutmans
fc1abec531 - Fix warning (was fixed in ZE1 and not merged at some point). Please make
sure you merge patches!
2001-09-07 06:40:03 +00:00
Stanislav Malyshev
d082fb373d MFZE1 2001-09-05 09:29:28 +00:00
Andi Gutmans
7c4a0cc6cf - CLS_CC -> TSRMLS_CC 2001-09-03 16:57:49 +00:00
Sterling Hughes
c57ed1b93b spaces->tabs 2001-08-31 21:55:43 +00:00
Sterling Hughes
498f7fd90f MFZE1 2001-08-31 21:52:44 +00:00
Sterling Hughes
69c7346f0e MFZE1 2001-08-31 21:47:26 +00:00