Commit Graph

160 Commits

Author SHA1 Message Date
Marcus Boerger
4da11644de - Require a single white-space char after /** to start a doc comment that
way we prevent /*** from becoming a doc comment (as requested Derick).
2004-06-10 13:38:31 +00:00
Marcus Boerger
eefdd0ea49 Do not require NEWLINE at start of doccomment 2004-06-10 11:40:34 +00:00
Derick Rethans
b2ac395957 - Remove old and deprecated <?php_track_vars?> scanner token. 2004-03-25 21:11:57 +00:00
Moriyoshi Koizumi
c0aabb79b2 - Fix memleak when scanner is called from within tokenizer extension.
# (only happens with zend multibyte feature enabled)
2004-03-04 22:50:55 +00:00
Marcus Boerger
059c533b4a Fix __METHOD__ (noticed by Davey Sahfik) 2004-02-26 19:59:49 +00:00
Zeev Suraski
60bb89c505 Abort on parse error in an include file (patch by Ilia) 2004-02-03 14:32:02 +00:00
Zeev Suraski
9e60cb553f Rewrote exception support. Fixes a few limitations and bugs in the old
implementation, and allows exceptions to 'fire' much earlier than before.

Instructions on how to use the new mechanism will follow on internals@
shortly...

Note - this (most probably) breaks the current implementation of
set_exception_handler()
2004-02-03 12:17:09 +00:00
Zeev Suraski
8e30d96ad8 Redesign the clone() feature to fix some fundamental flaws in the previous
implementation.

Using clone directly is now done using
$replica = clone $src;

Clone methods must now be declared as follows:
function __clone($that)
{
}

Clone methods in derived classes can call the __clone method of their parent
classes using parent::__clone($that)
2004-02-02 12:28:19 +00:00
foobar
796938ec7f Nuke compile warning by using the LANG_SCNG macro instead 2004-01-17 00:26:12 +00:00
Wez Furlong
910e20064a TSRMLS fix 2004-01-11 21:39:40 +00:00
Andi Gutmans
e69f4f6f25 - This should fix the problem of conditional function decleration on the
- same line of code not to work. You should re-evaluate your coding style
- if you really code this way :)
2004-01-11 19:27:13 +00:00
Andi Gutmans
6b87194bd9 - - A belated happy holidays (by two years) 2004-01-08 08:23:23 +00:00
Ilia Alshanetsky
99dec6927c Fixed bug #26463 (Incorrect handling of semicolons after heredoc) 2003-11-29 19:05:14 +00:00
Ilia Alshanetsky
10def9a8ae Added missing format. 2003-09-22 04:21:44 +00:00
Masaki Fujimoto
ab9dcec292 - added script encoding support to Zend Engine 2.
this enables ZE2 to gracefully parse scripts written in UTF-8 (with BOM),
  UTF-16, UTF-32, Shift_JIS, ISO-2022-JP etc... (when configured with
  '--enable-zend-multibyte' and '--enable-mbstring')
2003-08-11 05:24:42 +00:00
Stanislav Malyshev
399db3c846 fix crash #24550 2003-07-27 12:25:50 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Stanislav Malyshev
f7f5a5ea6b MEGA-patch: namespaces are R.I.P. 2003-06-02 12:13:11 +00:00
Marcus Boerger
afb748d17a CS 2003-05-29 12:59:43 +00:00
Marcus Boerger
955460a319 Add pseudo constant __METHOD__ to easily report namespace::class::method.
# This is especially good for tests. Since it does not draw away from the
# real issues and nicely reports what is needed to identify a method.
2003-05-26 20:45:22 +00:00
foobar
c0cde196d7 Fixed bug #21820 ("$arr[foo]" generates bogus E_NOTICE, should be E_PARSE) 2003-04-25 10:13:51 +00:00
Zeev Suraski
65f06d8027 Revert Harald's commit 2003-04-10 04:43:42 +00:00
Harald Radi
07e775bcde removing the *syntactical sugar* again
# commiting that on behalf of the community :)
# don't blame me, i'm just acting as a proxy
2003-04-09 20:23:06 +00:00
foobar
0abeba5895 Fixed bug #23093 (highlight_string() crashed with __FUNCTION__) 2003-04-07 22:51:28 +00:00
Andrei Zmievski
bdd3b6042c Implement a different way to catch documentation comments. 2003-04-02 16:51:49 +00:00
Andrei Zmievski
e6255b06b1 Revert portions of the doc comment patch. There should be no parser
errors now.
2003-04-02 16:13:12 +00:00
Stanislav Malyshev
59af205988 Add __NAMESPACE__ auto-constant. 2003-04-01 09:22:41 +00:00
Andrei Zmievski
5657b83691 Multi-purpose patch:
- The fields of zend_namespace were not completely initialized which
   led to a variety of problems.
 - The occurrence of class/interface/namespace definition is now
   captured.
 - Functions/classes/interfaces/namespaces can be preceded by doc
   comments which are stored for use by extensions.
2003-03-31 20:42:01 +00:00
Shane Caraveo
0a3ca34e87 fix crash in win32 debug build 2003-03-22 21:22:40 +00:00
Andrei Zmievski
39d5a63803 - Keep track of starting/ending line numbers for user functions.
- Store last parsed doc comment in a compiler global for future use.
2003-03-19 21:17:47 +00:00
Andi Gutmans
b3ebb11549 - Nuke junk 2003-03-09 21:12:12 +00:00
Zeev Suraski
26dd8492ed Add support for interfaces 2003-03-05 11:14:44 +00:00
Zeev Suraski
535aa63293 Add 'final' 2003-02-24 12:05:58 +00:00
Zeev Suraski
955636af69 Avoid using a C++ reserved word 2003-02-18 17:18:28 +00:00
Wez Furlong
e52aac940f Implement simple stream support in the ZE scanners. 2003-02-18 09:37:54 +00:00
Stanislav Malyshev
a4c3b2ce80 Namespace patch. Big changes:
1. Nested classes are gone.
2. New syntax for namespaces:
namespace foo {
	class X { ... }
	function bar { ... }
	var x = 1;
	const ZZ = 2;
}
3. Namespaced symbol access: $x = new foo::X; - etc.
For now, namespaces are case insensitive, just like classes.
Also, there can be no global class and namespace with the same name
(to avoid ambiguities in :: resolution).
2003-02-16 11:12:43 +00:00
Harald Radi
3341568c09 MFB PHP_4_3 2003-02-13 16:46:53 +00:00
Sebastian Bergmann
729e470ced Fix build. 2003-02-01 07:32:09 +00:00
foobar
333406bdc2 - Added some missing CVS $Id$ tags, headers and footers. 2003-02-01 01:49:15 +00:00
Andi Gutmans
c073b76aac - Change "is" to "instanceof" as it explains better what the operator means.
- "is_a" was also appropriate but ugly.
2003-01-14 21:29:23 +00:00
Zeev Suraski
cf05f34c66 MFZE1 - lineno fix 2003-01-05 16:09:59 +00:00
Ilia Alshanetsky
11dbaa39d6 MFZE2 2002-12-14 23:56:44 +00:00
Zeev Suraski
e156edb1d0 Remove unintentional code 2002-12-07 15:52:08 +00:00
Zeev Suraski
e062dffe6c - Implement public/protected/private methods.
- Prevent instantiation of classes with abstract methods.
Based in part on Marcus's patch.
2002-12-06 17:09:44 +00:00
Andi Gutmans
227f7838d6 - Fix build (thanks Marcus)
- Implement abstract methods, syntax:
-    abstract function foo($vars);
- I don't see any reason why modifiers such as static/public need to be
- used with abstract. PHP is weakly typed and there would be no meaning to
- this anyway. People who want a strictly typed compiled language are
- looking in the wrong place.
2002-11-20 18:00:23 +00:00
Andi Gutmans
6d8a643edb - MFZE1 2002-11-18 05:27:46 +00:00
Andi Gutmans
ce06e7ba77 - MFZE1 2002-11-16 07:37:03 +00:00
Andi Gutmans
e1725b26fa - MFZE1 2002-11-16 07:32:53 +00:00
Ilia Alshanetsky
78bf1d9a56 MFZE1 2002-11-05 22:01:35 +00:00
Andi Gutmans
983be5c73c - ATTENTION: Finally nuke old_function and cfunction. I think it is time
- to get rid of these BC notations. This is from the days of the move from
- PHP/FI 2 -> PHP 3
2002-11-05 18:25:09 +00:00
Ilia Alshanetsky
7936a861ab MFZE1 2002-11-02 16:52:59 +00:00
Derick Rethans
fee4ba4f13 - Fix segfault when __CLASS__ was used outside a class definition 2002-11-02 09:06:23 +00:00
Ilia Alshanetsky
d704357e44 MFZE1 (20214). 2002-11-02 05:44:10 +00:00
Zeev Suraski
0bb780b384 MFZE1 2002-08-15 00:25:27 +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
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
3be1dd468e - Syntactic sugar - Add "public" as a synonym for "var".
- Now we have the three P's.
You can do:

<?
	class MyClass {
		public $a;
		private $b;
		protected $c;
	}

?>
2002-07-16 19:11:14 +00:00
Andi Gutmans
bc5ea87e28 - Commit patch to support protected member variables (by Timm Friebe w/
- some fixes by me).
- You can't access protected variables from outside the object. If you want
- to see a protected member from your ancestors you need to declare the
- member as protected in the class you want to use it in. You can't
- redeclare a protected variable as private nor the other way around.
2002-07-15 18:09:56 +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
foobar
3eafd2207c MFZE1 2002-04-10 21:33:34 +00:00
foobar
60ccb411ba MFZE1 2002-04-10 21:23:01 +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
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
Sebastian Bergmann
62dc854bb0 Happy New Year. 2002-01-06 15:21:36 +00:00
Zeev Suraski
43617d0d50 MFZE1 2001-12-18 19:56:23 +00:00
Sebastian Bergmann
d863d52a5d Update headers. 2001-12-11 15:16:21 +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
Zeev Suraski
17352812a3 MFZE1 2001-09-22 00:09:24 +00:00
Zeev Suraski
483fc4c73a MFZE1 2001-09-19 22:34:11 +00:00
Zeev Suraski
9f61e47c24 MFZE1 (nuke cplusplus code) 2001-09-10 00:08:24 +00:00
Andi Gutmans
29f5dbe10b - Initial support for exceptions. 2001-08-30 15:26:30 +00:00
Zeev Suraski
b392fe4497 MFZE1 2001-08-28 09:23:22 +00:00
Zeev Suraski
77c52275a1 MFZE1 2001-08-16 20:38:56 +00:00
Zeev Suraski
4f6c95d17a Whitespace 2001-08-11 15:56:40 +00:00
Andi Gutmans
5af7770a81 - Sync Engine2 CVS with latest Engine CVS 2001-08-07 03:17:33 +00:00
Zeev Suraski
7ade3b30cb Fix an off by one lineno issue, in case of an implicit ; 2001-08-06 14:36:46 +00:00
Zeev Suraski
609d58a4d6 Merge from branch - move to standard C scanners in thread safe mode 2001-08-06 13:48:51 +00:00
Zeev Suraski
f93bfc47df Implement fast scanning in the multithreaded environment 2001-08-01 02:36:05 +00:00
Zeev Suraski
982cd24aa4 the make Sebastian happy part of the day :) 2001-07-31 07:12:15 +00:00
Zeev Suraski
d49077f871 Compile fix 2001-07-30 09:05:42 +00:00
Zeev Suraski
4187439cff More TSRMLS_FETCH work 2001-07-30 07:43:02 +00:00
Zeev Suraski
8ce8324e59 More TSRMLS_FETCH annihilation 2001-07-30 04:54:16 +00:00
Zeev Suraski
b4f3b9d3ce Redesigned thread safety mechanism - nua nua 2001-07-28 10:51:54 +00:00
Zeev Suraski
2c254ba762 Get rid of ELS_*(), and use TSRMLS_*() instead.
This patch is *bound* to break some files, as I must have had typos somewhere.
If you use any uncommon extension, please try to build it...
2001-07-27 10:10:39 +00:00
Zeev Suraski
0078ceec19 Fix an inline 2001-07-15 19:08:32 +00:00
Zeev Suraski
85b4df53c0 Improved interactive mode - it is now available in all builds, without any significant slowdown 2001-07-15 14:08:58 +00:00
Zeev Suraski
5b12d6077e That's slightly clearer that way :) 2001-05-17 16:33:45 +00:00
Andi Gutmans
a514e8fe66 - Fix line numbers when some lines end with \r 2001-05-08 19:42:14 +00:00
Zeev Suraski
1e63f44084 Support interactive mode in thread-safe builds 2001-05-06 14:36:25 +00:00
Andi Gutmans
62bec3a7a7 - Handle MAC OS X \r line endings 2001-05-02 21:48:07 +00:00
Zeev Suraski
4e71bbed0a include limits.h if available 2001-04-28 20:21:42 +00:00
Andi Gutmans
acd56b0891 - More whitespace fixes while I'm at it. 2001-04-27 18:53:25 +00:00
Andi Gutmans
0971ff99cb - Whitespace changes to be standard like the rest of Zend 2001-04-27 18:51:56 +00:00
Andi Gutmans
3118af8293 - White space 2001-03-12 15:45:01 +00:00
Andi Gutmans
714d083cb8 - Fix by Jani Taskinen <sniper@iki.fi> for whole path also to work
with include_once()/require_once().
2001-03-12 15:42:18 +00:00
Andi Gutmans
d2c9e8074c - Update copyright year 2001-02-26 05:43:27 +00:00
Zeev Suraski
f3258b2426 Fix another case of possible line number corruption 2001-01-03 23:00:01 +00:00
Zeev Suraski
18603033fb Fix possible corruption in line number information 2000-12-30 15:32:12 +00:00
Zeev Suraski
dc2f1d9db7 - Use supplied istdiostream definition for the INI scanner too
- Add Release_TSDbg configuration
2000-12-26 22:15:13 +00:00