mirror of
https://github.com/php/php-src.git
synced 2024-10-01 06:46:08 +00:00
122d759618
Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to report FAILURE errors using a TypeException instead of a Warning, like it would happen in strict mode. Adds a zend_parse_parameters_throw() convenience function, which invokes zpp with this flag. Converts all cases I could identify, where we currently have throwing zpp usage in constructors and replaces them with this API. Error handling is still replaced to EH_THROW in some cases to handle other, domain-specific errors in constructors.
18 lines
310 B
PHP
18 lines
310 B
PHP
--TEST--
|
|
Bug #60261 (phar dos null pointer)
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
$nx = new Phar();
|
|
$nx->getLinkTarget();
|
|
} catch (TypeException $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Phar::__construct() expects at least 1 parameter, 0 given
|