Commit Graph

1326 Commits

Author SHA1 Message Date
Nikita Popov
1477be9aa8 Make $generator->send() return the current value
This makes the API easier to use (and is consistent with Python and JS).
2012-05-31 20:03:18 +02:00
Nikita Popov
ee89e228f6 Allow yielding during function calls
During function calls arguments are pushed onto the stack. Now these are
backed up on yield and restored on resume. This requires memcpy'ing them,
but there doesn't seem to be any better way to do it.

Also this fixes the issue with exceptions thrown during function calls.
2012-05-31 00:00:30 +02:00
Nikita Popov
0033a52521 Allow throwing exceptions from generators
The missing piece is how one can find the next stack frame, which is
required for dtor'ing arguments pushed to the stack. As the generator
execute_data does not live on the stack one can't use it to figure out the
start of the next stack frame. So there must be some other method.
2012-05-30 16:28:33 +02:00
Stanislav Malyshev
ec2029a894 Merge branch 'PHP-5.4'
* PHP-5.4:
  fix test
  fix test
2012-05-29 23:53:01 -07:00
Stanislav Malyshev
abe6362716 fix test 2012-05-29 23:52:47 -07:00
Nikita Popov
8790160235 Add auto-increment keys
When no key is explicitely yielded PHP will used auto-incrementing keys
as a fallback. They behave the same as with arrays, i.e. the key is the
successor of the largest previously used integer key.
2012-05-30 05:05:49 +02:00
Nikita Popov
bc08c2cf94 Add support for yielding keys
Keys are yielded using the

    yield $key => $value

syntax. Currently this is implemented as a statement only and not as an
expression, because conflicts arise considering nesting and use in arrays:

    yield yield $a => $b;
    // could be either
    yield (yield $a) => $b;
    // or
    yield (yield $a => $b);

Once I find some way to resolve these conflicts this should be available
as an expression too.

Also the key yielding code is rather copy-and-past-y for the value yielding
code, so that should be factored out.
2012-05-30 02:44:06 +02:00
Nikita Popov
72a91d08e7 Add $generator->close() method
Calling $generator->close() is equivalent to executing a return statement
at the current position in the generator.
2012-05-29 18:11:18 +02:00
Nikita Popov
12e928314f Fix segfault when send()ing to a closed generator 2012-05-29 18:01:08 +02:00
Nikita Popov
ad525c288a Allow to use yield without value
If the generator is used as a coroutine it often doesn't make sense to yield
anything. In this case one can simply receive values using

    $value = yield;

The yield here will simply yield NULL.
2012-05-29 17:53:11 +02:00
Nikita Popov
3600914ced Add support for $generator->send()
Yield now is an expression and the return value is the value passed to
$generator->send(). By default (i.e. if ->next() is called) the value is
NULL.

Unlike in Python ->send() can be run without priming the generator with a
->next() call first.
2012-05-29 17:34:33 +02:00
Nikita Popov
4aab08b64c Properly free resources when generator return value not used
To keep things clean two new functions are introduced:

zend_clean_and_cache_symbol_table(HashTable *symbol_table)
zend_free_compiled_variables(zval ***CVs, int num)
2012-05-28 06:43:18 +02:00
Nikita Popov
bcc7d976f3 Set EG(current_execute_data)
This fixes several issues. In particular it makes method generators work
properly and also allows generators using a symbol table.
2012-05-28 06:06:30 +02:00
Nikita Popov
9f52c5c226 Fix generator creation when execute_data is not nested
This happens primarily when the generator is invoked from some internal
place like a dynamic function call.
2012-05-27 22:48:21 +02:00
Nikita Popov
64a643a4e3 Free loop variables
If the generator is closed before it has finished running, it may happen
that some FREE or SWITCH_FREE opcodes haven't been executed and memory is
leaked.

This fixes it by walking the brk_cont_array and manually freeing the
variables.
2012-05-27 17:14:20 +02:00
Nikita Popov
39d3d5ec13 Add first real generator test
The test implements an xrange() function (the generator version of range()).
2012-05-27 00:50:27 +02:00
Nikita Popov
5bb3a995c2 Implement return for generators
For generators ZEND_RETURN directly calls ZEND_VM_RETURN(), thus passing
execution back to the caller (zend_generator_resume).

This commit also adds a check that only return; is used in generators and
not return $value;.
2012-05-26 23:07:40 +02:00
Stanislav Malyshev
b187c35f23 Merge branch 'pull-request/54'
* pull-request/54:
  Allow arbitrary expressions for empty()

    This change is as per RFC https://wiki.php.net/rfc/empty_isset_exprs.

    The change allows passing the result of function calls and other
    expressions to the empty() language construct. This is accomplished by
    simply rewriting empty(expr) to !expr.

    The change does not affect the suppression of errors when using empty()
    on variables. empty($undefinedVar) will continue not to throw errors.
    When an expression is used inside empty() on the other hand, errors will
    not be suppressed. Thus empty($undefinedVar + $somethingElse) *will*
    throw a notice.

    The change also does not make empty() into a real function, so using
    'empty' as a callback is still not possible.

    In addition to the empty() changes the commit adds nicer error messages
    when isset() is used on function call results or other expressions.
2012-05-24 14:18:12 -05:00
Gustavo André dos Santos Lopes
d4fd95e292 Merge branch '5.4' 2012-05-24 11:09:18 +02:00
Gustavo André dos Santos Lopes
acd711685a Fixed bug #62097
This fixes the fix for bug #54547 in 32-bit machines by accepting
float comparisons in 32-bit machines as long as the integer is
not larger than the mantissa.
2012-05-23 18:55:36 -05:00
Dmitry Stogov
c8f47a8e7c Fixed bug #61998 (Using traits with method aliases appears to result in crash during execution) 2012-05-21 13:46:07 +04:00
Dmitry Stogov
7632a32ef9 Fixed bug #61998 (Using traits with method aliases appears to result in crash during execution) 2012-05-21 12:53:21 +04:00
Nikita Popov
46fa26ab85 Make generator functions return a Generator object
Right now generator functions simply immediately return a new Generator
object (no suspension yet).
2012-05-20 14:45:01 +02:00
Nikita Popov
40b7533576 Add some boilerplate code for Generator class
The Generator class now uses a zend_generator struct, so it'll be able to
store additional info.

This commit also ensures that Generator cannot be directly instantiated
and extended. The error tests are now in a separate folder from the
(yet-to-come) functional tests.
2012-05-20 14:19:16 +02:00
Nikita Popov
fd2a109f86 Add error if yield is used outside a generator
The yield statement can only be used in generator functions, which are
marked with an asterix.
2012-05-19 18:49:27 +02:00
Stanislav Malyshev
d03900dc92 fix bug #61782 - __clone/__destruct do not match other methods when checking access controls 2012-05-14 11:03:21 -07:00
Stanislav Malyshev
47db8a9aa1 fix bug #54547 2012-05-14 11:03:20 -07:00
Stanislav Malyshev
a0dff6fdca fix bug #61782 - __clone/__destruct do not match other methods when checking access controls 2012-05-13 14:40:44 -07:00
Stanislav Malyshev
9344bf193c fix bug #54547 2012-05-13 14:40:44 -07:00
Nikita Popov
ec061a93c5 Allow arbitrary expressions for empty()
This change is as per RFC https://wiki.php.net/rfc/empty_isset_exprs.

The change allows passing the result of function calls and other
expressions to the empty() language construct. This is accomplished by
simply rewriting empty(expr) to !expr.

The change does not affect the suppression of errors when using empty()
on variables. empty($undefinedVar) will continue not to throw errors.
When an expression is used inside empty() on the other hand, errors will
not be suppressed. Thus empty($undefinedVar + $somethingElse) *will*
throw a notice.

The change also does not make empty() into a real function, so using
'empty' as a callback is still not possible.

In addition to the empty() changes the commit adds nicer error messages
when isset() is used on function call results or other expressions.
2012-05-13 14:56:51 +02:00
Xinchen Hui
5852e5f48d Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
  fix stack overflow in php_intlog10abs()
  fix stack overflow in php_intlog10abs()
2012-05-12 13:21:49 +08:00
Xinchen Hui
6a5095582a Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
  fix stack overflow in php_intlog10abs()

Conflicts:
	Zend/zend_execute.c
2012-05-12 13:19:55 +08:00
Xinchen Hui
3332943c9d Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object) 2012-05-12 13:13:44 +08:00
Xinchen Hui
e022bfe34a Merge remote-tracking branch 'origin/PHP-5.4'
* origin/PHP-5.4:
  Fixed test bug #61892
2012-05-03 20:00:10 +08:00
Xinchen Hui
d74d88fbb9 Fixed test bug #61892 2012-05-03 19:56:49 +08:00
Xinchen Hui
6b9e88d9e6 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash)
2012-04-18 18:15:29 +08:00
Xinchen Hui
da6465a268 Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash) 2012-04-18 18:13:27 +08:00
Xinchen Hui
565892d4c0 Implement const array/string dereference
RFC:https://wiki.php.net/rfc/constdereference
2012-04-17 10:06:17 +08:00
Nikita Popov
b233de098d Fix bug #61681: Malformed grammar
Generate T_STRING_VARNAME only if it actually is one. This is only the case
for "${varname}" and "${varname[offset]}" so we can just add a check for
} or [ after the LABEL.
2012-04-09 18:26:38 +02:00
Xinchen Hui
6ba2e662e4 Implemented FR #60738 (Allow 'set_error_handler' to handle NULL)
The previous commit was reverted as Stas ask, so only commit this
to Truk now.
2012-03-24 19:41:11 +08:00
Xinchen Hui
aa7cdcd13d Merge branch 'PHP-5.4' of ../php-5.4 2012-03-24 19:28:43 +08:00
Xinchen Hui
872fdd153e Merge branch 'PHP-5.3' of ../php-5.3 into PHP-5.4 2012-03-24 19:26:27 +08:00
Xinchen Hui
9c99a89e8e Revert "Implemented FR #60738 (Allow 'set_error_handler' to handle NULL)"
This reverts commit fcae164ea6.
2012-03-24 19:26:02 +08:00
Xinchen Hui
690afaffc8 Merge branch 'PHP-5.4' of ../php-5.4 2012-03-24 15:16:51 +08:00
Xinchen Hui
7ffc442927 Merge branch 'PHP-5.3' of ../php-5.3 into PHP-5.4 2012-03-24 15:15:27 +08:00
Xinchen Hui
fcae164ea6 Implemented FR #60738 (Allow 'set_error_handler' to handle NULL) 2012-03-24 15:13:10 +08:00
Xinchen Hui
3813f987d5 Merge branch 'PHP-5.4'
* PHP-5.4:
  Remove empty lines
2012-03-24 11:35:29 +08:00
Xinchen Hui
114d662d12 Remove empty lines 2012-03-24 11:35:13 +08:00
Xinchen Hui
943a4fed4e reduce memory usage 2012-03-12 14:52:02 +00:00
Xinchen Hui
438a30f1e7 reduce memory usage 2012-03-12 14:52:02 +00:00
Xinchen Hui
d845cfb12e reduce memory usage 2012-03-12 14:52:02 +00:00
Ilia Alshanetsky
2cc64c28f0 Fixed bug #60569 (Nullbyte truncates Exception $message). 2012-03-11 18:15:13 +00:00
Ilia Alshanetsky
d4f05fbffc Fixed bug #60569 (Nullbyte truncates Exception $message). 2012-03-11 18:15:13 +00:00
Ilia Alshanetsky
3d9824a798 Fixed bug #60569 (Nullbyte truncates Exception $message). 2012-03-11 18:15:13 +00:00
Xinchen Hui
a38ffd5705 Fixed bug #61273 (call_user_func_array with more than 16333 arguments leaks / crashes) 2012-03-11 15:28:31 +00:00
Xinchen Hui
b7ae5e0d86 Fixed bug #61273 (call_user_func_array with more than 16333 arguments leaks / crashes) 2012-03-11 15:28:31 +00:00
Xinchen Hui
7536bf963d Fixed bug #61273 (call_user_func_array with more than 16333 arguments leaks / crashes) 2012-03-11 15:28:31 +00:00
Xinchen Hui
24603280d4 fix test 2012-03-11 14:44:07 +00:00
Stefan Marr
520d07d86a Fixed Bug #61052 (Missing error check in trait 'insteadof' clause) 2012-03-04 19:34:19 +00:00
Stefan Marr
ffded0020b Fixed Bug #61052 (Missing error check in trait 'insteadof' clause) 2012-03-04 19:34:19 +00:00
Stefan Marr
34fe62619d Fixed Bug #60911 (Confusing error message when extending traits) 2012-03-04 18:33:33 +00:00
Stefan Marr
0ed3b00406 Fixed Bug #60911 (Confusing error message when extending traits) 2012-03-04 18:33:33 +00:00
Stefan Marr
60dfd64bf2 Fixed Bug #60717 (Order of traits in use statement can cause a fatal error)
# Compatibility is now correctly checked in both directions.
# Introduced helper method for the test.
2012-03-04 18:26:11 +00:00
Stefan Marr
0bb85e4b91 Fixed Bug #60717 (Order of traits in use statement can cause a fatal error)
# Compatibility is now correctly checked in both directions.
# Introduced helper method for the test.
2012-03-04 18:26:11 +00:00
Xinchen Hui
bacd820218 MFH: Fixed bug #61087 (Memory leak in parse_ini_file when specifying invalid scanner mode) 2012-03-02 03:52:06 +00:00
Xinchen Hui
046e3e3889 MFH: Fixed bug #60573 (type hinting with "self" keyword causes weird errors) 2012-03-02 03:32:12 +00:00
Xinchen Hui
101e3e8aed MFH: Fixed bug #60978 (exit code incorrect) 2012-03-02 03:25:41 +00:00
Xinchen Hui
5f99d789b5 MFH: Fixed bug #60978 (exit code incorrect) 2012-03-02 03:25:41 +00:00
Xinchen Hui
0876d7bb89 MFH: Fixed bug #61011 (Crash when an exception is thrown by __autoload accessing a static property) 2012-03-02 03:12:15 +00:00
Xinchen Hui
0e4d46a3a7 MFH: Fix bug #61165 (Segfault - strip_tags()) 2012-03-02 02:51:57 +00:00
Pierrick Charron
1953161b8c Fixed bug #61225 (Lexing 0b0*+<NUM> incorectly) 2012-03-02 02:36:31 +00:00
Pierrick Charron
f7cd0588a9 Fixed bug #61225 (Lexing 0b0*+<NUM> incorectly) 2012-03-02 02:36:31 +00:00
Xinchen Hui
c870ebe138 Fixed bug #61087 (Memory leak in parse_ini_file when specifying invalid scanner mode) 2012-02-25 14:15:11 +00:00
Xinchen Hui
38b549ea2f Fixed bug #61087 (Memory leak in parse_ini_file when specifying invalid scanner mode) 2012-02-25 14:15:11 +00:00
Xinchen Hui
229e55632d Fixed bug #61011 (Crash when an exception is thrown by __autoload accessing a static property) 2012-02-25 13:56:59 +00:00
Olivier DOUCET
e613889d50 more verbose skip reason in test files with not so obvious extension requirements 2012-02-25 12:10:41 +00:00
Olivier DOUCET
bdbcc1789d more verbose skip reason in test files with not so obvious extension requirements 2012-02-25 12:10:41 +00:00
Olivier DOUCET
ce535f1819 more verbose skip reason in test files with not so obvious extension requirements 2012-02-25 12:10:41 +00:00
Xinchen Hui
2d424a88fc merge test to 5.3, and remove xfail since the bug was fixed 2012-02-25 05:18:40 +00:00
Xinchen Hui
7334a4b14f merge test to 5.3, and remove xfail since the bug was fixed 2012-02-25 05:18:40 +00:00
Xinchen Hui
c1322d2505 Fix test 2012-02-25 03:19:27 +00:00
Xinchen Hui
a57140324d typo 2012-02-25 03:16:28 +00:00
Xinchen Hui
4b86d681bb test for bug #61011 2012-02-25 03:14:16 +00:00
Xinchen Hui
f86d90d27b Tests for bug #61165 2012-02-25 03:12:54 +00:00
Etienne Kneuss
c51f737994 Fix #61095 (Lexing 0x0*+<NUM> incorrectly) 2012-02-20 18:28:57 +00:00
Etienne Kneuss
eefefddc0e Fix #61095 (Lexing 0x0*+<NUM> incorrectly) 2012-02-20 18:28:57 +00:00
Etienne Kneuss
86fcb9659e Fix #61095 (Lexing 0x0*+<NUM> incorrectly) 2012-02-20 18:28:57 +00:00
Xinchen Hui
ff63c09e6f Revert -r319102 and -r322922 in 5.4 branch since they introduce #60978
Fixed #60978 in trunk without reverting previous fix
#see http://news.php.net/php.internals/57789
2012-02-08 03:03:05 +00:00
Rasmus Lerdorf
fe802ac2ad This test needs gc enabled 2012-02-05 06:09:22 +00:00
Rasmus Lerdorf
0c3685e223 This test needs gc enabled 2012-02-05 06:09:22 +00:00
Rasmus Lerdorf
6452b81b14 This test needs gc enabled 2012-02-05 06:09:22 +00:00
Xinchen Hui
1207451239 Fixed bug #60825 (Segfault when running symfony 2 tests) 2012-01-26 01:21:35 +00:00
Xinchen Hui
6b1d3b3d10 Re-fixed bug #60825 (Segfault when running symfony 2 tests) 2012-01-24 14:39:45 +00:00
Xinchen Hui
a222954a45 Re-fixed bug #60825 (Segfault when running symfony 2 tests) 2012-01-24 14:39:45 +00:00
Xinchen Hui
cf54cc736b Fixed bug #60825 (Segfault when running symfony 2 tests) 2012-01-21 17:13:53 +00:00
Dmitry Stogov
3299a2673c Fixed Bug #60809 (TRAITS - PHPDoc Comment Style Bug)
Fixed some other traits related bugs (uninitialized variable, return => continue)
Removed some trait related redundant code and variables
2012-01-20 12:30:57 +00:00
Dmitry Stogov
f9e6af5ef1 Fixed Bug #60809 (TRAITS - PHPDoc Comment Style Bug)
Fixed some other traits related bugs (uninitialized variable, return => continue)
Removed some trait related redundant code and variables
2012-01-20 12:30:57 +00:00
Pierre Joye
902bbce03b - add test for bug #60771 2012-01-18 20:22:47 +00:00
Pierre Joye
d285c75819 - add test for bug #60771 2012-01-18 20:22:47 +00:00
Pierre Joye
1cc5588248 - add test for bug #60771 2012-01-18 20:22:47 +00:00
Dmitry Stogov
b515bfbdfb Improved traits implementation. Now to support __CLASS__ constant in traits php doesn't have to copy the complete compiled method, but can reuse the same code. The resolution of __CLASS__ constants in methods defined in traits are delayed till run-time. This approach also made possible to use __CLASS__ constant as default value for traits properties and method arguments. 2012-01-17 08:09:13 +00:00
Dmitry Stogov
032d140fd6 Improved traits implementation. Now to support __CLASS__ constant in traits php doesn't have to copy the complete compiled method, but can reuse the same code. The resolution of __CLASS__ constants in methods defined in traits are delayed till run-time. This approach also made possible to use __CLASS__ constant as default value for traits properties and method arguments. 2012-01-17 08:09:13 +00:00
Xinchen Hui
d74a258f24 Fixed Bug #60573 (type hinting with "self" keyword causes weird errors) 2012-01-16 09:53:45 +00:00
Rui Hirokawa
7ba37f7921 fixed failed tests (backport from PHP_5_4/trunk). 2012-01-14 09:07:10 +00:00
Dmitry Stogov
6e3f7b800d Fixed tests 2011-12-28 10:12:43 +00:00
Dmitry Stogov
90a8da866b Fixed tests 2011-12-28 10:12:43 +00:00
Dmitry Stogov
a68e858d69 Fixed bug #60613 (Segmentation fault with $cls->{expr}() syntax) 2011-12-28 09:59:39 +00:00
Dmitry Stogov
c058385112 Fixed bug #60613 (Segmentation fault with $cls->{expr}() syntax) 2011-12-28 09:59:39 +00:00
Xinchen Hui
84ce790437 Fix #60613 (Segmentation fault with $cls->{expr}() syntax)
#now the behavior is like 5.3, a COMPILER_ERROR will be triggered
2011-12-28 06:46:12 +00:00
Xinchen Hui
113c0a8cc7 Fix #60613 (Segmentation fault with $cls->{expr}() syntax)
#now the behavior is like 5.3, a COMPILER_ERROR will be triggered
2011-12-28 06:46:12 +00:00
Xinchen Hui
20e2db2ce3 Fix bug #60611 (Segmentation fault with Cls::{expr}() syntax) 2011-12-27 08:38:18 +00:00
Xinchen Hui
2f4875bf92 Fix bug #60611 (Segmentation fault with Cls::{expr}() syntax) 2011-12-27 08:38:18 +00:00
Stanislav Malyshev
327a5828cd Fix warning on non-numeric offsets 2011-12-22 03:22:42 +00:00
Stanislav Malyshev
0610ca459a Fix warning on non-numeric offsets 2011-12-22 03:22:42 +00:00
Stanislav Malyshev
1f4f33afcf implement the solution for isset/string offsets, fix bug #60362 2011-12-19 02:05:03 +00:00
Stanislav Malyshev
622412d8e6 implement the solution for isset/string offsets, fix bug #60362 2011-12-19 02:05:03 +00:00
Stefan Marr
525dd55eed Fixed inconsistent and broken handling of private properties in traits.
# The handling of private properties in classes is now consistent with private properties in traits.
# Perviously, privates could cause strict warnings, are were not properly merged into the class when
# the parent class had a private property of the same name. Now, we introduce it without notice,
# since it is a new and independent property, just like in normal classes.
# This problem was diagnosed while working on Bug #60536.
2011-12-17 14:26:39 +00:00
Stefan Marr
3dc9f0abe6 Fixed inconsistent and broken handling of private properties in traits.
# The handling of private properties in classes is now consistent with private properties in traits.
# Perviously, privates could cause strict warnings, are were not properly merged into the class when
# the parent class had a private property of the same name. Now, we introduce it without notice,
# since it is a new and independent property, just like in normal classes.
# This problem was diagnosed while working on Bug #60536.
2011-12-17 14:26:39 +00:00
Xinchen Hui
01dc47631e Fixed bug #60536 (Traits Segfault)
# this is a tough one, I think I should explain
# Zend use zend_object->properties_table both as zval ** and zval ***
# if a zend_object->properties is not initialized, the properties_table is zval **
# while in rebuild_object_properties, zend will store the zval ** to zend_object->properties
# then stash the zval ***(ie, zobj->properties_table[0] is zval ** now) to  zobj->properties_table[0] 
# so when a zend_object inherit form multi parent and these parent have a same property_info->offset 
# properties, will result in a repeat zval **->zval ** transform, which will lead to a segmentfault
# *may be* this fix is not the best fix, we should not use this tricky way, and rewrite this mechanism.
2011-12-16 19:02:52 +00:00
Xinchen Hui
707f658c33 Fixed bug #60536 (Traits Segfault)
# this is a tough one, I think I should explain
# Zend use zend_object->properties_table both as zval ** and zval ***
# if a zend_object->properties is not initialized, the properties_table is zval **
# while in rebuild_object_properties, zend will store the zval ** to zend_object->properties
# then stash the zval ***(ie, zobj->properties_table[0] is zval ** now) to  zobj->properties_table[0] 
# so when a zend_object inherit form multi parent and these parent have a same property_info->offset 
# properties, will result in a repeat zval **->zval ** transform, which will lead to a segmentfault
# *may be* this fix is not the best fix, we should not use this tricky way, and rewrite this mechanism.
2011-12-16 19:02:52 +00:00
Xinchen Hui
95784cf6c5 remove irrelevant codes in test 2011-12-05 12:46:38 +00:00
Xinchen Hui
b92996bea6 remove irrelevant codes in test 2011-12-05 12:46:38 +00:00
Xinchen Hui
2f8c502d22 Add xfaild test for a secluded issue 2011-12-05 12:44:12 +00:00
Xinchen Hui
f30db67f58 Add xfaild test for a secluded issue 2011-12-05 12:44:12 +00:00
Dmitry Stogov
1d6c98a136 Fixed bug #60444 (Segmentation fault with include & class extending) 2011-12-05 09:20:12 +00:00
Dmitry Stogov
30328dcbab Fixed bug #60444 (Segmentation fault with include & class extending) 2011-12-05 09:20:12 +00:00
Felipe Pena
bfb1d38b9c - Added tests for bug #60350
patch by: php@mickweiss.com
2011-11-30 21:04:07 +00:00
Felipe Pena
d2de045007 - Added tests for bug #60350
patch by: php@mickweiss.com
2011-11-30 21:04:07 +00:00
Stefan Marr
db0888dfc1 Fixed Bug #60369 Crash with static property in trait 2011-11-23 21:24:34 +00:00
Stefan Marr
35d38e4772 Fixed Bug #60369 Crash with static property in trait 2011-11-23 21:24:34 +00:00
Felipe Pena
b3b3eb8c2f - Fix tests 2011-11-19 18:01:26 +00:00
Felipe Pena
2bd90344a6 - Fix tests 2011-11-19 18:01:26 +00:00
Felipe Pena
ebd7dc5f88 - Fix tests 2011-11-19 18:01:26 +00:00
Felipe Pena
31ef559712 - Fixed bug #43200 (Interface implementation / inheritence not possible in abstract classes) 2011-11-19 13:36:03 +00:00
Felipe Pena
14b5e775b0 - Fixed bug #43200 (Interface implementation / inheritence not possible in abstract classes) 2011-11-19 13:36:03 +00:00
Felipe Pena
bc810a443d - Fixed bug #43200 (Interface implementation / inheritence not possible in abstract classes) 2011-11-19 13:36:03 +00:00
Stefan Marr
e150100f36 Fixes Bug #54441 (Handling of changing modifiers on a trait alias)
# this now results also in a compilation error, since it would open the door for inconsistencies, and violates the DRY principle.
2011-11-18 13:49:07 +00:00
Stefan Marr
76772dc20d Fixes Bug #54441 (Handling of changing modifiers on a trait alias)
# this now results also in a compilation error, since it would open the door for inconsistencies, and violates the DRY principle.
2011-11-18 13:49:07 +00:00
Dmitry Stogov
f7278c161f Fixed bug #60138 (GC crash with referenced array in RecursiveArrayIterator) 2011-11-18 12:43:53 +00:00
Dmitry Stogov
c24716dfa4 Fixed bug #60138 (GC crash with referenced array in RecursiveArrayIterator) 2011-11-18 12:43:53 +00:00
Dmitry Stogov
a65abc12b6 Fixed bug #60138 (GC crash with referenced array in RecursiveArrayIterator) 2011-11-18 12:43:53 +00:00
Stefan Marr
5ef2c32822 Fixed Bug #60165 (Aliasing unexisting trait should throw/trigger the exception/error)
- aliases that are not actually matching anything are treated as errors now. This
  will make sure that all methods that are expected to be in a class are actually
  there, or in case a trait changed for instance, that the code breaks already
  on composition
- Precedence declarations are also checked to ensure that the method
  which is supposed to take precedence actually exists, however,
  the other traits mentioned in the declaration are not regarded.
  We are more lenient here, since this avoids unnecessary fragility.
- fixed another seamingly unrelated test which broke in the progress
  but wasn't clear before either.
2011-11-17 21:04:15 +00:00
Stefan Marr
c5ba229617 Fixed Bug #60165 (Aliasing unexisting trait should throw/trigger the exception/error)
- aliases that are not actually matching anything are treated as errors now. This
  will make sure that all methods that are expected to be in a class are actually
  there, or in case a trait changed for instance, that the code breaks already
  on composition
- Precedence declarations are also checked to ensure that the method
  which is supposed to take precedence actually exists, however,
  the other traits mentioned in the declaration are not regarded.
  We are more lenient here, since this avoids unnecessary fragility.
- fixed another seamingly unrelated test which broke in the progress
  but wasn't clear before either.
2011-11-17 21:04:15 +00:00
Felipe Pena
7735ef1c2d - Fixed bug #60099 (__halt_compiler() works in braced namespaces) 2011-11-16 17:41:40 +00:00
Felipe Pena
caa863dc42 - Fixed bug #60099 (__halt_compiler() works in braced namespaces) 2011-11-16 17:41:40 +00:00
Felipe Pena
3c7a573a2c - Fixed bug #60099 (__halt_compiler() works in braced namespaces) 2011-11-16 17:41:40 +00:00
Felipe Pena
eebaaf423f - Added class member access on instantiation (e.g. (new foo)->bar()) support 2011-11-06 13:25:45 +00:00
Felipe Pena
ff48763f4b - Added class member access on instantiation (e.g. (new foo)->bar()) support 2011-11-06 13:25:45 +00:00
Stefan Marr
7334dfd7eb Fixed Bug #60217 (Requiring the same method from different traits)
- also added test to check for inconsistent abstract method definitions, they need to be compatible
2011-11-05 01:46:40 +00:00
Stefan Marr
12cf1b7978 Fixed Bug #60217 (Requiring the same method from different traits)
- also added test to check for inconsistent abstract method definitions, they need to be compatible
2011-11-05 01:46:40 +00:00
Xinchen Hui
cae2f1381f Fix bug #60169 Conjunction of ternary and list crashes PHP 2011-11-03 03:59:41 +00:00
Xinchen Hui
a9dbbf6dea Fix bug #60169 Conjunction of ternary and list crashes PHP 2011-11-03 03:59:41 +00:00
Ferenc Kovacs
6c01aacc0d adding memory check for FreeBSD also, TODO: refactor the free memory check into a function in an include file 2011-11-02 21:27:03 +00:00
Ferenc Kovacs
5bf6eaf3f4 adding memory check for FreeBSD also, TODO: refactor the free memory check into a function in an include file 2011-11-02 21:27:03 +00:00
Ferenc Kovacs
c60a2a711a adding memory check for FreeBSD also, TODO: refactor the free memory check into a function in an include file 2011-11-02 21:27:03 +00:00
Dmitry Stogov
e95bb57da9 Fixed bug #60139 (Anonymous functions create cycles not detected by the GC) 2011-11-02 06:31:33 +00:00
Dmitry Stogov
e0f781f496 Fixed bug #60139 (Anonymous functions create cycles not detected by the GC) 2011-11-02 06:31:33 +00:00
Dmitry Stogov
b64e91ddeb Fixed bug #60139 (Anonymous functions create cycles not detected by the GC) 2011-11-02 06:31:33 +00:00
Ferenc Kovacs
67e148a2ff allocating more than 2GB memory is slow. 2011-11-01 21:27:57 +00:00
Ferenc Kovacs
8412709f37 allocating more than 2GB memory is slow. 2011-11-01 21:27:57 +00:00
Ferenc Kovacs
236bf63b8b allocating more than 2GB memory is slow. 2011-11-01 21:27:57 +00:00
Stefan Marr
7cd55955d1 Fixed Bug #60153 (Interface method prototypes not enforced when implementd via traits.)
# Moved the freeing of overriden functions to a point after the check.
# The new check comes after the normal inheritance check to give the first check
# the opportunity to abort with a more detailed error.
# Also fixed a small type in an unrelated test.
2011-11-01 15:25:24 +00:00
Stefan Marr
4591498df7 Fixed Bug #60153 (Interface method prototypes not enforced when implementd via traits.)
# Moved the freeing of overriden functions to a point after the check.
# The new check comes after the normal inheritance check to give the first check
# the opportunity to abort with a more detailed error.
# Also fixed a small type in an unrelated test.
2011-11-01 15:25:24 +00:00
Stefan Marr
ce0ddd5a34 Added missing consistency check for abstract methods required by one trait and implemented by another. 2011-11-01 13:42:53 +00:00
Stefan Marr
9b0d73af1d Added missing consistency check for abstract methods required by one trait and implemented by another. 2011-11-01 13:42:53 +00:00
Stefan Marr
3b74bba724 Fixed Bug #60145 (Usage of trait's use statement inside interfaces not properly checked.) 2011-11-01 00:39:10 +00:00
Stefan Marr
b5f15ef561 Fixed Bug #60145 (Usage of trait's use statement inside interfaces not properly checked.) 2011-11-01 00:39:10 +00:00
Stefan Marr
ada5cda0ec Fixed Bug #60173 (Wrong error message on reflective trait instantiation) 2011-10-31 22:59:00 +00:00
Stefan Marr
2e5d5e5ac6 Fixed Bug #60173 (Wrong error message on reflective trait instantiation) 2011-10-31 22:59:00 +00:00
Xinchen Hui
55656b2cda Update tests 2011-10-31 06:52:45 +00:00
Xinchen Hui
63812d1849 Update tests 2011-10-31 06:52:45 +00:00
Xinchen Hui
3b99aa995d Test for #60174 (Notice when array in method prototype error) 2011-10-31 06:04:43 +00:00
Xinchen Hui
378ad2f447 Test for #60174 (Notice when array in method prototype error) 2011-10-31 06:04:43 +00:00
Xinchen Hui
9d98b3e39a tests for 60169 2011-10-30 06:28:24 +00:00
Xinchen Hui
01ebd32c05 tests for 60169 2011-10-30 06:28:24 +00:00
Ferenc Kovacs
6c67aa07b4 check the available memory on linux and skip if it is not enough 2011-10-23 00:07:01 +00:00
Ferenc Kovacs
c67c8cb965 check the available memory on linux and skip if it is not enough 2011-10-23 00:07:01 +00:00
Ferenc Kovacs
b6aa3964d8 check the available memory on linux and skip if it is not enough 2011-10-23 00:07:01 +00:00
Ferenc Kovacs
1b556f6114 shave off 900M memory from this test 2011-10-22 23:47:52 +00:00
Ferenc Kovacs
121ebbccc0 shave off 900M memory from this test 2011-10-22 23:47:52 +00:00
Ferenc Kovacs
9798694c03 shave off 900M memory from this test 2011-10-22 23:47:52 +00:00
Ferenc Kovacs
8e40498ae0 this was somehow missed from r318288 2011-10-22 22:35:17 +00:00
Stanislav Malyshev
d81ea16ef1 Changed silent conversion of array to string to produce a notice. (Patrick) 2011-10-21 06:08:47 +00:00
Stanislav Malyshev
ed12ebc79c Changed silent conversion of array to string to produce a notice. (Patrick) 2011-10-21 06:08:47 +00:00
Stefan Marr
7e4b9800f4 Fixed Bug #55554 (Legacy constructors not handled properly) [TRAITS] [DOC]
# The handling of legacy constructors defined by traits was corrected.
# They are now properly registered and used on instantiation.
# The situation for conflicting legacy and __construct constructors is
# mostly identical. If they are defined in the class, they override conflicts
# and do not collide. However, in case different styles are mixed, between
# class and trait definition, we assume a programmer's mistake and report
# a collision.
#
# BTW: +1 for all the fixed tests! `make test` is fun again.
2011-10-09 11:13:27 +00:00
Stefan Marr
e14354af21 Fixed Bug #55554 (Legacy constructors not handled properly) [TRAITS] [DOC]
# The handling of legacy constructors defined by traits was corrected.
# They are now properly registered and used on instantiation.
# The situation for conflicting legacy and __construct constructors is
# mostly identical. If they are defined in the class, they override conflicts
# and do not collide. However, in case different styles are mixed, between
# class and trait definition, we assume a programmer's mistake and report
# a collision.
#
# BTW: +1 for all the fixed tests! `make test` is fun again.
2011-10-09 11:13:27 +00:00
Xinchen Hui
2e925f6f19 Fixed bug #55825, and add test script 2011-10-03 17:01:17 +00:00
Xinchen Hui
37e1ed68e5 Fixed bug #55825, and add test script 2011-10-03 17:01:17 +00:00
Xinchen Hui
c58f254354 Improve the warning message of incompatible arguments. (#55719)
And fix tests related.
2011-09-23 15:08:11 +00:00
Xinchen Hui
8cefbca521 Improve the warning message of incompatible arguments. (#55719)
And fix tests related.
2011-09-23 15:08:11 +00:00
Felipe Pena
0ebd2309b1 - Fixed bug #55705 (Omitting a callable typehinted argument causes a segfault)
patch by: laruence@php
2011-09-17 00:16:11 +00:00
Felipe Pena
5441cd1f0d - Fixed bug #55705 (Omitting a callable typehinted argument causes a segfault)
patch by: laruence@php
2011-09-17 00:16:11 +00:00
Pierrick Charron
495a7b34ee Fixed test bug #55713 (Christopher Jones) 2011-09-16 18:29:22 +00:00
Pierrick Charron
ee534ac62f Fixed test bug #55713 (Christopher Jones) 2011-09-16 18:29:22 +00:00
Pierrick Charron
63293044f9 Fixed test bug #55713 (Christopher Jones) 2011-09-16 18:29:22 +00:00
Dmitry Stogov
750e4e1011 Fixed bug #55578 (Segfault on implode/concat) 2011-09-14 13:18:19 +00:00
Dmitry Stogov
65cb18dd5f Fixed bug #55578 (Segfault on implode/concat) 2011-09-14 13:18:19 +00:00
Dmitry Stogov
b6173bee92 Fixed bug #55509 (segfault on x86_64 using more than 2G memory). (Laruence) 2011-09-13 07:01:46 +00:00
Dmitry Stogov
19dd70518c Fixed bug #55509 (segfault on x86_64 using more than 2G memory). (Laruence) 2011-09-13 07:01:46 +00:00
Dmitry Stogov
12864e4769 Fixed bug #55509 (segfault on x86_64 using more than 2G memory). (Laruence) 2011-09-13 07:01:46 +00:00
Hannes Magnusson
b16bb9582b Merge missing test from 5_4 2011-09-12 10:13:54 +00:00
Hannes Magnusson
a953f69ed6 Remove bogus skipif and make adjust the tests 2011-09-07 10:44:32 +00:00
Hannes Magnusson
ffe0c530af Remove bogus skipif and make adjust the tests 2011-09-07 10:44:32 +00:00
Stanislav Malyshev
38ff70ef25 Commit Gustavo's closure rebinding patch as desided by vote 2011-09-07 06:46:27 +00:00
Stanislav Malyshev
a447acdcc6 Commit Gustavo's closure rebinding patch as desided by vote 2011-09-07 06:46:27 +00:00
Pierre Joye
f6bdb6ff61 - fix skipif 2011-09-06 15:40:12 +00:00
Pierre Joye
431db84bc9 - fix skipif 2011-09-06 15:40:12 +00:00
Pierre Joye
4e967d1bb1 - fix skipif 2011-09-06 15:40:12 +00:00
Pierre Joye
40e09c4b7a - parser version independent 2011-08-31 11:18:13 +00:00
Pierre Joye
43e8a06cac - parser version independent 2011-08-31 11:18:13 +00:00
Pierre Joye
14866642e1 - parser version independent 2011-08-31 11:16:25 +00:00
Pierre Joye
cbcb66f63a - parser version independent 2011-08-31 11:16:25 +00:00
Pierre Joye
7f231eade7 - use only the test name 2011-08-31 10:46:20 +00:00
Pierre Joye
9250c721c9 - use only the test name 2011-08-31 10:46:20 +00:00
Pierre Joye
54591710f0 - use only the test name 2011-08-31 10:43:39 +00:00
Pierre Joye
fdeb68b565 - use only the test name 2011-08-31 10:43:39 +00:00
Pierre Joye
3d74cffc20 - use only the test name 2011-08-31 10:30:39 +00:00
Pierre Joye
f15d9278eb - use only the test name 2011-08-31 10:30:39 +00:00
Pierre Joye
138bff32e7 - use only the test name 2011-08-31 10:30:39 +00:00
Pierre Joye
6181baf15a - use only test name 2011-08-31 10:22:18 +00:00
Pierre Joye
5c6e57264e - use only test name 2011-08-31 10:22:18 +00:00
Pierre Joye
3853e85a79 - make it parser version independent 2011-08-31 10:05:54 +00:00
Pierre Joye
fbb1663806 - make it parser version independent 2011-08-31 10:05:54 +00:00
Pierre Joye
b1582cdc65 - make it parser version independent 2011-08-31 10:05:54 +00:00
Stefan Marr
1f4dfded59 Fixed bug #55524 Traits should not be able to extend a class
# also used the Z_STRVAL where it seemed appropriate
2011-08-29 15:53:46 +00:00
Stefan Marr
117e072941 Fixed bug #55524 Traits should not be able to extend a class
# also used the Z_STRVAL where it seemed appropriate
2011-08-29 15:53:46 +00:00
Etienne Kneuss
cb8d6198df Fix bug #55445 (Incomplete implementation of <?= being independant of short_open_tag) 2011-08-17 23:50:04 +00:00
Etienne Kneuss
f6c2b4776c Fix bug #55445 (Incomplete implementation of <?= being independant of short_open_tag) 2011-08-17 23:50:04 +00:00
Hannes Magnusson
306c42023e Callable typehint following the rules of is_callable($arg, false); 2011-08-16 10:44:47 +00:00
Hannes Magnusson
550980cfe5 Callable typehint following the rules of is_callable($arg, false); 2011-08-16 10:44:47 +00:00
Stefan Marr
466d5414df Bug #55424 Fatal error when calling a method from a trait that is defined in parent class and required by using an abstract method in the trait.
# The method got unconditionally deleted from the class, since it was assumed that we override it, but we did not in case of abstract methods coming from a trait. Thus, dont delete when we try to merge in an abstract method.
2011-08-15 22:16:58 +00:00
Stefan Marr
4a51ea4b81 Bug #55424 Fatal error when calling a method from a trait that is defined in parent class and required by using an abstract method in the trait.
# The method got unconditionally deleted from the class, since it was assumed that we override it, but we did not in case of abstract methods coming from a trait. Thus, dont delete when we try to merge in an abstract method.
2011-08-15 22:16:58 +00:00
Stefan Marr
f4d3d6c439 Fixed Bug #55355: Inheritance chain was not regarded when checking whether the abstract method of a trait is satisfied. 2011-08-15 11:16:18 +00:00
Stefan Marr
0500cffb2e Fixed Bug #55355: Inheritance chain was not regarded when checking whether the abstract method of a trait is satisfied. 2011-08-15 11:16:18 +00:00
Stefan Marr
b14b440c93 Fixed Bug #55372 Incorrect handling of literals led to memory corruption.
# Dmitry you might want to review this patch, since I split up zend_add_literal
# and added a version for post-pass_two() usage.
2011-08-15 09:54:06 +00:00
Stefan Marr
f2ed1242d6 Fixed Bug #55372 Incorrect handling of literals led to memory corruption.
# Dmitry you might want to review this patch, since I split up zend_add_literal
# and added a version for post-pass_two() usage.
2011-08-15 09:54:06 +00:00
Derick Rethans
3ed828a892 - Fixed bug #55378: binary number literal returns float number though its value
is enough small
2011-08-07 17:36:31 +00:00
Derick Rethans
20936960b5 - Fixed bug #55378: binary number literal returns float number though its value
is enough small
2011-08-07 17:36:31 +00:00
Dmitry Stogov
0ea2ef125b Fixed bug #55339 (Segfault with allow_call_time_pass_reference = Off) 2011-08-02 07:38:23 +00:00
Dmitry Stogov
5e923d23b4 Fixed bug #55305 (ref lost: 1st ref instantiated in class def, 2nd ref made w/o instantiating) 2011-08-01 15:23:16 +00:00
Dmitry Stogov
d4a80cfa8d Fixed bug #55305 (ref lost: 1st ref instantiated in class def, 2nd ref made w/o instantiating) 2011-08-01 15:23:16 +00:00
Dmitry Stogov
ad4d6d1ce3 Added support for Class::{expr}() syntax (Pierrick) 2011-08-01 12:08:44 +00:00
Dmitry Stogov
74f68932b7 Added support for Class::{expr}() syntax (Pierrick) 2011-08-01 12:08:44 +00:00
Dmitry Stogov
b0e5d35202 Fixed bug #50816 (Using class constants in array definition fails). 2011-08-01 11:21:23 +00:00
Dmitry Stogov
2edd90100c Fixed bug #50816 (Using class constants in array definition fails). 2011-08-01 11:21:23 +00:00
Dmitry Stogov
8ff0701e8d Fixed bug #50816 (Using class constants in array definition fails). 2011-08-01 11:21:23 +00:00
Felipe Pena
9ffc8b739f - Fixed tests 2011-07-31 18:51:15 +00:00
Felipe Pena
4442b3f7a8 - Fixed tests 2011-07-31 18:51:15 +00:00
Stefan Marr
65cbcb3be9 Fixed Bug #55214 use of __CLASS__ within trait returns trait name not class name [TRAITS] [DOC] 2011-07-31 18:18:56 +00:00
Stefan Marr
88f497f27d Fixed Bug #55214 use of __CLASS__ within trait returns trait name not class name [TRAITS] [DOC] 2011-07-31 18:18:56 +00:00