Commit Graph

2012 Commits

Author SHA1 Message Date
Bob Weinand
bac6fdb0c5 Refactor zval cleanup into single function
Also use zval_ptr_dtor_nogc() everywhere in Zend in favor of zval_dtor()
2016-05-05 23:31:57 +02:00
Nikita Popov
bfef17ab65 Merge branch 'PHP-7.0'
Conflicts:
	Zend/zend_compile.c
2016-05-04 18:43:55 +02:00
Nikita Popov
9af0c96af4 Fix bug #72159 2016-05-04 18:43:11 +02:00
Joe Watkins
dc78e02ad2 Merge branch 'PHP-7.0'
* PHP-7.0:
  add compiler option to disable builtins (special case function calls)
2016-05-04 10:54:29 +01:00
Joe Watkins
9bbee305e3 add compiler option to disable builtins (special case function calls) 2016-05-04 10:53:59 +01:00
Pierrick Charron
0aed2cc2a4 Allow catching multiple exception types in a single catch statement
This commit add the possibility to catch multiple exception types in
a single catch statement to avoid code duplication.

try {
	   // Some code...
} catch (ExceptionType1 | ExceptionType2 $e) {
	   // Code to handle the exception
} catch (\Exception $e) {
	   // ...
}
2016-05-01 18:47:08 -04:00
Nikita Popov
6a9a0f2090 Merge branch 'PHP-7.0' 2016-05-01 13:05:28 +02:00
Nikita Popov
d0069ca6c1 Fix ('\bar')() in namespace 2016-05-01 13:05:14 +02:00
Dmitry Stogov
2578d08033 Fixed compilation warnings 2016-04-29 14:44:56 +03:00
Nikita Popov
4f54c15cb1 Ct bind private/final $this method call args
The test covers two edge-cases wrt opcache support.
2016-04-27 17:10:44 +02:00
Bob Weinand
261eb5cc89 Merge branch 'PHP-7.0' 2016-04-21 21:51:50 +02:00
Bob Weinand
69efeb1223 Fix constant expr coaleasce with protected mode opcache 2016-04-21 21:51:00 +02:00
Bob Weinand
ecf6392243 Merge remote-tracking branch 'origin/PHP-7.0' 2016-04-21 02:50:14 +02:00
Bob Weinand
a287c3f776 Fix magic constants (__LINE__) with ?? for constant scalar exprs
Also fix general memory leak when root ast gets replaced in compile time evaluation
2016-04-21 02:45:09 +02:00
Bob Weinand
36202ef056 Merge remote-tracking branch 'origin/PHP-7.0' 2016-04-21 01:26:48 +02:00
Márcio Almada
9f3eab44df allow null coalescing (??) on constant expressions 2016-04-21 01:22:28 +02:00
Nikita Popov
c9d8dfed60 Merge branch 'PHP-7.0' 2016-04-20 18:43:43 +02:00
Nikita Popov
77bb96d7c9 Fix bug #71737
Also improve the error message for $this used in parameters.
2016-04-20 18:38:40 +02:00
Nikita Popov
ea1f30057b Fully initialize DECLARE_CLASS/FUNCTION opcodes 2016-04-18 22:46:45 +02:00
Dmitry Stogov
b73517c1a1 Use DO_FCALL_BY_NAME instead of DO_FCALL, if possible 2016-04-14 16:07:28 +03:00
Dmitry Stogov
3444c1ae24 Use return type hints for type inference and eliminate useless VERIFY_RETRUN_TYPE opcodes. 2016-04-07 17:34:53 +03:00
Joe Watkins
bff13d90a8 Merge branch 'PHP-7.0'
* PHP-7.0:
  fix #69537: __debugInfo with empty string for key gives error
2016-04-03 12:38:53 +01:00
Joe Watkins
91c10662c8 fix #69537: __debugInfo with empty string for key gives error 2016-04-03 12:38:25 +01:00
Andrea Faulds
1e82ad8038 Warn about invalid strings in arithmetic
Squashed commit of the following:

commit e05d3b6732
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Mar 30 01:43:35 2016 +0100

    UPGRADING and NEWS

commit 6caf1d4585
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Mar 20 21:18:33 2016 +0000

    Fixes

commit 6dadb1b0ef
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 02:15:01 2016 +0000

    Add test for numeric string errors in assignment

commit bd5f04e8dd
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 23:53:05 2016 +0000

    Add test for numeric string errors

commit c72e92f16d
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 23:28:33 2016 +0000

    Add test for scientific notation in integer operations

commit d94c08852d
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 01:25:57 2016 +0000

    Disable optimiser evaluation for numeric string errors

commit 30ee954ed1
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 01:46:25 2016 +0000

    fixup

commit a6403b79e0
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 22:00:27 2016 +0000

    Do not convert error-causing numeric strings ahead-of-time

commit f9dc354014
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 19:15:38 2016 +0000

    Disable compile-time evaluation for numeric string errors

commit e05b0cc849
Author: Andrea Faulds <ajf@ajf.me>
Date:   Fri Feb 5 11:42:26 2016 +0000

    Make _zval_get_long_func_noisy function for inlining

commit 84d66321a5
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 23:10:00 2016 +0000

    Update tests

commit 5ac4a0cc4b
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 22:08:19 2016 +0000

    Use is_numeric_string_ex for zval_get_long etc.

commit c21f088485
Author: Andrea Faulds <ajf@ajf.me>
Date:   Thu Jan 7 21:13:04 2016 +0000

    Update tests

commit 63e214cf81
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Jan 6 00:28:01 2016 +0000

    Warn on non-/bad numeric strings in arithmetic
2016-03-30 01:44:27 +01:00
Bob Weinand
9600ddbd1a Merge remote-tracking branch 'origin/PHP-7.0' 2016-03-27 00:57:56 +01:00
Joe Watkins
4327370d13 fix #71414 (Interface method override inherited method and implemented in a trait causes fatal error) 2016-03-26 23:47:31 +00:00
Nikita Popov
b867bd1c8d Fix FETCH_CLASS_SELF comparisons
Turns out those don't form a bitfield.
2016-03-26 22:45:23 +01:00
Nikita Popov
8e5b139732 Evaluate arguments of new for classes without ctor
ML: http://markmail.org/message/4b3mk7jid64zvz34
2016-03-25 19:11:37 +01:00
Andrea Faulds
37c8bb5868 Allow specifying keys on list() elements
Squashed commit of the following:

commit 0361dbe356
Author: Andrea Faulds <ajf@ajf.me>
Date:   Fri Mar 25 16:59:20 2016 +0000

    UPGRADING and NEWS

commit dca9d4a36c
Author: Andrea Faulds <ajf@ajf.me>
Date:   Fri Mar 25 16:45:18 2016 +0000

    Add tests contributed by @jesseschalken

commit e557f77eab
Author: Andrea Faulds <ajf@ajf.me>
Date:   Fri Mar 25 16:44:51 2016 +0000

    Rebuild VM

commit 70942e4c3c
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Feb 24 13:12:26 2016 +0000

    Add test for evaluation order of nested list() keys

commit ed3592e80c
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Feb 24 12:42:04 2016 +0000

    Add test for evaluation order

commit 589756cbcc
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 19 17:29:34 2016 +0000

    Allow arbitrary expressions for key

commit 3f622077c3
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 19 17:45:10 2016 +0000

    Remove compile-time HANDLE_NUMERIC (see bug #63217)

commit bab758119a
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Jan 17 01:20:26 2016 +0000

    Handle numeric strings

commit 14bfe93ddc
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Jan 17 01:09:36 2016 +0000

    Allow trailing comma

commit f4c8b2cb30
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Jan 16 23:47:11 2016 +0000

    Add tests

commit 0085884a61
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Jan 16 22:24:23 2016 +0000

    Handle non-integer/string opcodes

commit e572d2d0ad
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Jan 16 21:10:33 2016 +0000

    Disallow mixing keyed and unkeyed list() elements

commit cede13ccfe
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Jan 10 20:46:44 2016 +0000

    list() with keys (no foreach or tests)
2016-03-25 17:18:42 +00:00
Dmitry Stogov
bc49f8b438 Fixed possible memory leak. 2016-03-23 00:46:48 +03:00
Nikita Popov
ac3a66cfad Merge branch 'PHP-7.0' 2016-03-21 22:50:03 +01:00
Nikita Popov
dc842bbf8d Fixed bug #71871 2016-03-21 22:49:18 +01:00
Nikita Popov
24f63b1c32 Fix broken merge 2016-03-20 01:35:51 +01:00
Xinchen Hui
93499bfd8a Fixed test & ZEND_BOOL should result TMP_VAR 2016-03-17 07:55:25 -07:00
Xinchen Hui
f2b6b26189 Merge branch 'PHP-7.0'
Conflicts:
	Zend/zend_compile.c
2016-03-17 07:51:26 -07:00
Xinchen Hui
910e6dc6b8 Fixed for master 2016-03-17 21:10:08 +08:00
Nikita Popov
64dae1ea76 Statically bind static method call arguments
If we know what method will be called, use ct-bound send opcodes.

The intl test is changed because a runtime error changed to a
compile-time error.
2016-03-14 17:50:56 +01:00
Dmitry Stogov
dc33c79a65 Evaluate ord(<string>), chr(<int>) and defined(<persistent-constant>) at compile time 2016-02-19 14:14:27 +03:00
Nikita Popov
d10911afde Simplify previous fix
I didn't notice that there already is a var with the same value.
2016-02-13 23:46:50 +01:00
Nikita Popov
502dd99a6c Fix ZEND_NEW live ranges
While the def starts at DO_FCALL, the variable should still be the
result of NEW, not DO_FCALL.

I had to fix the test for #68652, because the code started to
(correctly) free the "new self()" object, which triggered an
infinite destructor loop.
2016-02-13 19:04:54 +01:00
Nikita Popov
d1b777bd99 Merge branch 'PHP-7.0' 2016-02-12 17:58:12 +01:00
Nikita Popov
ccc06e252b Forbid yield from in by-reference generators
The current yield from implementation doesn't support by-ref
yields. It's likely not worthwhile to actually implement this,
but we should at least keep the door open for the future by
issuing a compile error.

Refs bug #71252.
2016-02-12 17:55:29 +01:00
Nikita Popov
44ed1cb5c0 Remove ZEND_CALL_CTOR_RESULT_UNUSED
Instead emit a FREE on the result of NEW.
2016-02-11 22:15:11 +01:00
Dmitry Stogov
8c2d55962e Combine conditions 2016-02-11 23:11:19 +03:00
Nikita Popov
5faedf5b3e Remove EXT_TYPE_UNUSED in favor of IS_UNUSED
This means we no longer allocate an unused VAR for the retval of
instructions that support unused results.

Nearly all instructions already used the result variable only if
it was used. The only exception to this was the return value
variable for internal function call results. I've adjusted the code
to use a stack zval for the unused return case now. As we have
retval specialization now, we know that it doesn't matter.
2016-02-11 18:02:19 +01:00
Nikita Popov
abc06b91cd Merge branch 'PHP-7.0'
Conflicts:
	Zend/zend_compile.c
2016-02-06 16:43:54 +01:00
Nikita Popov
9f82f21d01 Fix bug #71529 2016-02-06 16:43:28 +01:00
Nikita Popov
35662c9bd3 Forbid double use() and use() of param
Also commit a test I forgot to add for forbidden use() of
auto-globals.
2016-01-12 15:37:39 +01:00
Dmitry Stogov
6579e48417 Introduced BIND_STATIC opcode instead of FETCH_R/FETCH_W(static)+ASSIGN/ASSIGN_REF (similar to BIND_GLOBAL).
In the future we may refer to static variable by index instead of name, to eliminate hash lookup.
2016-01-12 12:20:35 +03:00
Xinchen Hui
9c2dde98db Merge branch 'PHP-7.0' 2016-01-07 07:05:31 -08:00