Commit Graph

1792 Commits

Author SHA1 Message Date
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