Stanislav Malyshev
7b1bbc85bc
use zend_binary_strncasecmp
2003-07-27 16:39:35 +00:00
Stanislav Malyshev
9fa2d52310
make clone and throw coexist peacefully
2003-07-27 13:20:31 +00:00
Stanislav Malyshev
5724c7a66c
fix leaks with class constants (bug #24699 )
2003-07-27 12:03:54 +00:00
Stanislav Malyshev
78f8ca6e55
make __clone call case insensitive, just as other calls are
2003-07-27 11:42:21 +00:00
Zeev Suraski
55097d1dcf
Fix another HANDLE_NUMERIC bug. Looks like you opened Pandora's box, Sterling ;)
2003-07-24 13:14:57 +00:00
Zeev Suraski
7928e763d2
Remove useless code
2003-07-24 12:51:07 +00:00
Zeev Suraski
03b6af07eb
Support references in foreach()
...
Syntax:
foreach ($arr as &$val)
foreach ($arr as $key => &$val)
2003-07-24 12:38:33 +00:00
Stanislav Malyshev
237116aa27
Remove namespace leftovers
2003-07-23 08:58:46 +00:00
Zeev Suraski
e10dbc607c
Fix bug in the verification of interface-function implementation
2003-07-16 09:13:47 +00:00
Zeev Suraski
3a898f6d4e
More cleanup for assign-op handling of objects
2003-07-16 08:57:08 +00:00
Zeev Suraski
134338522f
Rework zend_do_declare_property and related code into one code base
2003-07-07 16:22:56 +00:00
Zeev Suraski
938c0fbc19
Initial support for overloading of array syntax for objects (very initial)
2003-07-07 09:00:36 +00:00
Marcus Boerger
d7e14ad8a3
Allow final private methods
...
#
# Declaring a method private and final would only be an error for an abstract
# class. But at the moment the method is defined and it's modifiers are checked
# we do not know whether or not we have an abstract class. It could already be
# abstract but it also become abstract later.
#
# Since i made the mistake in first place i remove the check now.
#
# Providing the correct test would slow down the compiler becuase we'd have to
# iterate through all methods on all abstract classes and check for this. I
# guess we can live without. Or does anybody wants this to be implemented ?
2003-07-03 16:45:37 +00:00
Stanislav Malyshev
8f0234160a
enable Classname() constructor to be called via parent::__constructor()
2003-07-03 12:03:11 +00:00
Andi Gutmans
02c7aacf83
- Nuke CG(in_clone_method)
2003-07-02 16:52:07 +00:00
Sterling Hughes
778d8c8bf1
nuke "main" as a reserved keyword
2003-06-30 20:24:26 +00:00
Andi Gutmans
288dacca0c
- ZE coding style requires if ( instead of if(
2003-06-30 20:22:35 +00:00
Marcus Boerger
60c7abac61
Add final classes
2003-06-21 21:56:06 +00:00
Stanislav Malyshev
8cd9792375
Fix bug #23384 - static class::constant constants should now
...
work in static & array expressions.
2003-06-15 13:58:50 +00:00
James Cox
f68c7ff249
updating license information in the headers.
2003-06-10 20:04:29 +00:00
Zeev Suraski
8d2a4e04ae
Fix bogus implicit declarations of properties (squash bug #23671 )
2003-06-09 13:51:53 +00:00
Zeev Suraski
d329ce93f2
Nicer handling of protected/private members in print_r()
2003-06-08 18:53:58 +00:00
Stanislav Malyshev
f7f5a5ea6b
MEGA-patch: namespaces are R.I.P.
2003-06-02 12:13:11 +00:00
Sterling Hughes
5bb29cfaeb
revert the function call caching patch until a new solution is decided
...
upon.
2003-05-31 18:31:28 +00:00
Marcus Boerger
21d32c2430
Fix ~ operator in class constants.
2003-05-29 19:27:11 +00:00
Marcus Boerger
472cc5b9f3
Faster interface inheritance & faster inheritance checks
2003-05-29 19:00:40 +00:00
Wez Furlong
15fd642525
Fix Bug #23285 (Potential Stack Overflow in zendlex).
2003-05-29 09:01:55 +00:00
Sterling Hughes
88b2f89eee
Cache function call lookups with loops (store in a temporary variable on the
...
result opline).
Assuming lazy concensus on message that GeorgeS sent to the list last week
2003-05-28 20:42:40 +00:00
Stanislav Malyshev
462eff3497
fix __clone
2003-05-19 17:12:56 +00:00
Marcus Boerger
d3693d9214
Inheritance fix
...
# here we go again, sorry for the mess and thanks to edin for reverting it
2003-05-08 15:04:43 +00:00
Edin Kadribasic
7a0efe828a
Reverting Marcus' incomplete patch which broke the build.
2003-05-07 22:19:43 +00:00
Marcus Boerger
764eaa5b8b
Inheritance fixes
2003-05-07 00:54:38 +00:00
Marcus Boerger
9d251cde97
Don't inherit twice what is needed only once
2003-05-04 18:56:35 +00:00
Sterling Hughes
b4262dcf17
Add check for final properties
2003-04-20 14:52:40 +00:00
Sebastian Bergmann
dccdb2f549
Fix warnings.
2003-04-11 17:30:42 +00:00
Sterling Hughes
c013f78274
satisfy andi's switch fetish ;-)
2003-04-10 20:08:02 +00:00
Sebastian Bergmann
974f406eda
Fix ZTS build. Fix warning.
2003-04-10 17:02:31 +00:00
Sterling Hughes
0191ba5de1
allow expressions within constants, so the following is possible
...
class foo {
const a = 1<<0;
const b = 1<<1;
const c = a | b;
}
this makes const a compile-time expression. all other operators are
unaffected.
2003-04-10 15:43:47 +00:00
Andrei Zmievski
91eff553e3
Initialize all relevant zend_class_entry fields to avoid accidental
...
crashes.
2003-04-03 14:44:41 +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
Andrei Zmievski
62f9eb8006
Split ZEND_NAMESPACE into user and internal namespaces. Hope this is
...
okay with engine folks.
2003-04-01 19:37:04 +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
Zeev Suraski
96231c3ab5
Add missing initialization
2003-03-29 19:20:35 +00:00
Zeev Suraski
20860feef1
Fix crash
2003-03-29 11:27:17 +00:00
Zeev Suraski
5097be302e
Initial support for enforcing prototype of abstract/interface method implementations
2003-03-29 11:19:38 +00:00
Ilia Alshanetsky
018d851129
Fixed bug #22900 (declaration of namespaces with same name results in leaks).
2003-03-26 17:06:08 +00:00
Andi Gutmans
85d2c35bfa
- Temporarily fix problem with inheriting from an internal class. This might
...
- need some rework in the future (thanks to Marcus)
2003-03-25 20:36:26 +00:00
Zeev Suraski
0aef71ff89
Another fix for implicit public, perhaps it was not such a good idea :I
2003-03-23 08:14:41 +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
Zeev Suraski
40326f6adf
- Fix situation where a derived class declares a public (or implicit public)
...
with the same name as a private in the parent
- Optimize 'static binding' of private properties a bit
2003-03-18 16:30:23 +00:00
Zeev Suraski
fa7dc03edb
Fix a crash bug in the implicit public declaration
2003-03-12 09:38:19 +00:00
Zeev Suraski
3e7cf8e15e
Clean redundant code
2003-03-10 07:20:43 +00:00
foobar
f8fc50ed6d
Fixed some leaks. Patch by Moriyoshi
2003-03-10 03:04:02 +00:00
Zeev Suraski
0eae231254
Fix handling of ::foo
2003-03-09 22:17:15 +00:00
Zeev Suraski
3012bdc332
Cleanup
2003-03-09 22:02:37 +00:00
Zeev Suraski
8bc88d8df4
Fix parsing rules of namespaces/classes
2003-03-09 20:53:57 +00:00
Zeev Suraski
8e1917bdbe
Fix :: handling
2003-03-09 17:06:52 +00:00
Zeev Suraski
805f98065d
Fix warnings
2003-03-06 23:45:50 +00:00
Zeev Suraski
0338111950
Require abstract classes to be explicitly declared 'abstract', in order to
...
avoid making developers traverse the entire class/interface hierarchy
before they can figure out whether a class is instantiable
(ok, so it makes sense :)
2003-03-06 22:53:23 +00:00
Zeev Suraski
44347cf64b
Change opcode name
2003-03-06 14:42:36 +00:00
Zeev Suraski
ff76511a08
Add class type hints
2003-03-06 14:31:17 +00:00
Zeev Suraski
812d91d08c
Fix auto globals
2003-03-05 21:36:30 +00:00
Zeev Suraski
6ad2420d2d
Implement $obj::static_func()
2003-03-05 13:25:33 +00:00
Zeev Suraski
26dd8492ed
Add support for interfaces
2003-03-05 11:14:44 +00:00
Zeev Suraski
d5ada68654
Remove legacy code
2003-03-04 13:52:03 +00:00
Zeev Suraski
e0c3e2cf93
Remove redundant code
2003-03-04 13:36:16 +00:00
Zeev Suraski
98b990e336
Improve infrastructure
2003-03-02 13:33:31 +00:00
Zeev Suraski
f7b7800479
Add infrastructure for JIT initialization of auto globals
2003-03-02 10:04:53 +00:00
Zeev Suraski
805637b06d
Fix mem leak
2003-03-01 19:08:41 +00:00
Andi Gutmans
1a7c0d52dc
- Make __construct() have higher priority than class name functions
...
- for constructors.
- Fix problem with the engine allowing final/abstract for the same method.
- Both patches are by Marcus Börger.
2003-03-01 14:57:49 +00:00
Zeev Suraski
5793784c93
Get the bits right - final/private fix
2003-02-25 10:03:26 +00:00
Stanislav Malyshev
3cf20f86db
fix exception handling
2003-02-24 13:35:47 +00:00
Zeev Suraski
535aa63293
Add 'final'
2003-02-24 12:05:58 +00:00
Zeev Suraski
731a55ad52
Move abstract inheritance logic to the right spot
2003-02-23 13:58:48 +00:00
Zeev Suraski
bb956372a5
Fixed abstract handling in inheritence
2003-02-23 12:51:40 +00:00
Stanislav Malyshev
e645f20d07
Allow namespaces to have a number of parts. I.e., now you can do:
...
namespace foo {
function abc() {}
}
...
namespace foo {
functio def() {}
}
2003-02-20 19:01:53 +00:00
Zeev Suraski
955636af69
Avoid using a C++ reserved word
2003-02-18 17:18:28 +00:00
Stanislav Malyshev
3e45b23799
add support for ::foo syntax meaning "global one"
2003-02-16 13:27:33 +00:00
Stanislav Malyshev
c9b2ec7be7
remove debug prints
2003-02-16 12:04:41 +00:00
Sebastian Bergmann
6d300baf84
ZTS fixes
2003-02-16 11:34:49 +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
Zeev Suraski
3c2a1255cd
Fix declaration of class members that don't have an explicit access modifier
2003-02-12 16:28:34 +00:00
Zeev Suraski
beaf84ea17
Fix require() handling - that's an old bug!
2003-02-11 15:41:46 +00:00
Zeev Suraski
2814504143
Improve parser handling of 'abstract'
2003-02-11 09:48:37 +00:00
Zeev Suraski
f196e11f42
Fix zend_initialize_class_data()
2003-02-10 16:46:05 +00:00
Zeev Suraski
c17c7a2bfa
Centralize class initialization
2003-02-10 16:11:24 +00:00
Zeev Suraski
6317e26576
- Treat $this->foo inside class X as an implicit 'public $foo' if X::$foo
...
is not explicitly declared
- Forbid multiple declaration of the same variable
2003-02-10 12:46:58 +00:00
Zeev Suraski
5e12de9510
Add missing destructors
2003-02-10 11:03:22 +00:00
Zeev Suraski
b39b33c4c5
Fix the 2nd buglet in the error message :)
2003-02-06 00:39:58 +00:00
Zeev Suraski
17439aa9c4
Rework static class properties - now supports access restrictions
2003-02-05 13:35:52 +00:00
Zeev Suraski
ef77e582f5
Fix buglet in error message
2003-02-05 07:46:13 +00:00
Zeev Suraski
471947b188
Reimplement PPP properties
2003-02-04 12:12:34 +00:00
Andi Gutmans
87f4472afb
- Fix warning
2003-02-02 05:20:31 +00:00
foobar
333406bdc2
- Added some missing CVS $Id$ tags, headers and footers.
2003-02-01 01:49:15 +00:00
Stanislav Malyshev
123d8f782f
fix memory leak
2003-01-29 14:25:53 +00:00
Zeev Suraski
49fd225238
Fix a ticks related crash
2003-01-28 11:34:24 +00:00
Stanislav Malyshev
3a4ace13b4
Replace MAKE_VAR opcode with special 'data' opcode
...
This opcode is not executeable but only holds data for opcodes
that need more than two arguments (presently only ASSIGN_OBJ and the ilk but
in the future also ASSIGN_DIM)
2003-01-27 15:13:01 +00:00
Stanislav Malyshev
dce8267f35
Restore for now old statics behaviour (so that indirect $$var references would work again). Comprehensive fix will follow later.
2003-01-19 17:25:39 +00:00
Andi Gutmans
e5afca38b6
- Revert int -> unsigned int change for str.len
2003-01-15 20:35:06 +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
Stanislav Malyshev
67c50ee22a
fix warning
2003-01-14 12:27:07 +00:00
Stanislav Malyshev
33b67ab868
fix inheritance
2003-01-12 18:57:18 +00:00
Stanislav Malyshev
d48ffd97d6
RIP handle_* functions. ZE2 will use __ handlers instead.
...
# Yes, I know this will break some things. I will fix those I can find shortly.
2003-01-12 17:16:07 +00:00
Zeev Suraski
424e98f4e2
Implemented compatibility mode
...
To enable - zend2.implicit_clone = on in php.ini or using ini_set()
2003-01-12 12:39:06 +00:00
Zeev Suraski
66d30a4966
Found some more occurences of that elusive bug...
2003-01-09 16:16:57 +00:00
Zeev Suraski
ef6a44d15c
Fix one lousy, annoying lurking bug (memory corruption)
...
Sebastian - try coWiki again please...
2003-01-09 16:10:33 +00:00
Zeev Suraski
cf05f34c66
MFZE1 - lineno fix
2003-01-05 16:09:59 +00:00
Zeev Suraski
77208ec4d6
Fix incorrect linkage of access-levels, when using private methods
2003-01-02 13:58:08 +00:00
Sebastian Bergmann
2c5d4b8c23
Bump year.
2002-12-31 15:59:15 +00:00
Andrei Zmievski
4121057117
do_inherit_method_check() is supposed to return 0 or 1, not SUCCESS or
...
FAILURE.
2002-12-26 16:27:59 +00:00
Zeev Suraski
66aba3c568
Fix check to allow for static+access level modifiers
2002-12-10 09:04:12 +00:00
Zeev Suraski
32b100e6cb
- Allow variables to have both 'static' modifier and an access level.
...
NOTE: This only works at the syntax level right now (parser). It
doesn't actually work as of yet - all statics are considered
public for now
- Prevent users from putting more restrictions on methods in derived classes
(i.e., you cannot make a public method private in a derived class, etc.)
2002-12-09 12:10:17 +00:00
Zeev Suraski
8f491470a1
Remove comment
2002-12-08 14:10:58 +00:00
Zeev Suraski
dc5c790a49
Treat the absence of an access type just as if 'public' was supplied
2002-12-08 14:09:43 +00:00
Zeev Suraski
68aa19445b
Simplify/fix inheritance checks
2002-12-07 21:46:12 +00:00
Andi Gutmans
1d1a796b58
- Dissallow using parent, self and main as class names
2002-12-07 15:51:25 +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
671fff2fde
h WHitespace
2002-11-30 11:20:25 +00:00
Andi Gutmans
6aa90a75bd
- FN_IS_STATIC -> FN_STATIC
2002-11-24 20:32:49 +00:00
Andi Gutmans
01e853c2ce
- My personal cleanups
2002-11-23 20:46:39 +00:00
Andi Gutmans
e8214a3384
- Commit Marcus' cleanup of abstract and static inheritance and improve
...
- error messages
2002-11-23 20:44:12 +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
e19165b356
- MFZE1
2002-11-10 22:02:28 +00:00
Stanislav Malyshev
830c2e0df6
fix statics - make it behave like $this (fetch type "static")
...
Side effect: indirect references to statics won't work.
2002-11-10 17:50:27 +00:00
Andi Gutmans
c497868005
- Add support for static methods. Basically methods which are defined as
...
- static don't have $this. That's the whole difference.
2002-11-05 19:37:31 +00:00
Andi Gutmans
f7f9721bdb
- Change the automatically created variable $clone in __clone() to
...
- $that as discussed at the PHP Conference. If there are any objections
- alternative names please let me know. The reason for changing it from
- $clone is because $clone sounds as if it's the newly cloned object and
- not the old one.
2002-11-05 18:16:11 +00:00
Stanislav Malyshev
3a9eeea213
avoid using 'class' in exported functions - it annoys c++
2002-11-05 17:21:23 +00:00
Ilia Alshanetsky
e849aa9d9b
Silence compiler warnings.
2002-11-04 17:35:41 +00:00
Andi Gutmans
1eb04a850e
- This might improve performance. Commiting it so that I can check it on
...
- Linux
2002-10-23 20:40:07 +00:00
Stanislav Malyshev
2461c9403b
Fix private handling
2002-10-20 17:46:16 +00:00
Andi Gutmans
cf36abb2eb
- Change opcode dispatch mechanism to use a function per opcode and use
...
- a lookup table using the opcode # to call the correct function.
- Still have lots of tuning to do.
2002-10-18 21:19:27 +00:00
Stanislav Malyshev
c42ec35331
Fix class static members: now the following code works:
...
<?php
class Foo {
static $c = "Parent";
}
class Child extends Foo {
}
Foo::$c = "Hello";
var_dump(Child::$c);
?>
and returns "Hello" (class statics are not copied anymore, but looked up in
runtime)
2002-10-16 18:29:41 +00:00
Stanislav Malyshev
349b3a096a
Fix and generalize $this handling.
...
ZEND_FETCH_FROM_THIS is removed, IS_UNUSED type on class variables will be
used instead as the sign that it's a fetch from $this
2002-10-16 18:06:36 +00:00
Ilia Alshanetsky
d3617c51b8
MFZE1 zend_str_tolower issue.
2002-10-09 14:21:40 +00:00
Andi Gutmans
7cba0254e7
- Allow access to private/protected variables of $clone inside the __clone()
...
- method
2002-10-07 21:20:23 +00:00
Ilia Alshanetsky
ee7b8f906d
MFZE1
2002-09-26 18:56:11 +00:00
Andi Gutmans
974b502199
- Fix leak
2002-09-24 19:32:01 +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
Zeev Suraski
aa07082a5c
whitespace
2002-09-17 12:42:58 +00:00
Andi Gutmans
f8ebfe7c51
- Hopefully fix problem with __autoload not working well with inherited classes.
...
- There might still be some weird situations I haven't thought of.
2002-09-15 07:54:01 +00:00
Andi Gutmans
43139dc755
- WS - Always use "if (" and not "if("
2002-09-15 07:45:26 +00:00
Stanislav Malyshev
c2af55fb18
quick-n-dirty inheritance support for __handlers
2002-09-05 17:34:16 +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
Jason Greene
b806a8e247
MFZE1 (use token instead of global for opcode counting)
2002-08-14 01:40:59 +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
Jason Greene
b0cf6c3112
MFZE1 global declare
2002-07-30 22:19:50 +00:00
Jason Greene
838b8ba49f
Fix segfault
2002-07-30 22:14:39 +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
b476ddf183
- Make sure classes are first looked for in the current scope.
...
- Make sure that during inheritance the global scope is searched if the
- current one doesn't work.
2002-07-27 15:53:14 +00:00
Andi Gutmans
8dd639ce22
- Fix bug reported by Sebastian where old constructors didn't work in
...
- nested classes.
2002-07-21 18:50:10 +00:00
Andi Gutmans
0355dc5504
- Remove code which wasn't supposed to go into the patch.
2002-07-17 18:39:26 +00:00
Andi Gutmans
9c52e883f0
- Rejuggle some code.
2002-07-17 18:36:29 +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
Andi Gutmans
57b853c831
- Fix bug when acccessing $this not in class scope.
2002-07-01 15:13:39 +00:00
Andi Gutmans
20d02565df
- Revert previous fix.
2002-06-29 11:24:11 +00:00
Andi Gutmans
6116145f9f
- Change E_ERROR -> E_COMPILE_ERROR where needed.
2002-06-29 08:42:17 +00:00
Andi Gutmans
dd8df52223
- Fix for bug #17882 . We complain if the same method is declared twice.
2002-06-29 08:38:24 +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
2d6404d5b0
- Allow overloaded objects to receive the method name in its original
...
- case.
2002-06-05 17:34:56 +00:00
Harald Radi
51e797f1e3
some type cleanup work
2002-04-23 18:06:54 +00:00
Stanislav Malyshev
3b6b13b08a
sync
2002-04-07 15:38:45 +00:00
Derick Rethans
17116438da
- revert patch
2002-03-29 12:34:25 +00:00
Derick Rethans
7394b8fc6f
- MFZE1
2002-03-25 20:37:02 +00:00
Andi Gutmans
c5ad6ae1b8
- More fixes to check for member/function call legality.
2002-03-18 20:27:03 +00:00
Andi Gutmans
46afe61d25
- Start putting error handling where method calls are being used in a
...
- context where only writable variables should be used.
2002-03-17 19:13:46 +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
Andi Gutmans
fb6976e46d
- Another couple of indirection fixes.
...
- Make class_entry->refcount be part of the structure and not allocated.
2002-03-12 19:22:29 +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
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
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
d1eea3de9c
- Fix bug in nested try/catch's
...
- Infrastructure for implementing imports of methods.
2002-03-01 14:04:51 +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
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
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
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
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
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
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
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
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
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
Andi Gutmans
ae1a702501
- Fix some case insensitivity stuff in respect to classes
2001-12-28 16:36:04 +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
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
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
9e7c0d67d0
- Add initial capability of defining nested classes as class foo::bar
2001-12-22 15:31:44 +00:00
Andi Gutmans
ac7ed464b5
- Start adding parsed variable checks.
2001-12-16 19:45:49 +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
74efc41fc3
- Make classes have scope and function/constant lookups default to the class
2001-12-12 17:38:37 +00:00
Andi Gutmans
4cb97fa3b9
- Rename zend_class_entry.constants -> zend_class_entry.constants_table
2001-12-11 18:46:43 +00:00
Sebastian Bergmann
d863d52a5d
Update headers.
2001-12-11 15:16:21 +00:00
Andi Gutmans
3bfee898db
- More namespaces work.
...
- Nuke memory leak.
2001-12-10 18:57:17 +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
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
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
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
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
26578c386d
- Initial support for nested class definitions
2001-10-29 17:19:02 +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
f88c25b60e
MFZE1
2001-09-16 16:48:38 +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
619702157b
- Make it compile in thread-safe mode.
2001-08-30 17:27:43 +00:00
Andi Gutmans
560606d210
- Get rid of warning and C++ comments
2001-08-30 15:31:35 +00:00
Andi Gutmans
29f5dbe10b
- Initial support for exceptions.
2001-08-30 15:26:30 +00:00
Zeev Suraski
4340c57ece
MFZE1
2001-08-19 13:39:06 +00:00
Zeev Suraski
4f6c95d17a
Whitespace
2001-08-11 15:56:40 +00:00
Andi Gutmans
73d4931dac
- Need to do some rewriting in the parser instead of this.
2001-08-11 10:47:41 +00:00
Andi Gutmans
8ff094046d
- A couple of fixes
2001-08-10 14:18:38 +00:00
Andi Gutmans
9d11db1200
- Merge new $_GET, $_POST etc. patch from Engine 1 tree
2001-08-08 17:18:16 +00:00
Andi Gutmans
cb1a40f399
- Preliminary patch for method() dereferencing
2001-08-08 15:07:11 +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
d76cf1da18
More TSRMLS_FETCH work
2001-07-31 04:53:54 +00:00
Zeev Suraski
4187439cff
More TSRMLS_FETCH work
2001-07-30 07:43:02 +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
Andrei Zmievski
fc260e6c98
Fix certain cases where inheritance of base class's overloaded handlers wasn't
...
being done.
2001-07-21 02:35:13 +00:00
Zeev Suraski
d68f53e94e
Unfix, it has too strong effects
2001-07-19 18:33:22 +00:00
Zeev Suraski
ce29cb297e
Catch all cases
2001-07-19 15:53:38 +00:00
Zeev Suraski
01814bb2b8
Fix bug #11970 , strike 2
2001-07-19 14:15:50 +00:00
Zeev Suraski
43ebb86806
Fix bug #10287 - avoid crashing under a bogus usage of list()
2001-07-16 15:48:31 +00:00
Zeev Suraski
fb532ba52b
Fix bug #10467
2001-07-16 11:41:06 +00:00
Zeev Suraski
0c49166197
Fix bug #9884
2001-07-15 16:22:41 +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
Andi Gutmans
6297cd26e2
- Commit Thies' patch. str.len was too long.
2001-07-10 05:02:50 +00:00
Zeev Suraski
cb0d2775fb
parent::methodname() now works better with runtime classes (fix bug #11589 )
2001-06-21 14:53:05 +00:00
Andi Gutmans
e264a407eb
- Change if() to while() to make sure we skip enough opcodes
2001-05-25 09:46:48 +00:00
Andi Gutmans
90c36273b4
- Fix memory leak
2001-05-25 07:26:48 +00:00
Zeev Suraski
bda9c83a82
Recover from a parse error in include files (before, it could result in a crash under certain circumstances). Fix bug #8663
2001-05-06 19:30:31 +00:00
Zeev Suraski
686eab894c
Hear hear, interactive mode is finally showing some progress:
...
- Support function calls
- Fix crash bug
2001-05-06 15:00:58 +00:00
Zeev Suraski
36ded42156
Make parent:: work in runtime bindings as well
2001-03-07 10:07:25 +00:00
Zeev Suraski
bdacbc4c94
Whitespace fix
2001-03-02 23:56:03 +00:00
Andrei Zmievski
cb00ed2bd3
Don't overwrite existing handlers with parent ones.
2001-02-27 05:18:34 +00:00
Andi Gutmans
d2c9e8074c
- Update copyright year
2001-02-26 05:43:27 +00:00
Andrei Zmievski
50f28f4372
Inherit overloaded handlers.
2001-02-03 04:52:29 +00:00
Zeev Suraski
0e08845eb0
Add free_estring()
2001-01-15 10:52:06 +00:00
Andi Gutmans
43adbdcc72
- Fix leak with useless statements such as "foo";
2000-12-18 13:28:32 +00:00
Stanislav Malyshev
6a356cf5c8
Whitespace fix
2000-12-07 10:36:45 +00:00
Stanislav Malyshev
8ba3eeabd9
Allow var $foo = array(ABC => 1) constructs
...
# It still doesn't work good with constants, but at least doesn't leak now
2000-12-07 10:36:10 +00:00
Andi Gutmans
8d9082563a
- Allow passing references which are returned from functions and new
...
- statements to be passed by reference.
2000-11-27 18:46:23 +00:00
Andi Gutmans
be6ab20415
- Remove code which has been commented out for ages.
2000-11-22 19:53:17 +00:00
Andi Gutmans
b5d5b3a703
- Baby patch towards making the damn pass-by-ref work.
2000-11-20 20:49:42 +00:00
Andi Gutmans
1ccf94066c
- Move SET_UNUSED() to header
2000-11-11 17:59:47 +00:00
Andi Gutmans
5e33cdaef3
- Remove this damn thing once again.
2000-11-10 11:48:12 +00:00
Andi Gutmans
f950a3724c
- Maybe it's OK now? :)
2000-11-09 23:54:18 +00:00
Andi Gutmans
113a5bb8c2
- Undo the previous commit for fixing $obj = new foo().
2000-11-09 23:43:21 +00:00
Andi Gutmans
d9d4824cd3
- Commit experimental patch to fix the problem when doing $a = new foo()
...
and the constructor assigns $this by reference to other symbol table
elements. Thanks to Daniel J. Rodriguez on this one.
2000-11-09 22:11:14 +00:00
Zeev Suraski
f1a9920bcf
Maintain consistency
2000-11-02 19:27:55 +00:00
Andi Gutmans
ce501c78a8
- Replace do_exit() with zend_do_exit().
...
- Problem reported by David Hedbor <david@hedbor.org>
2000-11-02 18:42:54 +00:00
Zeev Suraski
d0fbddcc2b
Fix a corruption bug, when erroneously allowing to send non-variables by reference (several
...
bug-db reports seem to originate in this bug)
2000-10-29 19:16:29 +00:00
Zeev Suraski
7b0d92dd18
Unify the names of these last 3 files...
2000-10-29 14:35:34 +00:00
Andi Gutmans
c13cfa040d
- Constant expressions which are used multiple times need to be copy_ctored
2000-10-19 09:36:53 +00:00
Stanislav Malyshev
2158bbfa7f
Set filename even on recursive include
2000-09-17 08:58:39 +00:00
Andi Gutmans
5348058938
- Forgot to create extended info in include()/require() call
2000-09-11 15:15:57 +00:00
Zeev Suraski
c34f41b7c5
Eliminate run-time leak with eval()'s
2000-08-19 17:50:42 +00:00
Zeev Suraski
7795aca4ca
Fix warning issue (compile errors inside require()'d files were incorrectly supressed)
2000-08-15 16:44:40 +00:00
Andi Gutmans
e46ea8864c
- This patch should hopefully fix situations where a constructor uses
...
- the $this pointer as a reference.
2000-08-14 19:17:26 +00:00
Andi Gutmans
e1a3604103
- Unused results should be marked with EXT_TYPE_UNUSED and not IS_UNUSED
2000-08-14 04:10:02 +00:00
Stanislav Malyshev
5090b1e8d5
Fix zend_fiel_handle handling. Should fix URL include
...
and various opened_path inconsistencies.
2000-08-13 18:00:50 +00:00
Andi Gutmans
e5015ed581
@ Fix problem with nested foreach()'s (Andi, Zend Engine)
2000-08-10 22:08:02 +00:00
Andi Gutmans
a1adc81f30
@ Fix switch which only has a default rule (Andi, Zend Engine)
...
@ Change require_once() to use the same file list as include_once().
@ Patch includes making require() & include() to behave the same when it
@ comes to scoping. require() is now an include() which isn't allowed to fail.
@ require() caused too many memory reallocations which ended up being quite
@ slow for sites that required lots of files. (Andi & Zeev, Zend Engine)
- Fix switch() which only has default rule (bug #5879 ,
2000-08-10 20:42:57 +00:00
Zeev Suraski
c06692e9ec
The patch we promised - redesigned the compilation/execution API:
...
Advantages:
- Smaller memory footprint for the op arrays
- Slightly faster compilation times (due to saved erealloc() calls and faster zend_op
initialization)
- include_once() & require_once() share the same file list
- Consistency between include() and require() - this mostly means that return()
works inside require()'d files just as it does in include() files (it used to
be meaningless in require()'d files, most of the time (see below))
- Made require() consistent with itself. Before, if the argument was not a constant
string, require() took the include() behavior (with return()).
- Removed lots of duplicate code.
Bottom line - require() and include() are very similar now; require() is simply an include()
which isn't allowed to fail. Due to the erealloc() calls for large op arrays, require()
didn't end up being any faster than include() in the Zend engine.
2000-08-09 19:22:35 +00:00
Zeev Suraski
a30cde3de5
Fix a possible issue with runtime inheritence under fairly rare circumstance
...
and optimize a tiny bit
2000-07-26 18:23:30 +00:00
Andi Gutmans
4066a197be
- Beautify Zeev's patch a bit.
2000-07-16 22:33:42 +00:00
Zeev Suraski
808f8ed306
Implement parent::foo()
2000-07-16 16:40:21 +00:00
Zeev Suraski
b4266edb07
Add more extended_info calls
2000-07-15 15:41:20 +00:00
Andi Gutmans
80121ead56
- Make is_method_call() static and remove a couple of old lines
2000-07-06 23:28:05 +00:00
Andi Gutmans
af5d38214b
- One more fix for the latest patch
2000-07-06 22:29:06 +00:00
Andi Gutmans
2787a746f4
- One dumb bug in my latest patch
2000-07-06 22:21:24 +00:00
Andi Gutmans
5f893e68ff
- Complex fix for solving a problem with objects & method calls.
...
- Previous version is tagged PRE_METHOD_CALL_SEPERATE_FIX_PATCH.
- I need to check this fix on a server so if it doesn't work I will revert
- it.
2000-07-06 22:08:22 +00:00
Andi Gutmans
6d6d52551e
- Fix bug #4120
2000-07-03 19:17:57 +00:00
Andi Gutmans
727398b2d4
Add to the API
2000-06-13 19:01:22 +00:00
Zeev Suraski
968d2c5b33
Get rid of <?php_track_vars?>
2000-06-12 16:07:15 +00:00
Andi Gutmans
eb0e694665
- Andrei, this is for you!
...
- Add zend_register_internal_class_ex() which allows you to specify a
- parent to inherit from. You can either specify the parent directly or via
- its name.
2000-06-09 14:40:14 +00:00
Zeev Suraski
98bf43f229
Enable asp_tags/short_tags/allow_call_time_pass_by_reference to work on a per-directory
...
basis as well
2000-06-06 19:13:54 +00:00
Zeev Suraski
1c36e3472f
Change shutdown order to sort out a crash when assigning a resource id to a static.
2000-06-04 22:09:16 +00:00
Zeev Suraski
0b7a9cea88
- Fix Win32 compilation (Use winsock2.h from now on)
...
- Add lambda() support
2000-06-03 01:49:49 +00:00
Zeev Suraski
385d1aa664
Fix a crash bug in certain situations of class redeclarations
2000-05-25 16:26:22 +00:00
Zeev Suraski
9a751419cf
Refined fix
2000-05-11 18:49:45 +00:00