Commit Graph

1522 Commits

Author SHA1 Message Date
Xinchen Hui
0b8b264107 Test for #63336, xfail now 2012-10-23 16:35:56 +08:00
Xinchen Hui
0cce2a1e76 Merge branch 'PHP-5.4' 2012-10-23 11:35:20 +08:00
Xinchen Hui
74228c5151 Fixed bug #63305 (zend_mm_heap corrupted with traits) 2012-10-23 11:34:25 +08:00
Xinchen Hui
c018d09c33 Merge branch 'PHP-5.4' 2012-10-19 11:24:56 +08:00
Xinchen Hui
bb51549915 Merge branch 'PHP-5.3' into PHP-5.4 2012-10-19 11:24:15 +08:00
Xinchen Hui
90bd54c46e preg indenpent test script for #63055 2012-10-19 11:22:56 +08:00
Xinchen Hui
4e5e8c9da0 Merge branch 'PHP-5.4' 2012-10-10 10:45:34 +08:00
Xinchen Hui
69a4301f6c Merge branch 'PHP-5.3' into PHP-5.4 2012-10-10 10:45:07 +08:00
Xinchen Hui
1b9e0de2cc Remove executable permission on inc 2012-10-10 10:44:34 +08:00
Xinchen Hui
4b152e5470 Merge branch 'PHP-5.4' 2012-10-10 10:32:38 +08:00
Xinchen Hui
45e938ec34 Remove executable permission on phpt 2012-10-10 10:31:53 +08:00
Xinchen Hui
e081c55fb5 Merge branch 'PHP-5.3' into PHP-5.4 2012-10-10 10:31:31 +08:00
Xinchen Hui
610c7fbe7b Remove executable permission on phpt 2012-10-10 10:27:49 +08:00
Xinchen Hui
6cd6a74c5a Merge branch 'PHP-5.4' 2012-10-08 23:00:57 +08:00
Xinchen Hui
67611c67fa Fixed bug #63219 (Segfault when aliasing trait method when autoloader throws excpetion) 2012-10-08 22:59:52 +08:00
Nikita Popov
aaabac2473 Merge branch 'PHP-5.4'
Conflicts:
	Zend/zend_vm_def.h
2012-09-27 18:46:27 +02:00
Nikita Popov
592b232e83 Fix bug #63173: Crash when invoking invalid array callback
The code did not check whether the zend_hash_index_find calls succeded,
so PHP crashed when an array callback was called that contains two elements
which don't have the indices 0 and 1.
2012-09-27 18:40:00 +02:00
Nikita Popov
f28c128b20 Return previous error handler when resetting the error handler
set_error_handler(null) and set_exception_handler(null) now return the
previous error/exception handler instead of just returning bool(true).
This is consistent with the behavior of these functions with non-null
values.
2012-09-22 21:46:18 +02:00
Nikita Popov
c815dd74bc Allow resetting the error handler
This allows the error handler to be reset using set_error_handler(null).
As the code suggests this behavior was already previously intended, but
the callback check was done too strictly.
2012-09-22 21:46:02 +02:00
Nikita Popov
4954aba2ed Revert error/exception handler changes
This reverts the following two commits:

 * 6ba2e662e4
 * d8f8e98d8e

Laruence already did some partial changes to set_error_handler and
set_exception_handler. I'm reverting those modifications to apply the full
set of changes. (The modifications changed the code structure in a way that
would lead to more duplication with the new behavior.)
2012-09-22 21:41:51 +02:00
Nikita Popov
a31fa55b44 Fixed bug #63132
EG(arg_types_stack) is now also backed up when generators are used. This
allows the use of yield in nested method calls.

This commit adds two new functions to the zend_ptr_stack API:

    zend_ptr_stack_push_from_memory
    zend_ptr_stack_pop_into_memory

both taking the following arguments:

    zend_ptr_stack *stack, int count, void **pointers
2012-09-22 19:15:53 +02:00
Dmitry Stogov
274cbe5238 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug #63111 (is_callable() lies for abstract static method)
  Fix folding

Conflicts:
	NEWS
2012-09-21 15:14:29 +04:00
Dmitry Stogov
ed3a2eec9c Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #63111 (is_callable() lies for abstract static method)

Conflicts:
	NEWS
2012-09-21 14:18:37 +04:00
Dmitry Stogov
4db74b7f19 Fixed bug #63111 (is_callable() lies for abstract static method) 2012-09-21 13:07:14 +04:00
Xinchen Hui
fd0b3ea663 Fixed bug #61442 (exception threw in __autoload can not be catched) 2012-09-19 19:40:59 +08:00
Dmitry Stogov
d4d82aac39 Merge branch 'PHP-5.4'
* PHP-5.4:
  - Fixed bug #61767 (Shutdown functions not called in certain error situation) - Fixed bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function)

Conflicts:
	NEWS
2012-09-06 14:03:22 +04:00
Dmitry Stogov
6ba376f552 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  - Fixed bug #61767 (Shutdown functions not called in certain error situation) - Fixed bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function)

Conflicts:
	NEWS
	Zend/zend_object_handlers.c
2012-09-06 12:14:29 +04:00
Dmitry Stogov
b29dc146b9 - Fixed bug #61767 (Shutdown functions not called in certain error situation)
- Fixed bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function)
2012-09-06 11:26:40 +04:00
Dmitry Stogov
bceec038c8 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug #62907 (Double free when use traits)

Conflicts:
	NEWS
2012-09-05 10:01:04 +04:00
Dmitry Stogov
6c0508f8d5 Fixed bug #62907 (Double free when use traits) 2012-09-05 09:58:22 +04:00
Dmitry Stogov
72473962a9 Fixed bug #62991 (Segfault with generator and closure) 2012-09-05 09:50:55 +04:00
Nikita Popov
dffffdeb3d Fix leak when yielding array as key
The code was copy-pasted and I forgot to change OP1 to OP2 in that one
place.
2012-09-01 20:31:40 +02:00
Gustavo Lopes
53351d087d Merge branch 'generators'
* generators: (70 commits)
  Fix typos
  Fix segfault when traversing a by-ref generator twice
  Make sure that exception is thrown on rewind() after closing too
  Remove implementation stubs for yield delegation
  Fix several issues and allow rewind only at/before first yield
  Run finally if generator is closed before finishing
  Finally with return now works in generators too
  Add dedicated opcode for returns from a generator
  Disallow serialization and unserialization
  Fix zts build (typo)
  Drop Generator::close() method
  Forgot to add test
  Support trivial finally in generators (no yield, no return)
  Fix implementation of Iterator interface
  Add T_YIELD in tokenizer_data.c
  Throw error also for return occuring before yield
  Fix throwing of exceptions within a generator
  Remove reference restrictions from foreach
  Require parenthesis around yield expressions
  Add some more tests
  ...
2012-09-01 19:07:20 +02:00
Nikita Popov
bef79588d5 Fix segfault when traversing a by-ref generator twice
If you try to traverse an already closed generator an exception will now be
thrown.

Furthermore this changes the error for traversing a by-val generator by-ref
from an E_ERROR to an Exception.
2012-08-29 20:46:56 +02:00
Nikita Popov
cc07038fa9 Make sure that exception is thrown on rewind() after closing too 2012-08-29 20:31:34 +02:00
Lars Strojny
6b1073a3a7 Bug #62956: fixing private method signature validation
In inheritance, if both methods are private, don not enforce the same
signature.
2012-08-28 14:10:25 +02:00
Lars Strojny
f82dd2c774 Bug #62956: fixing private method signature validation
In inheritance, if both methods are private, don not enforce the same
signature.
2012-08-28 14:06:18 +02:00
Nikita Popov
d60e3c6ef5 Merge remote-tracking branch 'php-src/master' into addGeneratorsSupport
Conflicts:
	Zend/zend_language_parser.y
	Zend/zend_vm_execute.skl
2012-08-26 13:03:55 +02:00
Xinchen Hui
14c88ff82c Merge branch 'PHP-5.4' 2012-08-26 18:28:58 +08:00
Xinchen Hui
e24194d157 Add test for #62907 2012-08-26 18:28:15 +08:00
Xinchen Hui
5ebbdecfea Fixed bug #62930, and more tests 2012-08-26 13:05:33 +08:00
Nikita Popov
f53225a99e Fix several issues and allow rewind only at/before first yield
* Trying to resume a generator while it is already running now throws a
   fatal error.
 * Trying to use yield in finally while the generator is being force-closed
   (by GC) throws a fatal error.
 * Rewinding after the first yield now throws an Exception
2012-08-25 17:40:08 +02:00
Xinchen Hui
35951d4be0 Support list in foreach
RFC: https://wiki.php.net/rfc/foreachlist
2012-08-25 22:23:57 +08:00
Nikita Popov
4d8edda341 Run finally if generator is closed before finishing 2012-08-24 19:10:09 +02:00
Nikita Popov
7cdf6367a5 Finally with return now works in generators too 2012-08-24 13:52:16 +02:00
Nikita Popov
6517ed0215 Merge remote-tracking branch 'php-src/master' into addGeneratorsSupport
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2012-08-24 13:29:40 +02:00
Xinchen Hui
b8800d1701 Merge branch 'PHP-5.4' 2012-08-23 15:45:06 +08:00
Xinchen Hui
6d1bebfcb0 Fixed bug #62358 (Segfault when using traits a lot) 2012-08-23 15:41:49 +08:00
Felipe Pena
596e855feb Merge branch 'PHP-5.4'
* PHP-5.4:
  - Fixed bug #62892 (ReflectionClass::getTraitAliases crashes on importing trait methods as private)
2012-08-22 10:51:06 -03:00
Felipe Pena
7a56ac00a0 - Fixed bug #62892 (ReflectionClass::getTraitAliases crashes on importing trait methods as private) 2012-08-22 10:50:50 -03:00
Xinchen Hui
60a29791e4 Fixed bug that jmp in try block jmp over finally block
Refactor the implemention,  make codes clear
2012-08-22 18:32:03 +08:00
Nikita Popov
f45a0f31c8 Disallow serialization and unserialization 2012-08-20 16:01:16 +02:00
Nikita Popov
1823b16fa1 Merge remote-tracking branch 'php-src/master' into addGeneratorsSupport
Merging master to fix Windows build

Conflicts:
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
	Zend/zend_vm_def.h
2012-08-20 13:37:53 +02:00
Nikita Popov
05f10480c5 Drop Generator::close() method 2012-08-20 12:53:18 +02:00
Xinchen Hui
72b9b8f380 Make the codes clearer, and also check continue statement 2012-08-18 11:44:09 +08:00
Xinchen Hui
f2a8912e61 Refactor examing of jumping out of finally block 2012-08-18 00:16:34 +08:00
Xinchen Hui
0312d0a262 Prevents goto out of a finally block 2012-08-16 18:17:26 +08:00
Xinchen Hui
154fe7486d typo 2012-08-14 14:17:27 +08:00
Xinchen Hui
f82be0550b add test for alone try block, and update test scripts summary 2012-08-14 14:08:38 +08:00
Nikita Popov
7195a5b376 Forgot to add test 2012-08-13 19:24:44 +02:00
Nikita Popov
f4ce364628 Merge remote-tracking branch 'php-src/master' into addGeneratorsSupport
This is just an intial merge. It does not yet make generators and finally
work together.

Conflicts:
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	Zend/zend_vm_execute.skl
	Zend/zend_vm_opcodes.h
2012-08-13 16:54:53 +02:00
Xinchen Hui
80d5ae3cea Implemented 'finally' keywords for php
RFC: https://wiki.php.net/rfc/finally
FR: https://bugs.php.net/bug.php?id=32100
and I have got some improvment ideas(performance), will implemented
later. thanks
2012-08-13 21:48:39 +08:00
Xinchen Hui
253760bb6b Merge branch 'PHP-5.4' 2012-08-12 21:00:01 +08:00
Xinchen Hui
dda0565b53 Merge branch 'PHP-5.3' into PHP-5.4 2012-08-12 20:58:45 +08:00
Xinchen Hui
4970926e45 Fixed bug #62763 (register_shutdown_function and extending class) 2012-08-12 20:58:09 +08:00
Xinchen Hui
32c1c5a19f Revert "Test for bug 62328"
This reverts commit 222ab9da1a.
2012-08-12 12:02:02 +08:00
Leigh
222ab9da1a Test for bug 62328 2012-08-10 11:43:53 +01:00
Xinchen Hui
b412df1e67 Merge branch 'PHP-5.4' 2012-07-31 10:52:26 +08:00
Xinchen Hui
572d6437bc expect pass for 5.4 2012-07-31 10:51:18 +08:00
Xinchen Hui
c730329bb0 Merge branch 'PHP-5.3' into PHP-5.4 2012-07-31 10:51:04 +08:00
Xinchen Hui
645f84e41b Test for bug #62680 2012-07-31 10:49:13 +08:00
Xinchen Hui
32c05f772e Merge branch 'PHP-5.4'
* PHP-5.4:
  Skip test while zend_mm is disabled
2012-07-29 12:20:05 +08:00
Xinchen Hui
11e84180ef Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Skip test while zend_mm is disabled
2012-07-29 12:19:28 +08:00
Xinchen Hui
015ee3b2c8 Skip test while zend_mm is disabled 2012-07-29 12:17:43 +08:00
Nikita Popov
268740d984 Fix implementation of Iterator interface
It looks like you have to implement the Iterator interface *before*
assigning get_iterator. Otherwise the structure for user iterators isn't
correctly zeroed out.

Additionaly I'm setting class_entry->iterator_funcs.funcs now. Not sure if
this is strictly necessary, but better safe than sorry ;)
2012-07-26 17:13:25 +02:00
Xinchen Hui
80497ea7df Merge branch 'PHP-5.4' 2012-07-26 13:58:01 +08:00
Xinchen Hui
302ad0d648 Fix test, committed in wrong folder 2012-07-26 13:57:04 +08:00
Xinchen Hui
eae0610042 Fixed bug #62653: (unset($array[$float]) causes a crash)
the reason why jpauli and I can not reproduce is (it's silly):
I typo "USE_ZEND_ALLOC *&&* valgrind" at the first time, then I always ctrl+r
and jpauli copied my command from the pastbin :)

thanks
2012-07-26 13:53:06 +08:00
Nikita Popov
134089372b Throw error also for return occuring before yield
Previously only an error was thrown when return occured after yield. Also
returns before the first yield would fail for by-ref generators.

Now the error message is handled in pass_two, so all returns are checked.
2012-07-22 20:11:09 +02:00
Nikita Popov
94b2ccae9c Fix throwing of exceptions within a generator
If a generator threw an exception and was iterated using foreach (i.e. not
manually) an infinite loop was triggered. The reason was that the exception
was not properly rethrown using zend_throw_exception_internal.
2012-07-22 17:46:46 +02:00
Nikita Popov
de80e3ce4b Remove reference restrictions from foreach
foreach only allowed variables to be traversed by reference. This never
really made sense because

    a) Expressions like array(&$a, &$b) can be meaningfully iterated by-ref
    b) Function calls can return by-ref (so they can also be meaningfully
       iterated)
    c) Iterators could at least in theory also be iterated by-ref (not
       sure if any iterator makes use of this)

With by-ref generators the restriction makes even less sense, so I removed
it altogether.
2012-07-22 14:33:25 +02:00
Nikita Popov
80748631aa Require parenthesis around yield expressions
If yield is used in an expression context parenthesis are now required.
This ensures that the code is unambiguos.

Yield statements can still be used without parenthesis (which should be
the most common case).

Also yield expressions without value can be used without parenthesis,
too (this should be the most common case for coroutines).

If the yield expression is used in a context where parenthesis are required
anyway, no additional parenthesis have to be inserted.

Examples:

    // Statements don't need parenthesis
    yield $foo;
    yield $foo => $bar;

    // Yield without value doesn't need parenthesis either
    $data = yield;

    // Parentheses don't have to be duplicated
    foo(yield $bar);
    if (yield $bar) { ... }

    // But we have to use parentheses here
    $foo = (yield $bar);

This commit also fixes an issue with by-ref passing of $foo[0] like
variables. They previously weren't properly fetched for write.

Additionally this fixes valgrind warnings which were caused by access to
uninitialized memory in zend_is_function_or_method_call().
2012-07-22 01:22:22 +02:00
Nikita Popov
1f70a4c5fe Add some more tests 2012-07-20 17:40:04 +02:00
Nikita Popov
c9709bfbd7 Remove asterix modifier (*) for generators
Generators are now automatically detected by the presence of a `yield`
expression in their body.

This removes the ZEND_SUSPEND_AND_RETURN_GENERATOR opcode. Instead
additional checks for ZEND_ACC_GENERATOR are added to the fcall_common
helper and zend_call_function.

This also adds a new function zend_generator_create_zval, which handles
the actual creation of the generator zval from an op array.

I feel like I should deglobalize the zend_create_execute_data_from_op_array
code a bit. It currently changes EG(current_execute_data) and
EG(opline_ptr) which is somewhat confusing (given the name).
2012-07-20 16:09:06 +02:00
Nikita Popov
85f077cea1 Add support by yielding by-reference 2012-07-17 13:29:56 +02:00
Stanislav Malyshev
bd340b7296 add NEWS/UPGRADING 2012-07-14 15:03:51 -07:00
Stanislav Malyshev
c164e6b5a3 add test 2012-07-14 14:50:50 -07:00
Stanislav Malyshev
a3322f8927 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed the common misspelling of the word occurred (occured -> occurred)
2012-06-30 17:00:25 -07:00
Marc Easen
896ac689c9 Fixed the common misspelling of the word occurred (occured -> occurred) 2012-06-30 16:54:03 -07:00
Nikita Popov
5a9bddba66 Forgot to git add two tests 2012-06-25 21:41:50 +02:00
Nikita Popov
d939d2dee5 Add sceleton for yield* expression
This does not yet actually implement any delegation.
2012-06-19 00:37:31 +02:00
Nikita Popov
f169b26dd7 Fix backtraces and func_get_args()
To make the generator function show up in backtraces one has to insert an
additional execute_data into the chain, as prev_execute_data->function_state
is used to determine the called function.

Adding the additional stack frame is also required for func_get_args(), as
the arguments are fetched from there too. The arguments have to be copied
in order to keep them around. Due to the way they are saved doing so is
quite ugly, so I added another function zend_copy_arguments to zend_execute.c
which handles this.
2012-06-09 00:40:47 +02:00
Nikita Popov
40760ecb90 Fix cloning of generator methods
Forgot to add a reference to the this variable
2012-06-05 14:00:31 +02:00
Nikita Popov
bf82f46ea9 Properly handle yield during method calls 2012-06-03 02:16:29 +02:00
Nikita Popov
7b3bfa5784 Improve backtraces from generators
The current situation is still not perfect, as the generator function itself
does not appear in the stack trace. This makes sense in some way, but it
would probably be more helpful if it would show up (with the bound arguments)
after the $generator->xyz() call. This could be misleading too though as the
function is not *really* called there.
2012-06-03 02:00:11 +02:00
Nikita Popov
6117f4c7c0 Add cloning support for generators
Generators can now be cloned. I'm pretty sure that my current code does not
yet cover all the edge cases of cloning the execution context, so there are
probably a few bugs in there :)
2012-06-02 20:40:58 +02:00
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
Stefan Marr
0158804a15 Added __TRAIT__ magic constant [TRAITS] [DOC]
# __TRAIT__ behaves like __CLASS__ more or less but is constraint to traits.
# Since traits are not types, there are not many valid use cases, and trying
# to use __TRAIT__ to make traits more like classes is discouraged.
2011-07-31 17:39:30 +00:00
Stefan Marr
dbc6849bca Added __TRAIT__ magic constant [TRAITS] [DOC]
# __TRAIT__ behaves like __CLASS__ more or less but is constraint to traits.
# Since traits are not types, there are not many valid use cases, and trying
# to use __TRAIT__ to make traits more like classes is discouraged.
2011-07-31 17:39:30 +00:00
Stefan Marr
858164624d Fixed test which was assuming that E_STRICT is not on by default. 2011-07-31 16:15:40 +00:00
Stefan Marr
70aad763e9 Fixed test which was assuming that E_STRICT is not on by default. 2011-07-31 16:15:40 +00:00