Commit Graph

1976 Commits

Author SHA1 Message Date
Nikita Popov
e1cb22a23e Fix bug #69599 2015-05-12 15:08:12 +02:00
Aaron Piotrowski
071111ecfc Add support for $callable() sytnax with 'Class::method'
Using the $callable() syntax when used with a string of
the form 'Class::method' would error as an undefined
function, even if the string passed is_callable() or the
callable type-hint. The fix adds support for the $callable()
syntax for any string accepted by is_callable() or the
callable type-hint.

Fix bug 68475 test with deprecated notice

Reduced scope of unit test.

Added tests with arguments.
2015-05-12 13:33:28 +02:00
Julien Pauli
0b22cf04e3 Fixed tests 2015-05-12 11:18:35 +02:00
Stanislav Malyshev
ef8bb69a14 Ban rebinding closures to different internal classes 2015-05-12 10:54:59 +02:00
Nikita Popov
8f9f21e8d2 Fix static closure error in call_user_func opcode
I'm assuming this is the only error that is_callable() can generate
with retval=1.

This problem manifested after making closures in static methods
not implicitly static, but would also occur when binding any non-static
closure to a scope without a $this.
2015-05-08 15:17:15 +02:00
Nikita Popov
6ef8ae65a2 Allow self etc in eval / file scope
This fixes a regression from 16a9bc1ec2.
Together with the recent closure related changes this should allow
all usages of self etc, while previously (in PHP 5) some things like
self::class did not work.
2015-05-07 15:38:16 +02:00
Dmitry Stogov
2a9f9860d7 Fixed bug #69534 (Cycle leaks through declared properties on internal classes) 2015-05-06 21:33:49 +03:00
Nikita Popov
ab97606b8a Fix compiler assumptions about self/etc wrt closures
* Don't throw an error if self/parent/static are used in a closure
  (outside a class).
* Don't propagate self:: constants into closures
* Use runtime fetch for self::class in closures

Fixes bug #66811.
2015-05-06 18:13:19 +02:00
Nikita Popov
bc2ff4a299 Don't implicitly make closures in static methods static
It makes no sense that you can't write a closure using $this in a
static method, even though you can write one outside a class.

Now only closures that have been marked as static will be considered
to be static.

Fixes bug #65598.
2015-05-06 17:29:05 +02:00
Nikita Popov
d9c2959c27 Fix LSB handling for closures
Closures will now use the called_scope from their instantiation
site. If they are rebound either the class of $this is used or if
no $this is provided the bound scope is used.

With this change the scope for static closures can be changed back
to use EG(scope) rather than EX(called_scope), thus fixing
bug #69568.
2015-05-05 21:14:03 +02:00
Márcio Almada
a54e1237ec add tests for semi reserved words and remove obsolete ones 2015-04-30 03:03:29 -03:00
Nikita Popov
16a9bc1ec2 Disallow self etc outside classes at compile-time
Also fix a bug with return types where "self" was rejected inside
a class, but not on a method.

Fallout: A couple of tests changed to more generic error messages.
2015-04-29 20:51:08 +02:00
Nikita Popov
8361893444 Fix implementing_class handling 2015-04-26 16:03:58 +02:00
krakjoe
49608e0608 Rebase Joe's anon classes implementation 2015-04-26 15:04:22 +02:00
Nikita Popov
75b4fa079f Fix bug #69532
Partial revert of ea2fc7f935.
2015-04-25 18:47:26 +02:00
Dmitry Stogov
fc80305e48 Cleanup comments and add related tests. 2015-04-23 17:52:05 +03:00
Nikita Popov
62aabf5d9f Fix "invalid opcode" error
Method call can happen on CONST, it'll just throw an error.

Not forbidding this at compile-time, so this can be overridden in
an extension.
2015-04-22 17:46:25 +02:00
Bob Weinand
4376373da3 Fix yield from with iterator (first element missing) 2015-04-21 19:42:23 +02:00
Nikita Popov
d2607a0110 Move more stuff to file_context
Introduce helper macro FC(x) for CG(file_context).x.

end_compilation() now handled by file_context_end().

While at it, dropped zval wrapper for ticcks.
2015-04-21 17:39:07 +02:00
Xinchen Hui
a090977419 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_compile.c
2015-04-21 22:39:46 +08:00
Xinchen Hui
9d9ba493a2 Merge branch 'PHP-5.5' into PHP-5.6 2015-04-21 22:37:00 +08:00
Xinchen Hui
c667c26f61 Fixed Bug #69467 (Wrong checked for the interface by using Trait) 2015-04-21 22:36:32 +08:00
Xinchen Hui
8362aebdbf Fixed mem leak in assign_to_obj with reference 2015-04-21 21:04:20 +08:00
Dmitry Stogov
736b7cf419 Added test 2015-04-17 18:45:46 +03:00
Nikita Popov
5c214fc10d Add test for recursive __debugInfo()
This also got fixed by switching to object apply count.
2015-04-15 22:38:50 +02:00
Bob Weinand
3dcad2eea2 Fix bug #69458 2015-04-15 21:56:11 +02:00
Nikita Popov
acd61be985 Add "yield from" support to ast pretty printer 2015-04-14 19:15:40 +02:00
Dmitry Stogov
00445ba22d Fixed bug #69446 (GC leak relating to removal of nested data after dtors run) 2015-04-14 19:53:56 +03:00
Bob Weinand
f3e124d58d Merge branch 'coroutineDelegation' of https://github.com/bwoebi/php-src 2015-04-14 17:58:58 +02:00
Nikita Popov
a7059f1eac Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2015-04-14 16:38:09 +02:00
Nikita Popov
ed7e6d4758 Merge branch 'PHP-5.5' into PHP-5.6 2015-04-14 16:36:36 +02:00
Nikita Popov
95650d0942 Fixed bug #69419 2015-04-14 16:35:23 +02:00
Dmitry Stogov
65baab7741 Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #63336 is not a bug
  fix test

Conflicts:
	Zend/tests/bug63336.phpt
2015-04-14 17:18:55 +03:00
Dmitry Stogov
e8fb5201ba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Bug #63336 is not a bug
2015-04-14 17:16:57 +03:00
Dmitry Stogov
dc024f0bdc Bug #63336 is not a bug 2015-04-14 17:15:50 +03:00
Dmitry Stogov
9806a62545 GC improved to support inner-cycles. 2015-04-14 00:16:27 +03:00
Xinchen Hui
cefad04f0d Fixed bug #69427 (Segfault on magic method __call of private method in superclass) 2015-04-11 23:57:42 +08:00
Dmitry Stogov
5e8133f453 Squashed commit of the following:
commit 2399fc84c5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 12:38:08 2015 +0300

    Removed useless assignment

commit 796b633817
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 12:35:31 2015 +0300

    Fixed execution with overriden zend_execute_ex()

commit 4a9fb125aa
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 02:02:58 2015 +0300

    Fixed executor without global registers

commit d456c30e00
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 01:30:35 2015 +0300

    Restored original behavior for tests/classes/__call_004.phpt

commit 479646d37f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 00:32:17 2015 +0300

    Fixed test. We don't keep stack frame for fake function anymore.

commit 9ae61e33e2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 00:30:09 2015 +0300

    Use ZEND_ACC_CALL_VIA_TRAMPOLINE instead of ZEND_ACC_CALL_VIA_HANDLER. Keep ZEND_ACC_CALL_VIA_HANDLER for compatibility.

commit 0a8403a2a0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Apr 10 00:05:43 2015 +0300

    Rename PROXY_CALL into CALL_TRAMPLINE.
    Generalize API to allow reuse EG(trampline) for other purposes.

commit 4ea0525c10
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 23:22:25 2015 +0300

    Reuse EG(proxy_call_op) for all proxy. Move proxy related functions from zend_objects_API to zend_object_handlers.

commit 529bf737ca
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 21:42:23 2015 +0300

    Accurate use of proxy_call

commit 5d62837d5b
Merge: 83e749f 690843f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 19:40:00 2015 +0300

    Merge branch 'master' into opcodefy-call

    * master:
      Fixed GOTO executor
      Fixed typo
      Changed ArrayIterator implementation using zend_hash_iterator_... API. Allowed modification of itterated ArrayObject using the same behavior as proposed in `Fix "foreach" behavior`. Removed "Array was modified outside object and internal position is no longer valid" hack.

commit 83e749ff3b
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 19:39:10 2015 +0300

    Improved ZEND_PROXY_CALL

commit 0c829afc53
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 15:14:49 2015 +0300

    Reverted white-space changes

commit df65144488
Merge: 5fd2f97 97756d9
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Apr 9 14:37:07 2015 +0300

    Merge branch 'opcodefy-call' of github.com:laruence/php-src into opcodefy-call

    * 'opcodefy-call' of github.com:laruence/php-src:
      Ready for PR
      Fixed static call
      Improve performance by using prealloated op_arrray
      Respect called_scope
      Support internal magical __call/__callStatic
      opcode-fy magical __callStatic
      Opcode-fy magical __call

commit 97756d9190
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 19:07:59 2015 +0800

    Ready for PR

commit 74f9930846
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 19:03:00 2015 +0800

    Fixed static call

commit ec1d9eb592
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 18:23:17 2015 +0800

    Improve performance by using prealloated op_arrray

commit df7fbbf949
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 15:10:02 2015 +0800

    Respect called_scope

commit 769d1d59fb
Author: Xinchen Hui <laruence@gmail.com>
Date:   Thu Apr 9 12:19:23 2015 +0800

    Support internal magical __call/__callStatic

commit a980fedd5b
Author: Xinchen Hui <laruence@gmail.com>
Date:   Wed Apr 8 18:35:41 2015 +0800

    opcode-fy magical __callStatic

commit 73855f7d53
Author: Xinchen Hui <laruence@gmail.com>
Date:   Wed Apr 8 14:21:55 2015 +0800

    Opcode-fy magical __call
2015-04-10 23:01:00 +03:00
Xinchen Hui
c5903e79be Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_compile.c
2015-04-10 22:50:15 +08:00
Xinchen Hui
fa0608077b Merge branch 'PHP-5.5' into PHP-5.6 2015-04-10 22:48:36 +08:00
Xinchen Hui
429f411eb3 Fixed bug #69420 (Invalid read in zend_std_get_method) 2015-04-10 22:47:06 +08:00
Dmitry Stogov
e1d6b24da8 Addef test for bug #63734 (Garbage collector can free zvals that are still referenced) 2015-04-08 22:18:10 +03:00
Dmitry Stogov
91e84bb168 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #67314 (Segmentation fault in gc_remove_zval_from_buffer)

Conflicts:
	NEWS
	Zend/zend_execute_API.c
2015-04-08 21:26:45 +03:00
Dmitry Stogov
1f5f78d4aa Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #67314 (Segmentation fault in gc_remove_zval_from_buffer)
  Fixed bug #67314 (Segmentation fault in gc_remove_zval_from_buffer)
2015-04-08 21:24:24 +03:00
Dmitry Stogov
174b9ee634 Fixed bug #67314 (Segmentation fault in gc_remove_zval_from_buffer) 2015-04-08 21:20:35 +03:00
Dmitry Stogov
4d9a1883aa Fixed bug #68887 (resources are not freed correctly) 2015-04-08 13:29:42 +03:00
Dmitry Stogov
55cdde3dd6 Fixed bug #69376 (Wrong ref counting). 2015-04-07 02:35:52 +03:00
Nikita Popov
f53e20e595 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_language_parser.y
2015-04-06 22:09:22 +02:00
Nikita Popov
7e9a1c1e3f Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	Zend/zend_compile.c
	Zend/zend_compile.h
2015-04-06 22:06:48 +02:00
Nikita Popov
cc70a46525 Fix bug #60022 2015-04-06 22:03:04 +02:00
Dmitry Stogov
9a57379024 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #68652 (segmentation fault in destructor)

Conflicts:
	NEWS
2015-04-06 18:19:07 +03:00
Dmitry Stogov
812106d0c6 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68652 (segmentation fault in destructor)

Conflicts:
	NEWS
2015-04-06 18:16:08 +03:00
Dmitry Stogov
21bb33cc72 Fixed bug #68652 (segmentation fault in destructor) 2015-04-06 18:11:41 +03:00
Dmitry Stogov
cae0147ed3 Fixed weird operators behavior. Division by zero now emits warning and returns +/-INF, modulo by zero and intdid() throws an exception, shifts by negative offset throw exceptions. Compile-time evaluation of division by zero is disabled. 2015-04-06 14:30:05 +03:00
Dmitry Stogov
dcaa79546b Don't relay on reference-counter when parameter expected to be a reference, but value given. 2015-04-03 16:35:06 +03:00
Nikita Popov
a8bf1c5d8f Throw ParseException from lexer
Primarily to avoid getting fatal errors from token_get_all().

Implemented using a magic E_ERROR token, which the lexer emits to
force a parser failure.
2015-04-02 16:31:17 +02:00
Ferenc Kovacs
0295d89d45 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix typo: unitialized -> uninitialized
2015-04-01 18:06:12 +02:00
Ferenc Kovacs
978128b446 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix typo: unitialized -> uninitialized
2015-04-01 18:05:57 +02:00
Lior Kaplan
87cc7caa10 Fix typo: unitialized -> uninitialized 2015-04-01 18:19:09 +03:00
Dmitry Stogov
780a8123fe Convert fatal errors into EngineExceptions 2015-04-01 16:48:15 +03:00
Dmitry Stogov
0cad725886 Convert fatal errors into EngineExceptions 2015-04-01 15:54:03 +03:00
Dmitry Stogov
8c031a3f95 Handle incorrect break/continue statements at compile-time 2015-04-01 15:52:26 +03:00
Dmitry Stogov
4fd93a4da6 Converted fatal errors into EngineExceptions 2015-04-01 14:50:09 +03:00
Dmitry Stogov
18f3d5490a Convert fatal error into EngineException 2015-04-01 13:49:11 +03:00
Nikita Popov
085774997b Drop support for static calls from incompatible context
Implemented by NULLing $this.
2015-04-01 11:42:05 +02:00
Nikita Popov
8d00385871 Reclassify E_STRICT notices
Per RFC https://wiki.php.net/rfc/reclassify_e_strict

While reviewing this, found that there are still three E_STRICTs
left in libraries - need to discuss those.
2015-04-01 11:17:55 +02:00
Xinchen Hui
ed772e1a99 Fixed test 2015-04-01 09:56:55 +08:00
Dmitry Stogov
2bf8f29d16 Converted most object handlers fatal errors into EngineExceptions 2015-04-01 00:37:59 +03:00
Nikita Popov
6ef9216269 Finish PHP 4 constructor deprecation 2015-03-31 17:55:27 +02:00
Andrea Faulds
db76b708cf Deprecate PHP 4 constructors 2015-03-31 17:55:27 +02:00
Dmitry Stogov
685ab95add Convert fatal errors on improper access to static properties into EngineExceptions 2015-03-31 16:35:27 +03:00
Dmitry Stogov
e8672deefc Convert "Unsupported operands" fatal error into EngineException (exceptions can't be thrown at compile-time yet, so unsuported operands in constant expressions are still lead to fatal error). 2015-03-31 13:25:26 +03:00
Nikita Popov
53a40386bc Implement additional type reservations
* The class names false, true and null are now reserved.
 * The code dealing with reserved class names is now decoupled
   from scalar type hint handling. It also includes self, parent,
   and static, which are class names which were already reserved
   previously.
 * Reuse existing messages for reserved class names.

Fallout: class_alias() can no longer alias self, parent and static.
However this never really worked in the first place, as the test
which was testing this shows.
2015-03-30 22:59:06 +02:00
Xinchen Hui
5c31c8c6e5 Fixed is_callable/function_exists with disable_functions 2015-03-28 17:07:11 +08:00
Xinchen Hui
e60b380c55 Merge branch 'bug69315' of https://github.com/laruence/php-src 2015-03-28 14:10:41 +08:00
Nikita Popov
c64f5e3332 Disallow direct incdec of function return value
Matching PHP 5 behavior.

We may want to support this for by-reference returns, but that
requires implementing further checks.
2015-03-27 16:40:04 +01:00
Xinchen Hui
84d9426730 Fixed bug #69315 2015-03-27 17:50:36 +08:00
Kalle Sommer Nielsen
1c5994184f Added tests for the naming collision error message to handle all possible conditions 2015-03-26 01:59:23 +01:00
Kalle Sommer Nielsen
67b907f059 Change the error message for colliding class/interface/trait names to be a little more clearer.
C:\> php -r "interface stdClass { }"
  Error: Cannot declare interface stdClass, because the name is already in use in Command Line Code on line 1
2015-03-26 01:44:23 +01:00
Kalle Sommer Nielsen
927d53fda4 Change "Cannot redeclare class X" into "Cannot redeclare class/interface/trait X", meaning that the following:
C:\> php -r "trait A { } trait A { }"

Will now properly print "Cannot redeclare trait A" instead of "Cannot redeclare class A" to make error messages a tiny bit clearer. Admittedly, a better solution can most likely be made by actually telling what the colliding object is a type of.

Internally this adds a new function:
 zend_get_object_type()
2015-03-25 06:31:11 +01:00
Anatol Belski
62b51668e2 ensure the test uses correct SAPI 2015-03-24 22:02:28 +01:00
Nikita Popov
d659ee24ab Fix VERIFY_RETURN separation
a) The SAME_FAKE_TYPE check should always occur on the dereferenced
value, otherwise we'll end up separating large referenced arrays.
b) For by-val return with an rc=1 reference, the SEPARATE_ZVAL
wouldn't do anything. Add a ZVAL_UNREF for this case.

I don't like this fix - there must be some better way to express
this.
2015-03-24 10:51:28 +01:00
Nikita Popov
a34f81deee Allow adding return type during inheritance
This is allowed as per the return types RFC. The test for this
behavior happened to use an internal class without arginfo, which
is why this was not properly implemented.
2015-03-22 18:56:14 +01:00
Dmitry Stogov
3a886a0c90 Changed SKIPIF messages 2015-03-20 23:19:51 +03:00
Dmitry Stogov
139c6c644c Fixed tests 2015-03-20 17:56:32 +03:00
Dmitry Stogov
44669e8f41 Fixed white spaces 2015-03-20 11:10:29 +03:00
Dmitry Stogov
aee2985f35 Merge branch 'scalar_type_hints_v5' of github.com:ircmaxell/php-src into scalar_type_hints_v5
* 'scalar_type_hints_v5' of github.com:ircmaxell/php-src: (54 commits)
  Add check for maintaining reference all the way through both type and return values
  Reduce the number of times that the zval needs to be separated in return type checking to those that are necessary
  Add test to ensure namespaced code can't use scalar types as class names
  Disallow relative namespace type declarations
  Add support and tests for null constant default values. Refactor complex conditionals into an extracted function for clarity and code-reuse
  Refactor as to not use call info, but add the flag to the op_array.
  Fix severity issues with callbacks, start work porting ZEND_STRLEN opcode to work with strict mode, more refactoring to come
  Fix C89 compatibility by moving a misplaced if statement
  Refactor gotos into more elaborate ifs to eliminate goto failure
  Fix return type separation with references. It now includes a check in the opcode handler and properly separates the value in both cases
  Add error case with invalid type declaration default value
  Add tests for using constants as defaults with scalar type declarations
  Refactor error messages to only append defined in the event of rendering as a fatal error. Fix relative typehints to not work
  Revert gd and mysqli to former calls for arg count errors. Fix first identified issues with zend_compile.c from nikic. Add tests for generator returns prior to first yield
  Style cleanup, as well as fixing bug with missing argument for WRONG_PARAM_COUNT_WITH_RETVAL
  Clean up API renames for zend_wrong_param_count to maintain BC, introducing a zend_wrong_param_count_ex() function when you know strict value
  Fix executor issue with ignoring strict types, which cleans up a bunch of errors. Additionally fix the expected error of 2 unrelated tests that was caused by a change to the core error messages
  Fix more tests, improve error messages in failure output for thrown exception
  Refactor error implementation significantly to centralize error mode behavior. Add zend_internal_type_error() function
  Refactor declare placement detection, allow encoding declares before type declares
  ...
2015-03-20 10:51:41 +03:00
Anthony Ferrara
8c76c331a5 Add check for maintaining reference all the way through both type and return values 2015-03-19 17:51:19 -04:00
Anthony Ferrara
c11cab3255 Add test to ensure namespaced code can't use scalar types as class names 2015-03-19 14:11:48 -04:00
Anthony Ferrara
aaf0c8b594 Disallow relative namespace type declarations 2015-03-19 14:07:03 -04:00
Anthony Ferrara
62fc556764 Add support and tests for null constant default values. Refactor complex conditionals into an extracted function for clarity and code-reuse 2015-03-19 13:51:24 -04:00
Anthony Ferrara
0ef80ac351 Fix severity issues with callbacks, start work porting ZEND_STRLEN opcode to work with strict mode, more refactoring to come 2015-03-19 12:26:34 -04:00
Anthony Ferrara
427ecdc5eb Fix return type separation with references. It now includes a check in the opcode handler and properly separates the value in both cases 2015-03-18 18:10:08 -04:00
Bob Weinand
dac2b060e4 Remove bogus ZEND_ASSERT(hash != 0)
There's always a possibility that the has will end up as equal to zero due to overflowing.
See the tests for strings whose hash overflow.
Yes, there's a check for whether the hash already was calculated... and strings with a hash equal to zero always need the hash recalculated, in one of 2^32 respectively 2^64 cases - which should not be a major issue.
2015-03-18 22:25:55 +01:00
Anthony Ferrara
f040538448 Add error case with invalid type declaration default value 2015-03-18 16:53:45 -04:00
Anthony Ferrara
94fe6c42fa Add tests for using constants as defaults with scalar type declarations 2015-03-18 16:50:51 -04:00
Anthony Ferrara
724f7118f1 Refactor error messages to only append defined in the event of rendering as a fatal error. Fix relative typehints to not work 2015-03-18 16:38:51 -04:00
Anthony Ferrara
1df033c5cd Revert gd and mysqli to former calls for arg count errors. Fix first identified issues with zend_compile.c from nikic. Add tests for generator returns prior to first yield 2015-03-18 16:14:02 -04:00
Anthony Ferrara
0529eeb4a6 Fix executor issue with ignoring strict types, which cleans up a bunch of errors. Additionally fix the expected error of 2 unrelated tests that was caused by a change to the core error messages 2015-03-18 15:22:21 -04:00
Anthony Ferrara
dd9f4f9585 Fix more tests, improve error messages in failure output for thrown exception 2015-03-18 12:42:09 -04:00
Anthony Ferrara
7feebead1b Refactor error implementation significantly to centralize error mode behavior. Add zend_internal_type_error() function 2015-03-18 12:23:09 -04:00
Anthony Ferrara
d22bfb8aa6 Merge in master, fix merge conflicts and update patch to support exceptions everywhere 2015-03-18 10:50:11 -04:00
Anatol Belski
87767d9ea1 adedd test for bug #68797 2015-03-17 22:11:28 +01:00
Nikita Popov
5c230baf75 Implement Generator::getReturn()
Conflicts:
	Zend/zend_vm_execute.h
2015-03-17 21:51:53 +01:00
Nikita Popov
f1a6c06f14 Support ParseException for require etc 2015-03-17 21:35:42 +01:00
Nikita Popov
3cd6a9845d Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_generators.c
	Zend/zend_generators.h
2015-03-13 16:29:39 +01:00
Nikita Popov
4b930e156f Merge branch 'PHP-5.5' into PHP-5.6 2015-03-13 16:25:21 +01:00
Nikita Popov
a9d73f0646 Fixed bug #69221
A generator iterator can be created from different zvals - use
the object handle to manage references instead.
2015-03-13 16:23:53 +01:00
Xinchen Hui
75c0f63739 Fixed memory leak 2015-03-11 10:33:43 +08:00
Xinchen Hui
253420190b Merge branch 'PHP-5.6' 2015-03-11 08:20:19 +08:00
Xinchen Hui
d4f727d0f8 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-11 08:20:03 +08:00
Xinchen Hui
675606f1a6 Improve test script for #69212 2015-03-11 08:19:34 +08:00
Dmitry Stogov
ed9c8a23ba More accurate reference counting on closures 2015-03-10 23:04:41 +03:00
Nikita Popov
00985a975d Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2015-03-10 18:26:09 +01:00
Nikita Popov
49bd45a2c1 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-10 18:19:27 +01:00
Nikita Popov
bc9f2fb8df Fixed bug #69212 2015-03-10 18:17:56 +01:00
Anatol Belski
fd0a66528e correct tests as the issue is only reproduceable with cgi/fpm 2015-03-10 10:21:22 +01:00
Xinchen Hui
d4c1dca98c Merge branch 'master' of https://git.php.net/repository/php-src 2015-03-10 17:09:41 +08:00
Xinchen Hui
7df8a68327 Merge branch 'PHP-5.6' 2015-03-10 17:09:28 +08:00
Xinchen Hui
b5589d3fb4 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-10 17:06:05 +08:00
Xinchen Hui
6f4af2da29 Fixed test 2015-03-10 17:05:47 +08:00
Anatol Belski
388c4e7436 added more exception tests 2015-03-10 09:10:25 +01:00
Xinchen Hui
a5317e9d41 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2015-03-10 15:49:02 +08:00
Xinchen Hui
abb09693ac Merge branch 'PHP-5.5' into PHP-5.6 2015-03-10 15:37:14 +08:00
Xinchen Hui
6a6c273893 Fixed bug #66609 (php crashes with __get() and ++ operator in some cases) 2015-03-10 15:36:42 +08:00
Dmitry Stogov
a30d328671 Errors converted to exceptions are not "recoverable" anymore. 2015-03-10 10:31:55 +03:00
Dmitry Stogov
1c94ff0595 Implement engine exceptions
RFC: https://wiki.php.net/rfc/engine_exceptions_for_php7

Pending changes regarding naming of BaseException and whether it
should be an interface.
2015-03-09 14:01:32 +01:00
Stanislav Malyshev
6adac79a73 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add missing value for error_reporting directive
2015-03-08 17:05:59 -07:00
Stanislav Malyshev
b0d1e23646 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add missing value for error_reporting directive
2015-03-08 17:05:51 -07:00
Stanislav Malyshev
d7931f8f66 Merge branch 'pull-request/1130' into PHP-5.5
* pull-request/1130:
  Add missing value for error_reporting directive
2015-03-08 17:05:37 -07:00
Xinchen Hui
caa306f6e3 Merge branch 'batch-use' of https://github.com/marcioAlmada/php-src 2015-03-08 23:54:46 +08:00
Márcio Almada
22d6cc7c8c fix compilation warnings, rename batch_use to group_use 2015-03-08 12:50:57 -03:00
Xinchen Hui
5aebdc98de Fixed bug #69201 (Memory leak using iterator and get by reference on PHP 7) 2015-03-08 20:22:02 +08:00
Márcio Almada
072d1dad15 add explicit tests for variations on whitespace usages 2015-03-07 17:59:48 -03:00
Márcio Almada
344fc25b12 require trailing T_NS_SEPARATOR #1005 2015-03-07 17:59:48 -03:00
Márcio Almada
52b20b0b46 fix test ns_092.phpt 2015-03-07 17:59:48 -03:00
Márcio Almada
e9f82abd61 add test for non mixed batch use statements... #1005
```
use function foo\math {sin, cos, sum};
use const foo\math { PI, E, GAMMA, GOLDEN_RATIO }
```
2015-03-07 17:59:48 -03:00
Márcio Almada
4485056a31 ensure that comments are allowed between batch use declarations #1005 2015-03-07 17:59:48 -03:00
Márcio Almada
95abd5c5a4 simplify batch use declaration syntax error test: ns_088.phpt 2015-03-07 17:59:48 -03:00
Márcio Almada
bb171e2edc add tests for batch use declarations with classes, functions and constants 2015-03-07 17:59:48 -03:00
Bob Weinand
b1cd381f01 Added test for bug #69160 (current behavior is correct) 2015-03-07 20:59:42 +01:00
Bob Weinand
b4a142ab97 Added yield from operator 2015-03-07 00:28:12 +01:00
Xinchen Hui
f2c8b611cf Merge branch 'PHP-5.6' 2015-03-05 18:44:13 +08:00
Xinchen Hui
168be6f250 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-05 18:40:06 +08:00
Xinchen Hui
f039225597 Fixed bug #69174 (leaks when unused inner class use traits precedence) 2015-03-05 18:39:50 +08:00
Dmitry Stogov
ff039c3c6d Merge commit 'refs/pull/1066/head' of git://github.com/php/php-src
* git://github.com/php/php-src:
  Add zend assert deleted by accident
  Let's keep it simple
  Improve internal function return types checking for parent
2015-03-04 18:17:06 +03:00
Xinchen Hui
6b8d5b01bc Add test for previously fixed segfault 2015-03-04 18:26:58 +08:00
Xinchen Hui
7ad6711a4d Fixed bug #69167 (call_user_func does not support references anymore) 2015-03-03 18:11:56 +08:00
Dmitry Stogov
9a20323e19 Improved assert() according to expectations RFC.
See https://wiki.php.net/rfc/expectations

Squashed commit of the following:

commit 3f3651a787
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Mar 2 11:56:33 2015 +0300

    opcode 137 is used for ZEND_OP_DATA and con't be reused for ZEND_ASSERT_CHECK

commit ca8ecabf2a
Merge: 24328ac 9dac923
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Mar 2 10:49:23 2015 +0300

    Merge branch 'master' into assert

    * master:
      Update NEWS
      Fixed bug #69139 (Crash in gc_zval_possible_root on unserialize)
      windows only test
      Align entries format
      Align entries format for 5.6.7
      Align entries format for 5.5.23
      Bump header year
      Fixed bug #69144 (strtr not replacing with partly matching replace pairs)
      Fixed test?
      Revert mktime()/gmmktime()'s arginfo
      Update NEWS
      Fixed bug #69141 Missing arguments in reflection info for some builtin functions
      Add NEWS entry
      Remove useless date warning
      Fix ARG_INFO for levenshtein
      Fix ARG_INFO for levenshtein
      fix dir separator in tests
      Update NEWS
      Fixed bug #69085 (SoapClient's __call() type confusion through unserialize()).

commit 24328ac03f
Merge: 021fd94 1cdee9a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Feb 27 15:57:13 2015 +0300

    Merge branch 'master' into assert

    * master:
      Fixed C++ support
      Fixed bug #69115 crash in mail
      Reorder
      Update NEWs
      Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build)
      Update News
      Fixed bug #69125 (Array numeric string as key)
      fix bug#68942's patch
      Fixed ability to build unspecialized executor
      Fixed bug #69124 (method name could not be used when by ref)
      Fixed a bug that header value is not terminated by '\0' when accessed through getenv().
      Fixed a bug that header value is not terminated by '\0' when accessed through getenv().

commit 021fd94ed1
Merge: 49963eb ace1f82
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Feb 26 11:26:03 2015 +0300

    Merge branch 'master' into assert

    * master: (59 commits)
      Improved ASSIGN_DIM handler
      Don't inline slow path
      Revert a part committted by mistake
      Fixed compilation warnings
      Fixed a bug that header value is not terminated by '\0' when accessed through getenv().
      better name
      Improve fix for #69038
      Update NEWs
      Fixed bug #69108 ("Segmentation fault" when (de)serializing SplObjectStorage)
      Added specialized versions of DO_FCALL handler:   DO_ICALL - for internal functions   DO_UCALL - for user functions   DO_FCALL_BY_NAME - plain, most probably user, funcstions (not methods)
      Use cache_slot offsets instead of indexes (simplify run-time instructions)
      Split INIT_FCALL_BY_NAME inti INIT_FCALL_BY_NAME(CONST+STRING) and INIT_DYNAMIC_CALL(CONST-STRING|TMPVAR|CV)
      Support list($a, $b) = $a
      Avoid unnecassary check
      Make zend_array_destroy() to free the corresponding zend_array
      Eliminate check on the fast path
      Make current() and key() receive argument by value.
      Use Firebird default home folder, replace Interbase with Firebird
      Updated NEWS
      updated NEWS
      ...

    Conflicts:
    	Zend/zend_vm_execute.h
    	Zend/zend_vm_opcodes.c
    	Zend/zend_vm_opcodes.h

commit 49963ebf9d
Merge: 07b1f92 6b77959
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Feb 19 11:13:08 2015 +0300

    Merge branch 'master' into assert

    * master:
      Implemented AST pretty-printer
      update NEWS to match the actual stuff in 5.6.6
      update NEWS to match the actual stuff in 5.5.22
      update NEWS(add missing entry for the enchant fix, and reorder the entries a bit)
      fix typo in bug#
      update NEWS
      fix email format
      update NEWS
      update 5.6.6 release date in NEWS
      Fix bug #69033 (Request may get env. variables from previous requests if PHP works as FastCGI)
      BFN
      fix test
      fix test
      fix test
      Fixed bug #65593 (Segfault when calling ob_start from output buffering callback)
      Updated NEWS
      add CVE
      5.4.39 next
      Fix associativity to match Perl
      Blast off to space.

    Conflicts:
    	Zend/zend_ast.c

commit 07b1f92ed6
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Feb 18 23:06:32 2015 +0300

    fixed pretty-printer (support for "elseif")

commit 5a976c8d85
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Feb 18 19:50:08 2015 +0300

    Fixed vaeious ptetty-printer issues

commit 69491e8e8e
Merge: 8473157 3ddc246
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Feb 18 10:18:32 2015 +0300

    Merge branch 'master' into assert

    * master:
      Set PHP_JSON_VERSION to 1.4.0
      Remove unnecessary resource checks in openssl ext
      JSON is now maintained

commit 8473157fbb
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Feb 18 10:17:26 2015 +0300

    Fixed typo and white spaces

commit 96de5ffc8d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Feb 18 00:28:39 2015 +0300

    Fixed assert() in namesapaces

commit 5eba069c28
Merge: 4a2d9c0 d428bf2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Feb 17 22:45:55 2015 +0300

    Merge branch 'master' into assert

    * master: (25 commits)
      improve debugability in TS debug builds
      More UPGRADING, in particular on foreach
      Fixed bug #69038 (switch(SOMECONSTANT) misbehaves) for master
      Replace var is introduced
      abstain from using xmlCleanupParser
      fix TS build
      Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone)
      update news
      Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone)
      Port for for bug #68552
      Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone)
      Update NEWS
      Fixed bug #69038 (switch(SOMECONSTANT) misbehaves)
      - BFN
      Don't read the local php.ini when Generating Phar When building phar shared, you can end up loading a previous phar.so that isn't compatible with the php cli being used to generate Phar here.
      - Fixed bug #67827 (broken detection of system crypt sha256/sha512 support)
      Delete json outdated package.xml
      made ZEND_TSRMLS_CACHE_* macros look like function calls
      - Fix merge
      - Fixed bug #67427 (SoapServer cannot handle large messages) patch by: brandt at docoloc dot de
      ...

commit 4a2d9c0953
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Feb 17 22:45:10 2015 +0300

    Implemented AST pretty-printer to capture expression passed to assert()

commit 7a059b66d5
Merge: 9973df7 3892eba
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Feb 16 18:42:28 2015 +0300

    Merge branch 'expect' of github.com:krakjoe/php-src into assert

    * 'expect' of github.com:krakjoe/php-src:
      import expect

    Conflicts:
    	Zend/zend_compile.c
    	Zend/zend_execute_API.c
    	Zend/zend_globals.h
    	Zend/zend_vm_def.h
    	Zend/zend_vm_execute.h
    	Zend/zend_vm_opcodes.c
    	Zend/zend_vm_opcodes.h
    	ext/opcache/Optimizer/block_pass.c
    	ext/opcache/Optimizer/pass1_5.c
    	ext/standard/assert.c
    	ext/standard/tests/assert/assert_error3.phpt

commit 3892eba2bf
Author: krakjoe <joe.watkins@live.co.uk>
Date:   Sun Feb 2 12:49:35 2014 +0000

    import expect
2015-03-02 12:25:40 +03:00
Lior Kaplan
1a35c959a9 Add missing value for error_reporting directive 2015-03-01 15:16:53 +02:00