Commit Graph

540 Commits

Author SHA1 Message Date
Zeev Suraski
e7e0f7d4b4 - Check return-by-reference bit when implementing interface prototypes
- Add infrastructure for built-in functions to hint whether they
  return by reference or not.  It is NOT currently used for anything,
  except for interface prototypes (you can use it to request that the
  function that implements your prototype returns by reference or
  doesn't return by reference).
  For downwards compatibility - by default, interface prototypes are
  agnostic as to whether the function that implements them returns
  by reference or not.  Use ZEND_BEGIN_ARG_INFO_EX() with
  ZEND_RETURN_VALUE/ZEND_RETURN_REFERENCE to change that.
- Fix ArrayAccess::getOffset() to conduct additional checks.
  If your getOffset() should work with multidimensional arrays - it
  must return by reference.
2004-02-12 13:49:55 +00:00
Marcus Boerger
c6cbafa273 Fix: <interface> [extends <interface> [, <ineterface>]* ] 2004-02-11 22:13:39 +00:00
Zeev Suraski
c01c44c2e2 Fix bug #26802 (the right aspects of it found by Marcus, anyway :) 2004-02-11 10:51:05 +00:00
Andi Gutmans
91ee6c0ceb - Nuke more unused code 2004-02-10 11:44:17 +00:00
Andi Gutmans
041b5dc2f7 - Remove junk 2004-02-10 10:44:09 +00:00
Ilia Alshanetsky
157a4e289a Fixed bug #27145 (Unmangle private/protected property names before printing
then inside error messages).
2004-02-05 02:16:08 +00:00
Zeev Suraski
d3c9467432 Fixlet 2004-02-04 18:24:44 +00:00
Zeev Suraski
bab3acc37b Fix handling of $this in some cases 2004-02-04 17:57:48 +00:00
Zeev Suraski
52b5f3fea1 Handle additional cases 2004-02-04 17:10:44 +00:00
Zeev Suraski
c5d842279c Reinstate early-binding for classes.
Note that this is available for downwards compatibility only - and it doesn't
work if you use new features (namely, interfaces).  Generally, people should
declare their classes before using them, but we just didn't want hell to break
loose (c)
2004-02-04 16:30:15 +00:00
Zeev Suraski
3df50001e1 - Improve $this assignment detection and generalize some code in zend_compile.c 2004-02-04 14:25:25 +00:00
Zeev Suraski
e1fc3963ee -Error out when trying to re-assign $this 2004-02-04 13:56:41 +00:00
Zeev Suraski
3ac58bffcf - Small fixes 2004-02-04 11:56:07 +00:00
Marcus Boerger
60a4a48e4e Fix Warning 2004-02-03 21:13:04 +00:00
Zeev Suraski
e4db2fb890 Remove unused variable 2004-02-03 15:51:09 +00:00
Zeev Suraski
e1bf9cc4c2 Remove redundant code 2004-02-03 14:31:07 +00:00
Zeev Suraski
848d4aed8a Perform a bitwise copy of the object even when __clone() is defined.
__clone() is back to not requiring any arguments, as $that is no longer
needed ($this already contains a copy of the original object, by the time
we __clone() is executed).
Calling the parent clone is done using parent::__clone()
2004-02-03 12:36:13 +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
Zeev Suraski
d45541b4fb Tweak checks to detect some additional cases.
Reorder checks to make more sense.
2004-01-28 22:27:39 +00:00
Zeev Suraski
be7d41b905 - Error message fix
- Prevent inheritance of the same constant from two interfaces
2004-01-28 11:53:52 +00:00
Zeev Suraski
a7ff369cac Fixlets 2004-01-28 10:52:27 +00:00
Zeev Suraski
2adaa11f2f Prevent classes from implementing interfaces that have the same function 2004-01-28 10:25:45 +00:00
Zeev Suraski
673e6e23e7 Code relayout 2004-01-28 09:13:41 +00:00
Marcus Boerger
3ca44539a1 Switch from ZEND_ACC_DYNAMIC to ZEND_ACC_ALLOW_STATIC and disallow calling
internal non-static methods statically.
# As discussed with Zeev:
# - For BC standard userspace methods allow this with an E_STRICT message.
# - If you want to implement an internal method taht can be called both
#   statically and non-statically then use flag ZEND_ACC_ALLOW_STATIC.
# - Magic user space methods __*() cannot and __construct, __destruct,
# __clone can never be called statically.
2004-01-24 16:59:24 +00:00
Marcus Boerger
6020ffd007 Simplify detection of methods that must be called dynamic (with object) 2004-01-23 22:04:42 +00:00
Marcus Boerger
7c2e02d380 Disallow static declaration of clone 2004-01-23 20:52:39 +00:00
foobar
796938ec7f Nuke compile warning by using the LANG_SCNG macro instead 2004-01-17 00:26:12 +00:00
Zeev Suraski
59d168eda7 Don't allow interfaces to implement anything 2004-01-14 14:00:11 +00:00
Andi Gutmans
92eb129bd9 - Return the PHP 4 behavior of not allowing class declerations within
- class declerations. This happened when declaring a class within a
- method.
class A {
	function foo() {
		class B {
		}
	}
}
2004-01-12 07:15:55 +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
Stanislav Malyshev
c4b6a637e5 Bug #25816 - disallow arrays in class constants 2004-01-09 14:02:33 +00:00
Stanislav Malyshev
e321eba06b Fix Bug #26077 - memory leak when new() result is not assigned
and no constructor defined
2004-01-09 13:52:19 +00:00
foobar
ccfc46b0aa - Happy new year and PHP 5 for rest of the files too..
# Should the LICENSE and Zend/LICENSE dates be updated too?
2004-01-08 17:33:29 +00:00
Derick Rethans
6923a16c26 - Fixed var_export() to show public, protected and private modifiers properly.
- Exported (un)mangle_property_name.
2004-01-03 13:51:02 +00:00
Marcus Boerger
15964bb35d Fix order of class_entry member initialization (needed for example for DOM)
# You need to completley rebuild PHP after this patch.
2003-12-28 15:18:05 +00:00
Marcus Boerger
50888a100c Preserve class name casing. 2003-12-22 22:34:28 +00:00
Dmitry Stogov
3c4cfd3ec8 Dynamic function call from object's property was fixed
(See "tests/lang/bug24926.phpt" and "tests/lang/bug25652.phpt")
2003-12-17 14:45:59 +00:00
Stanislav Malyshev
6d5eb809be export class initialization function 2003-12-16 10:51:51 +00:00
Zeev Suraski
3a42babad6 Fix behavior of return-by-reference functions. Remove erroneous warnings,
add E_STRICT warnings in case you return something by reference that you're
not supposed to (anything that's not a variable, or a return-value of a
function that returned by reference).
2003-12-14 16:09:07 +00:00
Marcus Boerger
8a8deee8a0 This test is against interfaces not abstract classes. 2003-12-06 19:02:12 +00:00
Andi Gutmans
f4d6a5c7cf - Remove two unneeded convert_to_string() (found by Marcus)
- Change illegal use of string offset to E_ERROR
2003-12-05 16:28:54 +00:00
Andi Gutmans
d7f839cce7 - Fix for bug #26182 2003-12-02 12:06:03 +00:00
Marcus Boerger
af5489d91b Revert accidential commit until decision 2003-11-29 17:05:17 +00:00
Marcus Boerger
9ffd44e94a Make exception code more robust:
- Fix error in calculation of trace-string length
- Allow to overload __strostring() and make it work for uncaught exceptions
- Show exception thrown while displaying exceptions
2003-11-29 17:03:45 +00:00
Andi Gutmans
d344648b07 - Fix __autoload() to preserve class case.
- Heads up, this patch might break stuff so please let me know if you
- bump into any problems.
2003-11-24 18:13:29 +00:00
Marcus Boerger
1eaf126a7a Backpatch the correct opcode for list(), property overloading needs more
opcodes (Bugfix #26257).
2003-11-18 07:19:55 +00:00
Andi Gutmans
db2a1f4590 - Make sure internal clasess are malloced 2003-11-13 06:40:34 +00:00
Marcus Boerger
296529b886 Split isset/isempty for object property and object dimension hooking. 2003-11-10 16:14:44 +00:00