Compare commits

..
Author SHA1 Message Date
Gabriel Caruso ae944503c3 Update versions for PHP 8.0.0rc1 2020-09-29 22:33:01 +00:00
513 changed files with 12527 additions and 15144 deletions

No files matched your search

+2 -70
View File
@@ -1,75 +1,5 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 Oct 2020, PHP 8.0.0RC3
- Core:
. Fixed bug #8055 (Abstract trait methods returning "self" cannot be
fulfilled by traits). (Nikita)
. Fixed bug #80280 (ADD_EXTENSION_DEP() fails for ext/standard and ext/date).
(cmb)
. Fixed bug #80258 (Windows Deduplication Enabled, randon permission errors).
(cmb)
- COM:
. Fixed bug #62474 (com_event_sink crashes on certain arguments). (cmb)
- DOM:
. Fixed bug #80268 (loadHTML() truncates at NUL bytes). (cmb)
- IMAP:
. Fixed bug #76618 (segfault on imap_reopen). (girgias)
. Fixed bug #80239 (imap_rfc822_write_address() leaks memory). (cmb)
. Fixed minor regression caused by fixing bug #80220. (cmb)
. Fixed bug #80242 (imap_mail_compose() segfaults for multipart with rfc822).
(cmb)
- Opcache:
. Fixed bug #80255 (Opcache bug (bad condition result) in 8.0.0rc1). (Nikita)
- Standard:
. Fixed bug #80256 (file_get_contents strip first line with chunked encoding
redirect). (Nikita)
15 Oct 2020, PHP 8.0.0RC2
- Core:
. Fixed bug #80225 (broken namespace usage in eval code). (Nikita)
- Curl:
. Fixed bug #80121 (Null pointer deref if CurlHandle directly instantiated).
(Nikita)
- IMAP:
. Fixed bug #80213 (imap_mail_compose() segfaults on certain $bodies). (cmb)
. Fixed bug #80215 (imap_mail_compose() may modify by-val parameters). (cmb)
. Fixed bug #80220 (imap_mail_compose() may leak memory). (cmb)
. Fixed bug #80223 (imap_mail_compose() leaks envelope on malformed bodies).
(cmb)
. Fixed bug #80216 (imap_mail_compose() does not validate types/encodings).
(cmb)
. Fixed bug #80226 (imap_sort() leaks sortpgm memory). (cmb)
. Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb)
- Opcache:
. Fixed bug #80184 (Complex expression in while / if statements resolves to
false incorrectly). (Nikita)
. Fixed bug #80175 (PHP8 RC1 - JIT Buffer not working). (cmb)
- Reflection:
. Fixed bug #80190 (ReflectionMethod::getReturnType() does not handle static
as part of union type). (Nikita)
- SPL:
. Fixed bug #65387 (Circular references in SPL iterators are not garbage
collected). (Nikita)
- Standard:
. Fixed bug #64060 (lstat_stat_variation7.phpt fails on certain file systems).
(M. Voelker, cmb)
- XMLWriter:
. Removed return types from XMLWriter stubs. (cmb)
01 Oct 2020, PHP 8.0.0rc1
- CLI:
@@ -260,6 +190,8 @@ PHP NEWS
. Use libenchant-2 when available.
- FPM:
. Fixed bug #64865 (Search for .user.ini files from script dir up to
CONTEXT_DOCUMENT_ROOT). (Will Bender)
. Add pm.status_listen option. (Jakub Zelenka)
- GD:
+9 -22
View File
@@ -27,8 +27,6 @@ PHP 8.0 UPGRADE NOTES
. Methods with the same name as the class are no longer interpreted as
constructors. The __construct() method should be used instead.
. Removed ability to call non-static methods statically.
Thus `is_callable` will fail when checking for a non-static method with a
classname (must check with an object instance).
. Removed (unset) cast.
. Removed track_errors ini directive. This means that $php_errormsg is no
longer available. The error_get_last() function may be used instead.
@@ -311,10 +309,9 @@ PHP 8.0 UPGRADE NOTES
warning.
- GD:
. The GD extension now uses a GdImage objects as the underlying data structure
for images, rather than resources. These objects are completely opaque, i.e.
they don't have any methods. Return value checks using is_resource() should
be replaced with checks for `false`.
. The GD extension now uses objects as the underlying data structure for
images, rather than resources. These objects are completely opaque, i.e.
they don't have any methods.
. The deprecated function image2wbmp() has been removed.
RFC: https://wiki.php.net/rfc/image2wbmp
. The deprecated functions png2wbmp() and jpeg2wbmp() have been removed.
@@ -344,8 +341,6 @@ PHP 8.0 UPGRADE NOTES
- LDAP:
. The deprecated function ldap_sort has been removed.
. The deprecated function ldap_control_paged_result has been removed.
. The deprecated function ldap_control_paged_result_response has been removed.
. The interface of ldap_set_rebind_proc has changed; the $callback parameter
does not accept empty string anymore; null value shall be used instead.
@@ -390,9 +385,6 @@ PHP 8.0 UPGRADE NOTES
aliases for better interoperability with the iconv extension. The mbregex
ISO 8859 aliases with underscores (ISO_8859_* and ISO8859_*) have also been
removed.
. mb_ereg() and mb_eregi() will now return boolean true on a successfuly
match. Previously they returned integer 1 if $matches was not passed, or
max(1, strlen($reg[0])) is $matches was passed.
- OCI8:
. The OCI-Lob class is now called OCILob, and the OCI-Collection class is now
@@ -558,7 +550,7 @@ PHP 8.0 UPGRADE NOTES
. money_format() has been removed.
. ezmlm_hash() has been removed.
. restore_include_path() has been removed.
. get_magic_quotes_gpc() and get_magic_quotes_runtime() has been removed.
. get_magic_quotes_gpc() and get_magic_quotes_gpc_runtime() has been removed.
. FILTER_SANITIZE_MAGIC_QUOTES has been removed.
. Calling implode() with parameters in a reverse order ($pieces, $glue) is no
longer supported.
@@ -586,7 +578,7 @@ PHP 8.0 UPGRADE NOTES
. Removed deprecated DES fallback in crypt(). If an unknown salt format is
passed to crypt(), the function will fail with *0 instead of falling back
to a weak DES hash now.
. Specifying out of range rounds for sha256/sha512 crypt() will now fail with
. Specifying out of range rounds for sha256/sha526 crypt() will now fail with
*0 instead of clamping to the closest limit. This matches glibc behavior.
. The result of sorting functions may have changed, if the array contains
elements that compare as equal.
@@ -614,9 +606,6 @@ PHP 8.0 UPGRADE NOTES
. Calling crypt() without an explicit salt is no longer supported. If you
would like to produce a strong hash with an auto-generated salt, use
password_hash() instead.
. substr(), mb_substr(), iconv_substr() and grapheme_substr() now consistently
clamp out-of-bounds offsets to the string boundary. Previously, false was
returned instead of the empty string in some cases.
- Sysvmsg:
. msg_get_queue() will now return an SysvMessageQueue object rather than a
@@ -638,7 +627,6 @@ PHP 8.0 UPGRADE NOTES
- tidy:
. The $use_include_path parameter, which was not used internally, has been
removed from tidy_repair_string().
. tidy::repairString() and tidy::repairFile() became static methods
- Tokenizer:
. T_COMMENT tokens will no longer include a trailing newline. The newline will
@@ -658,11 +646,6 @@ PHP 8.0 UPGRADE NOTES
instead the XmlParser instance is automatically destroyed if it is no longer
referenced.
- XMLReader:
. XMLReader::open() and XMLReader::xml() are now static methods. They still
can be called dynamically, though, but inheriting classes need to declare
them as static if they override these methods.
- XMLWriter:
. The XMLWriter functions now accept and return, respectively, XMLWriter
objects instead of resources.
@@ -845,6 +828,10 @@ PHP 8.0 UPGRADE NOTES
- Apache:
. The PHP module has been renamed from php7_module to php_module.
- CGI and FPM will now use CONTEXT_DOCUMENT_ROOT to scan for .user.ini files,
if it is defined. Otherwise, DOCUMENT_ROOT will be used as before. This
improves support for Apache mod_userdir and mod_alias.
========================================
4. Deprecated Functionality
========================================
+4 -4
View File
@@ -163,16 +163,16 @@ int main()
double d = (double) LONG_MIN * LONG_MIN + 2e9;
if ((long) d == 2e9 && (long) -d == -2e9) {
return 0;
exit(0);
}
} else if (sizeof(long) == 8) {
double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract ULONG_MAX + 1 */
if ((long) 18e18 == correct) { /* On 64-bit, only check between LONG_MAX and ULONG_MAX */
return 0;
exit(0);
}
}
return 1;
exit(1);
}
]])], [
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
@@ -268,7 +268,7 @@ int main()
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
fclose(fp);
return 0;
exit(0);
}
]])], [
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`
-39
View File
@@ -1,39 +0,0 @@
<?php
function skipFunction($function): bool {
if (false
/* expect input / hang */
|| $function === 'readline'
|| $function === 'readline_read_history'
|| $function === 'readline_write_history'
/* intentionally violate invariants */
|| $function === 'zend_create_unterminated_string'
|| $function === 'zend_test_array_return'
|| $function === 'zend_leak_bytes'
/* mess with output */
|| (is_string($function) && str_starts_with($function, 'ob_'))
|| $function === 'output_add_rewrite_var'
|| $function === 'error_log'
/* may spend a lot of time waiting for connection timeouts */
|| (is_string($function) && str_contains($function, 'connect'))
|| (is_string($function) && str_starts_with($function, 'snmp'))
|| (is_array($function) && get_class($function[0]) === mysqli::class
&& in_array($function[1], ['__construct', 'connect', 'real_connect']))
/* misc */
|| $function === 'mail'
|| $function === 'mb_send_mail'
|| $function === 'pcntl_fork'
|| $function === 'posix_kill'
|| $function === 'posix_setrlimit'
|| $function === 'sapi_windows_generate_ctrl_event'
|| $function === 'imagegrabscreen'
) {
return true;
}
if ($function[0] instanceof SoapServer) {
/* TODO: Uses fatal errors */
return true;
}
return false;
}
+16 -51
View File
@@ -1,62 +1,13 @@
--TEST--
Test that there is no arginfo/zpp mismatch
--SKIPIF--
<?php
if (getenv('SKIP_MSAN')) die("skip msan misses interceptors for some functions");
?>
--FILE--
<?php
require __DIR__ . "/arginfo_zpp_mismatch.inc";
function test($function) {
if (skipFunction($function)) {
return;
}
ob_start();
if (is_string($function)) {
echo "Testing $function\n";
} else {
echo "Testing " . get_class($function[0]) . "::$function[1]\n";
}
try {
@$function();
} catch (Throwable) {
}
try {
@$function(null);
} catch (Throwable) {
}
try {
@$function(null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null, null, null);
} catch (Throwable) {
}
ob_end_clean();
}
foreach (get_defined_functions()["internal"] as $function) {
@@ -78,6 +29,20 @@ foreach (get_declared_classes() as $class) {
// var_dump() and debug_zval_dump() print all arguments
?>
===DONE===
--EXPECT--
===DONE===
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
@@ -1,85 +0,0 @@
--TEST--
Test that there is no arginfo/zpp mismatch in strict mode
--SKIPIF--
<?php
if (getenv('SKIP_MSAN')) die("skip msan misses interceptors for some functions");
?>
--FILE--
<?php
declare(strict_types=1);
require __DIR__ . "/arginfo_zpp_mismatch.inc";
function test($function) {
if (skipFunction($function)) {
return;
}
ob_start();
if (is_string($function)) {
echo "Testing $function\n";
} else {
echo "Testing " . get_class($function[0]) . "::$function[1]\n";
}
try {
@$function();
} catch (Throwable) {
}
try {
@$function(null);
} catch (Throwable) {
}
try {
@$function(null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null, null, null);
} catch (Throwable) {
}
ob_end_clean();
}
foreach (get_defined_functions()["internal"] as $function) {
test($function);
}
foreach (get_declared_classes() as $class) {
try {
$rc = new ReflectionClass($class);
$obj = $rc->newInstanceWithoutConstructor();
} catch (Throwable) {
continue;
}
foreach (get_class_methods($class) as $method) {
test([$obj, $method]);
}
}
// var_dump() and debug_zval_dump() print all arguments
?>
===DONE===
--EXPECT--
===DONE===
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Array addition should not add INDIRECT elements
--FILE--
<?php
$x = 1;
$ary = ['y' => 1];
$ary += $GLOBALS;
var_dump($ary['x']);
$x = 2;
var_dump($ary['x']);
?>
--EXPECT--
int(1)
int(1)
-10
View File
@@ -1,10 +0,0 @@
--TEST--
Add $GLOBALS to itself
--FILE--
<?php
$GLOBALS += $GLOBALS;
$x = $GLOBALS + $GLOBALS;
?>
===DONE===
--EXPECT--
===DONE===
-24
View File
@@ -1,24 +0,0 @@
--TEST--
Bug #80055: Abstract trait methods returning "self" cannot be fulfilled by traits
--FILE--
<?php
trait AbstractTrait {
abstract public function selfReturner(): self;
}
trait ConcreteTrait {
public function selfReturner(): self {
return $this;
}
}
class Test {
use AbstractTrait;
use ConcreteTrait;
}
?>
===DONE===
--EXPECT--
===DONE===
-23
View File
@@ -1,23 +0,0 @@
--TEST--
Bug #80126: Covariant return types failing compilation
--FILE--
<?php
interface I {
public function method(): I;
}
abstract class A implements I {
public function method(): I { }
}
class C extends A { }
class C2 extends C {
public function method(): C2 { }
}
?>
===DONE===
--EXPECT--
===DONE===
-27
View File
@@ -1,27 +0,0 @@
--TEST--
Bug #80126: Covariant return types failing compilation (variation 2)
--FILE--
<?php
interface I {
public function method(): I;
}
abstract class A implements I {
public function method(): I {
return new static();
}
}
class C extends A { }
interface I2 { }
class C2 extends C implements I2 {
public function method(): C2 { }
}
?>
===DONE===
--EXPECT--
===DONE===
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #80184: Complex expression in while / if statements resolves to false incorrectly
--FILE--
<?php
$callbacks = [
function () { echo "First item!\n"; },
function () { echo "Second item!\n"; },
function () { echo "Third item!\n"; },
function () { echo "Fourth item!\n"; },
];
while ($callback = array_shift($callbacks) and ($callback() || true));
?>
--EXPECT--
First item!
Second item!
Third item!
Fourth item!
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #80194: Assertion failure during block assembly of unreachable free with leading nop
--FILE--
<?php
function test($x) {
switch ($x->y) {
default:
throw new Exception;
case 'foobar':
return new stdClass();
break;
}
}
$x = (object)['y' => 'foobar'];
var_dump(test($x));
?>
--EXPECT--
object(stdClass)#2 (0) {
}
-24
View File
@@ -1,24 +0,0 @@
--TEST--
Bug #80255: Opcache bug (bad condition result) in 8.0.0rc1
--FILE--
<?php
function test($a, $b, $c) {
do {
if ($a && !$b) {
break;
} else if ($b) {
echo "foo\n";
}
echo "bar\n";
} while ($c);
echo "baz\n";
}
test(true, true, false);
?>
--EXPECT--
foo
bar
baz
-11
View File
@@ -1,11 +0,0 @@
--TEST--
Division by zero in static
--FILE--
<?php
static $a = 1/0;
?>
--EXPECTF--
Fatal error: Uncaught DivisionByZeroError: Division by zero in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
@@ -1,32 +0,0 @@
--TEST--
Generator backtrace with multi yield from
--FILE--
<?php
function gen() {
yield 1;
debug_print_backtrace();
yield 2;
}
function from($gen) {
yield from $gen;
}
$gen1 = gen();
$gen2 = from($gen1);
$gen3 = from($gen2);
var_dump($gen3->current());
$gen2->next();
var_dump($gen2->current());
$gen2->next();
var_dump($gen2->current());
?>
--EXPECTF--
int(1)
int(1)
#0 gen() called at [%s:10]
#1 from(Generator Object ())
#2 Generator->next() called at [%s:19]
int(2)
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Bug #80240: Use after free multi yield from
--FILE--
<?php
function gen() {
yield 0;
yield from gen();
}
function bar($gen) {
yield from $gen;
}
$gen = gen();
$a = bar($gen);
$b = bar($gen);
$a->rewind();
$b->rewind();
$a->next();
unset($gen);
unset($a);
unset($b);
?>
===DONE===
--EXPECT--
===DONE===
@@ -9,7 +9,7 @@ function gen() {
$gen = gen();
try {
$gen->prop = new stdClass;
$gen->prop = 42;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
@@ -1,24 +0,0 @@
--TEST--
Leaf link may need to be invalidated depending on dtor order
--FILE--
<?php
function gen2() {
yield 1;
}
function gen() {
yield from gen2();
}
function bar($g) {
yield from $g;
}
$gen = gen();
$bar = bar($gen);
var_dump($bar->current());
$copy = $bar;
unset($gen);
?>
--EXPECT--
int(1)
-15
View File
@@ -1,15 +0,0 @@
--TEST--
Try to instantiate all classes without arguments
--FILE--
<?php
foreach (get_declared_classes() as $class) {
try {
new $class;
} catch (Throwable) {}
}
?>
===DONE===
--EXPECT--
===DONE===
@@ -1,23 +0,0 @@
--TEST--
Passing unknown named args to a non-existing ctor
--FILE--
<?php
class Test {}
try {
new stdClass(x: "nope");
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
new Test(x: "nope");
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Unknown named parameter $x
Unknown named parameter $x
-10
View File
@@ -1,10 +0,0 @@
--TEST--
Nop statement before namespace
--FILE--
<?php
;
namespace Foo;
?>
===DONE===
--EXPECT--
===DONE===
-11
View File
@@ -1,11 +0,0 @@
--TEST--
Output start at eval()
--FILE--
<?php
eval('echo "Foo\n";');
header('Foo: Bar');
?>
--EXPECTF--
Foo
Warning: Cannot modify header information - headers already sent by (output started at %s(2) : eval()'d code:1) in %s on line %d
@@ -1,23 +0,0 @@
--TEST--
Throwing undef var in verify return
--FILE--
<?php
set_error_handler(function(int $severity, string $message, string $filename, int $lineNumber): void {
throw new ErrorException($message, 0, $severity, $filename, $lineNumber);
});
function test(): string {
return $test;
}
test();
?>
--EXPECTF--
Fatal error: Uncaught ErrorException: Undefined variable $test in %s:%d
Stack trace:
#0 %s(%d): {closure}(2, 'Undefined varia...', '%s', 8)
#1 %s(%d): test()
#2 {main}
thrown in %s on line %d
+6 -7
View File
@@ -5865,7 +5865,7 @@ zend_bool zend_handle_encoding_declaration(zend_ast *ast) /* {{{ */
/* }}} */
/* Check whether this is the first statement, not counting declares. */
static zend_result zend_is_first_statement(zend_ast *ast, zend_bool allow_nop) /* {{{ */
static zend_result zend_is_first_statement(zend_ast *ast) /* {{{ */
{
uint32_t i = 0;
zend_ast_list *file_ast = zend_ast_get_list(CG(ast));
@@ -5874,9 +5874,8 @@ static zend_result zend_is_first_statement(zend_ast *ast, zend_bool allow_nop) /
if (file_ast->child[i] == ast) {
return SUCCESS;
} else if (file_ast->child[i] == NULL) {
if (!allow_nop) {
return FAILURE;
}
/* Empty statements count as statements. */
return FAILURE;
} else if (file_ast->child[i]->kind != ZEND_AST_DECLARE) {
return FAILURE;
}
@@ -5910,14 +5909,14 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */
zval_ptr_dtor_nogc(&value_zv);
} else if (zend_string_equals_literal_ci(name, "encoding")) {
if (FAILURE == zend_is_first_statement(ast, /* allow_nop */ 0)) {
if (FAILURE == zend_is_first_statement(ast)) {
zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must be "
"the very first statement in the script");
}
} else if (zend_string_equals_literal_ci(name, "strict_types")) {
zval value_zv;
if (FAILURE == zend_is_first_statement(ast, /* allow_nop */ 0)) {
if (FAILURE == zend_is_first_statement(ast)) {
zend_error_noreturn(E_COMPILE_ERROR, "strict_types declaration must be "
"the very first statement in the script");
}
@@ -7670,7 +7669,7 @@ void zend_compile_namespace(zend_ast *ast) /* {{{ */
zend_bool is_first_namespace = (!with_bracket && !FC(current_namespace))
|| (with_bracket && !FC(has_bracketed_namespaces));
if (is_first_namespace && FAILURE == zend_is_first_statement(ast, /* allow_nop */ 1)) {
if (is_first_namespace && FAILURE == zend_is_first_statement(ast)) {
zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be "
"the very first statement or after any declare call in the script");
}
+3 -9
View File
@@ -144,13 +144,6 @@ void zend_exception_restore(void) /* {{{ */
}
/* }}} */
static zend_always_inline zend_bool is_handle_exception_set() {
zend_execute_data *execute_data = EG(current_execute_data);
return !execute_data->func
|| !ZEND_USER_CODE(execute_data->func->common.type)
|| execute_data->opline->opcode == ZEND_HANDLE_EXCEPTION;
}
ZEND_API ZEND_COLD void zend_throw_exception_internal(zend_object *exception) /* {{{ */
{
#ifdef HAVE_DTRACE
@@ -168,7 +161,6 @@ ZEND_API ZEND_COLD void zend_throw_exception_internal(zend_object *exception) /*
zend_exception_set_previous(exception, EG(exception));
EG(exception) = exception;
if (previous) {
ZEND_ASSERT(is_handle_exception_set() && "HANDLE_EXCEPTION not set?");
return;
}
}
@@ -187,7 +179,9 @@ ZEND_API ZEND_COLD void zend_throw_exception_internal(zend_object *exception) /*
zend_throw_exception_hook(exception);
}
if (is_handle_exception_set()) {
if (!EG(current_execute_data)->func ||
!ZEND_USER_CODE(EG(current_execute_data)->func->common.type) ||
EG(current_execute_data)->opline->opcode == ZEND_HANDLE_EXCEPTION) {
/* no need to rethrow the exception */
return;
}
+3 -7
View File
@@ -22,11 +22,10 @@ interface Throwable extends Stringable
class Exception implements Throwable
{
final private function __clone(): void {}
final private function __clone() {}
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null) {}
/** @return void */
public function __wakeup() {}
final public function getMessage(): string {}
@@ -57,15 +56,12 @@ class ErrorException extends Exception
class Error implements Throwable
{
/** @implementation-alias Exception::__clone */
final private function __clone(): void {}
final private function __clone() {}
/** @implementation-alias Exception::__construct */
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null) {}
/**
* @return void
* @implementation-alias Exception::__wakeup
*/
/** @implementation-alias Exception::__wakeup */
public function __wakeup() {}
/** @implementation-alias Exception::getMessage */
+3 -4
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 3699b51b31e509c11435845c7e0d35a2608dd268 */
* Stub hash: bc49b326136997660887b12f0c59f8a57b17ecaf */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Throwable_getMessage, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
@@ -20,8 +20,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_Throwable_getTraceAsString arginfo_class_Throwable_getMessage
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Exception___clone, 0, 0, IS_VOID, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_Exception___clone arginfo_class_Throwable_getCode
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Exception___construct, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, message, IS_STRING, 0, "\"\"")
@@ -58,7 +57,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_ErrorException_getSeverity arginfo_class_Throwable_getLine
#define arginfo_class_Error___clone arginfo_class_Exception___clone
#define arginfo_class_Error___clone arginfo_class_Throwable_getCode
#define arginfo_class_Error___construct arginfo_class_Exception___construct
+2 -6
View File
@@ -130,12 +130,13 @@ static ZEND_FUNCTION(pass)
}
ZEND_BEGIN_ARG_INFO_EX(zend_pass_function_arg_info, 0, 0, 0)
ZEND_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()
ZEND_API const zend_internal_function zend_pass_function = {
ZEND_INTERNAL_FUNCTION, /* type */
{0, 0, 0}, /* arg_flags */
0, /* fn_flags */
ZEND_ACC_VARIADIC, /* fn_flags */
NULL, /* name */
NULL, /* scope */
NULL, /* prototype */
@@ -1096,11 +1097,6 @@ static zend_never_inline ZEND_ATTRIBUTE_UNUSED bool zend_verify_internal_arg_typ
* trust that arginfo matches what is enforced by zend_parse_parameters. */
static zend_always_inline zend_bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_data *call)
{
if (fbc->internal_function.handler == ZEND_FN(pass)) {
/* Be lenient about the special pass function. */
return 0;
}
if (fbc->common.required_num_args > ZEND_CALL_NUM_ARGS(call)) {
/* Required argument not passed. */
return 1;
+2 -2
View File
@@ -177,7 +177,7 @@
#define GC_MAX_UNCOMPRESSED (512 * 1024)
#define GC_MAX_BUF_SIZE 0x40000000
#define GC_THRESHOLD_DEFAULT (10000 + GC_FIRST_ROOT)
#define GC_THRESHOLD_DEFAULT 10000
#define GC_THRESHOLD_STEP 10000
#define GC_THRESHOLD_MAX 1000000000
#define GC_THRESHOLD_TRIGGER 100
@@ -501,7 +501,7 @@ ZEND_API zend_bool gc_enable(zend_bool enable)
GC_G(buf) = (gc_root_buffer*) pemalloc(sizeof(gc_root_buffer) * GC_DEFAULT_BUF_SIZE, 1);
GC_G(buf)[0].ref = NULL;
GC_G(buf_size) = GC_DEFAULT_BUF_SIZE;
GC_G(gc_threshold) = GC_THRESHOLD_DEFAULT;
GC_G(gc_threshold) = GC_THRESHOLD_DEFAULT + GC_FIRST_ROOT;
gc_reset();
}
return old_enabled;
+261 -138
View File
@@ -161,43 +161,51 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
}
/* }}} */
static void zend_generator_remove_child(zend_generator_node *node, zend_generator *child)
static zend_generator *zend_generator_get_child(zend_generator_node *node, zend_generator *leaf);
static void zend_generator_update_leaf_of_child(zend_generator_node *node, zend_generator *from_leaf, zend_generator *to_leaf)
{
ZEND_ASSERT(node->children >= 1);
if (node->ptr.leaf == from_leaf) {
node->ptr.leaf = to_leaf;
}
if (node->children == 1) {
node->child.single.child = NULL;
node->child.single.leaf = to_leaf;
} else {
HashTable *ht = node->child.ht;
zend_hash_index_del(ht, (zend_ulong) child);
if (node->children == 2) {
zend_generator *other_child;
ZEND_HASH_FOREACH_PTR(ht, other_child) {
node->child.single.child = other_child;
zend_generator *child = zend_hash_index_find_ptr(ht, (zend_ulong) from_leaf);
ZEND_ASSERT(child != NULL);
zend_hash_index_del(ht, (zend_ulong) from_leaf);
zend_hash_index_add_ptr(ht, (zend_ulong) to_leaf, child);
}
}
static void zend_generator_remove_leaf_child(zend_generator_node *node, zend_generator *leaf, zend_generator *replace_leaf) {
if (node->children > 1) {
HashTable *ht = node->child.ht;
zend_ulong child_leaf;
zend_generator *child_generator;
zend_hash_index_del(ht, (zend_ulong) leaf);
if (--node->children == 1) {
ZEND_HASH_FOREACH_NUM_KEY_PTR(ht, child_leaf, child_generator) {
node->child.single.leaf = (zend_generator *) child_leaf;
node->child.single.child = child_generator;
if (node->ptr.leaf == leaf) {
node->ptr.leaf = (zend_generator *) child_leaf;
}
break;
} ZEND_HASH_FOREACH_END();
zend_hash_destroy(ht);
efree(ht);
} else if (node->ptr.leaf == leaf) {
ZEND_HASH_FOREACH_NUM_KEY_PTR(ht, child_leaf, child_generator) {
node->ptr.leaf = (zend_generator *) child_leaf;
break;
} ZEND_HASH_FOREACH_END();
}
}
node->children--;
}
static zend_always_inline zend_generator *clear_link_to_leaf(zend_generator *generator) {
ZEND_ASSERT(!generator->node.parent);
zend_generator *leaf = generator->node.ptr.leaf;
if (leaf) {
leaf->node.ptr.root = NULL;
generator->node.ptr.leaf = NULL;
return leaf;
}
return NULL;
}
static zend_always_inline void clear_link_to_root(zend_generator *generator) {
ZEND_ASSERT(generator->node.parent);
if (generator->node.ptr.root) {
generator->node.ptr.root->node.ptr.leaf = NULL;
generator->node.ptr.root = NULL;
} else if (node->ptr.leaf == leaf) {
ZEND_ASSERT(replace_leaf != leaf);
node->ptr.leaf = replace_leaf;
}
}
@@ -214,14 +222,48 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */
ZVAL_UNDEF(&generator->values);
}
zend_generator *parent = generator->node.parent;
if (parent) {
zend_generator_remove_child(&parent->node, generator);
clear_link_to_root(generator);
generator->node.parent = NULL;
OBJ_RELEASE(&parent->std);
} else {
clear_link_to_leaf(generator);
if (UNEXPECTED(generator->node.children != 0) && generator->node.parent) {
/* we're called out of order - this must only happen during shutdown sequence: we call our (direct) child nodes destructors first, to clean it from the bottom up */
while (generator->node.children != 0) {
zend_generator *child;
if (generator->node.children == 1) {
child = generator->node.child.single.child;
} else {
child = (zend_generator *) Z_PTR_P(zend_hash_get_current_data(generator->node.child.ht));
}
GC_ADD_FLAGS(&child->std, IS_OBJ_DESTRUCTOR_CALLED);
GC_ADDREF(&child->std); /* must not be released during destructor */
zend_generator_dtor_storage(&child->std);
OBJ_RELEASE(&child->std);
}
}
if (EXPECTED(generator->node.children == 0)) {
zend_generator_update_current(generator, generator); /* ensure we remove it from a *live* root */
zend_generator *root = generator->node.ptr.root, *parent = generator->node.parent, *next, *toproot = root;
if (parent) {
zend_bool parent_becomes_leaf = parent->node.children == 1;
if (parent_becomes_leaf) {
while (UNEXPECTED(root != generator)) {
next = zend_generator_get_child(&root->node, generator);
zend_generator_update_leaf_of_child(&root->node, generator, parent);
root = next;
}
parent->node.ptr.root = toproot;
parent->node.children = 0;
} else {
zend_generator_remove_leaf_child(&parent->node, generator, NULL);
while (UNEXPECTED(root != parent)) {
next = zend_generator_get_child(&root->node, generator);
zend_generator_remove_leaf_child(&root->node, generator, parent->node.ptr.leaf);
OBJ_RELEASE(&root->std);
root = next;
}
}
OBJ_RELEASE(&parent->std);
/* Reset for resuming in finally */
generator->node.parent = NULL;
generator->node.ptr.root = generator;
}
}
if (EXPECTED(!ex) || EXPECTED(!(ex->func->op_array.fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK))
@@ -376,8 +418,12 @@ static HashTable *zend_generator_get_gc(zend_object *object, zval **table, int *
}
}
if (generator->node.parent) {
zend_get_gc_buffer_add_obj(gc_buffer, &generator->node.parent->std);
if (generator->node.children == 0) {
zend_generator *root = generator->node.ptr.root;
while (root != generator) {
zend_get_gc_buffer_add_obj(gc_buffer, &root->std);
root = zend_generator_get_child(&root->node, generator);
}
}
zend_get_gc_buffer_use(gc_buffer, table, n);
@@ -405,7 +451,7 @@ static zend_object *zend_generator_create(zend_class_entry *class_type) /* {{{ *
/* By default we have a tree of only one node */
generator->node.parent = NULL;
generator->node.children = 0;
generator->node.ptr.root = NULL;
generator->node.ptr.root = generator;
zend_object_std_init(&generator->std, class_type);
generator->std.handlers = &zend_generator_handlers;
@@ -427,12 +473,14 @@ ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_
if (!ptr->func && Z_TYPE(ptr->This) == IS_OBJECT) {
if (Z_OBJCE(ptr->This) == zend_ce_generator) {
zend_generator *generator = (zend_generator *) Z_OBJ(ptr->This);
zend_generator *root = (generator->node.children < 1 ? generator : generator->node.ptr.leaf)->node.ptr.root;
zend_execute_data *prev = ptr->prev_execute_data;
ZEND_ASSERT(generator->node.parent && "Placeholder only used with delegation");
while (generator->node.parent->node.parent) {
generator->execute_data->prev_execute_data = prev;
prev = generator->execute_data;
generator = generator->node.parent;
if (generator->node.parent != root) {
do {
generator->execute_data->prev_execute_data = prev;
prev = generator->execute_data;
generator = generator->node.parent;
} while (generator->node.parent != root);
}
generator->execute_data->prev_execute_data = prev;
ptr = generator->execute_data;
@@ -464,128 +512,203 @@ static void zend_generator_throw_exception(zend_generator *generator, zval *exce
EG(current_execute_data) = original_execute_data;
}
static void zend_generator_add_child(zend_generator *generator, zend_generator *child)
static zend_generator *zend_generator_get_child(zend_generator_node *node, zend_generator *leaf)
{
zend_generator_node *node = &generator->node;
ZEND_ASSERT(node->children != 0);
if (node->children == 1) {
return node->child.single.child;
} else {
return zend_hash_index_find_ptr(node->child.ht, (zend_ulong) leaf);
}
}
static zend_generator_node *zend_generator_search_multi_children_node(zend_generator_node *node)
{
while (node->children == 1) {
node = &node->child.single.child->node;
}
return node->children > 1 ? node : NULL;
}
static void zend_generator_add_single_child(zend_generator_node *node, zend_generator *child, zend_generator *leaf)
{
if (node->children == 0) {
node->child.single.leaf = leaf;
node->child.single.child = child;
} else {
if (node->children == 1) {
HashTable *ht = emalloc(sizeof(HashTable));
zend_hash_init(ht, 0, NULL, NULL, 0);
zend_hash_index_add_new_ptr(ht,
(zend_ulong) node->child.single.child, node->child.single.child);
zend_hash_index_add_ptr(ht,
(zend_ulong) node->child.single.leaf, node->child.single.child);
node->child.ht = ht;
}
zend_hash_index_add_new_ptr(node->child.ht, (zend_ulong) child, child);
if (zend_hash_index_add_ptr(node->child.ht, (zend_ulong) leaf, child) == NULL) {
ZEND_ASSERT(node->children > 1);
return;
}
}
++node->children;
}
void zend_generator_yield_from(zend_generator *generator, zend_generator *from)
static void zend_generator_merge_child_nodes(zend_generator_node *dest, zend_generator_node *src, zend_generator *child)
{
ZEND_ASSERT(!generator->node.parent && "Already has parent?");
zend_generator *leaf = clear_link_to_leaf(generator);
if (leaf && !from->node.parent && !from->node.ptr.leaf) {
from->node.ptr.leaf = leaf;
leaf->node.ptr.root = from;
}
generator->node.parent = from;
zend_generator_add_child(from, generator);
generator->flags |= ZEND_GENERATOR_DO_INIT;
zend_ulong leaf;
ZEND_ASSERT(src->children > 1);
ZEND_HASH_FOREACH_NUM_KEY(src->child.ht, leaf) {
zend_generator_add_single_child(dest, child, (zend_generator *) leaf);
} ZEND_HASH_FOREACH_END();
}
ZEND_API zend_generator *zend_generator_update_root(zend_generator *generator)
/* Pay attention so that the root of each subtree of the Generators tree is referenced
* once per leaf */
static void zend_generator_add_child(zend_generator *generator, zend_generator *child)
{
zend_generator *root = generator->node.parent;
while (root->node.parent) {
root = root->node.parent;
}
zend_generator *leaf = child->node.children ? child->node.ptr.leaf : child;
zend_generator_node *multi_children_node;
zend_bool was_leaf = generator->node.children == 0;
clear_link_to_leaf(root);
root->node.ptr.leaf = generator;
generator->node.ptr.root = root;
return root;
}
if (was_leaf) {
zend_generator *next = generator->node.parent;
leaf->node.ptr.root = generator->node.ptr.root;
GC_ADDREF(&generator->std); /* we need to increment the generator refcount here as it became integrated into the tree (no leaf), but we must not increment the refcount of the *whole* path in tree */
generator->node.ptr.leaf = leaf;
static zend_generator *get_new_root(zend_generator *generator, zend_generator *root)
{
while (!root->execute_data && root->node.children == 1) {
root = root->node.child.single.child;
}
if (root->execute_data) {
return root;
}
/* We have reached a multi-child node haven't found the root yet. We don't know which
* child to follow, so perform the search from the other direction instead. */
while (generator->node.parent->execute_data) {
generator = generator->node.parent;
}
return generator;
}
ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator)
{
zend_generator *old_root = generator->node.ptr.root;
ZEND_ASSERT(!old_root->execute_data && "Nothing to update?");
zend_generator *new_root = get_new_root(generator, old_root);
ZEND_ASSERT(old_root->node.ptr.leaf == generator);
generator->node.ptr.root = new_root;
new_root->node.ptr.leaf = generator;
old_root->node.ptr.leaf = NULL;
zend_generator *new_root_parent = new_root->node.parent;
ZEND_ASSERT(new_root_parent);
zend_generator_remove_child(&new_root_parent->node, new_root);
if (EXPECTED(EG(exception) == NULL) && EXPECTED((OBJ_FLAGS(&generator->std) & IS_OBJ_DESTRUCTOR_CALLED) == 0)) {
zend_op *yield_from = (zend_op *) new_root->execute_data->opline - 1;
if (yield_from->opcode == ZEND_YIELD_FROM) {
if (Z_ISUNDEF(new_root_parent->retval)) {
/* Throw the exception in the context of the generator */
zend_execute_data *original_execute_data = EG(current_execute_data);
EG(current_execute_data) = new_root->execute_data;
if (new_root == generator) {
new_root->execute_data->prev_execute_data = original_execute_data;
} else {
new_root->execute_data->prev_execute_data = &generator->execute_fake;
generator->execute_fake.prev_execute_data = original_execute_data;
}
/* ZEND_YIELD(_FROM) already advance, so decrement opline to throw from correct place */
new_root->execute_data->opline--;
zend_throw_exception(zend_ce_ClosedGeneratorException, "Generator yielded from aborted, no return value available", 0);
EG(current_execute_data) = original_execute_data;
if (!((old_root ? old_root : generator)->flags & ZEND_GENERATOR_CURRENTLY_RUNNING)) {
new_root->node.parent = NULL;
OBJ_RELEASE(&new_root_parent->std);
zend_generator_resume(generator);
return zend_generator_get_current(generator);
}
} else {
zval_ptr_dtor(&new_root->value);
ZVAL_COPY(&new_root->value, &new_root_parent->value);
ZVAL_COPY(ZEND_CALL_VAR(new_root->execute_data, yield_from->result.var), &new_root_parent->retval);
while (next) {
if (next->node.children > 1) {
zend_generator *child = zend_hash_index_find_ptr(next->node.child.ht, (zend_ulong) generator);
zend_hash_index_del(next->node.child.ht, (zend_ulong) generator);
zend_hash_index_add_ptr(next->node.child.ht, (zend_ulong) leaf, child);
}
next->node.ptr.leaf = leaf;
next = next->node.parent;
}
} else if (generator->node.children == 1) {
multi_children_node = zend_generator_search_multi_children_node(&generator->node);
if (multi_children_node) {
zend_generator_merge_child_nodes(&generator->node, multi_children_node, generator->node.child.single.child);
}
}
new_root->node.parent = NULL;
OBJ_RELEASE(&new_root_parent->std);
if (!was_leaf) {
multi_children_node = zend_generator_search_multi_children_node(&child->node);
} else {
multi_children_node = (zend_generator_node *) 0x1;
}
return new_root;
/* for allowing zend_generator_get_child() to work, we need every multi children node to have ALL its leaf descendents present, linking to their respective child */
{
zend_generator *parent = generator->node.parent, *cur = generator;
if (multi_children_node > (zend_generator_node *) 0x1) {
zend_generator_merge_child_nodes(&generator->node, multi_children_node, child);
} else {
zend_generator_add_single_child(&generator->node, child, leaf);
}
while (parent) {
if (parent->node.children > 1) {
if (multi_children_node == (zend_generator_node *) 0x1) {
multi_children_node = zend_generator_search_multi_children_node(&child->node);
}
if (multi_children_node) {
zend_generator_merge_child_nodes(&parent->node, multi_children_node, cur);
} else {
zend_generator_add_single_child(&parent->node, cur, leaf);
}
}
cur = parent;
parent = parent->node.parent;
}
}
}
void zend_generator_yield_from(zend_generator *generator, zend_generator *from)
{
zend_generator_add_child(from, generator);
generator->node.parent = from;
zend_generator_get_current(generator);
GC_DELREF(&from->std);
generator->flags |= ZEND_GENERATOR_DO_INIT;
}
ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator, zend_generator *leaf)
{
zend_generator *old_root, *root = leaf->node.ptr.root;
/* generator at the root had stopped */
if (root != generator) {
old_root = root;
root = zend_generator_get_child(&root->node, leaf);
} else {
old_root = NULL;
}
while (!root->execute_data && root != generator) {
OBJ_RELEASE(&old_root->std);
old_root = root;
root = zend_generator_get_child(&root->node, leaf);
}
if (root->node.parent) {
if (root->node.parent->execute_data == NULL) {
if (EXPECTED(EG(exception) == NULL) && EXPECTED((OBJ_FLAGS(&generator->std) & IS_OBJ_DESTRUCTOR_CALLED) == 0)) {
zend_op *yield_from = (zend_op *) root->execute_data->opline - 1;
if (yield_from->opcode == ZEND_YIELD_FROM) {
if (Z_ISUNDEF(root->node.parent->retval)) {
/* Throw the exception in the context of the generator */
zend_execute_data *original_execute_data = EG(current_execute_data);
EG(current_execute_data) = root->execute_data;
if (root == generator) {
root->execute_data->prev_execute_data = original_execute_data;
} else {
root->execute_data->prev_execute_data = &generator->execute_fake;
generator->execute_fake.prev_execute_data = original_execute_data;
}
root->execute_data->opline--; /* ZEND_YIELD(_FROM) already advance, so decrement opline to throw from correct place */
zend_throw_exception(zend_ce_ClosedGeneratorException, "Generator yielded from aborted, no return value available", 0);
EG(current_execute_data) = original_execute_data;
if (!((old_root ? old_root : generator)->flags & ZEND_GENERATOR_CURRENTLY_RUNNING)) {
leaf->node.ptr.root = root;
root->node.parent = NULL;
if (old_root) {
OBJ_RELEASE(&old_root->std);
}
zend_generator_resume(leaf);
return leaf->node.ptr.root; /* this may be updated during zend_generator_resume! */
}
} else {
zval_ptr_dtor(&root->value);
ZVAL_COPY(&root->value, &root->node.parent->value);
ZVAL_COPY(ZEND_CALL_VAR(root->execute_data, yield_from->result.var), &root->node.parent->retval);
}
}
}
root->node.parent = NULL;
} else {
do {
root = root->node.parent;
GC_ADDREF(&root->std);
} while (root->node.parent);
}
}
leaf->node.ptr.root = root;
if (old_root) {
OBJ_RELEASE(&old_root->std);
}
return root;
}
static zend_result zend_generator_get_next_delegated_value(zend_generator *generator) /* {{{ */
+11 -13
View File
@@ -42,15 +42,13 @@ struct _zend_generator_node {
union {
HashTable *ht; /* if multiple children */
struct { /* if one child */
zend_generator *leaf; /* TODO: Unused, remove. */
zend_generator *leaf;
zend_generator *child;
} single;
} child;
/* One generator can cache a direct pointer to the current root.
* The leaf member points back to the generator using the root cache. */
union {
zend_generator *leaf; /* if parent != NULL */
zend_generator *root; /* if parent == NULL */
zend_generator *leaf; /* if > 0 children */
zend_generator *root; /* if 0 children */
} ptr;
};
@@ -106,26 +104,26 @@ ZEND_API zend_execute_data* zend_generator_freeze_call_stack(zend_execute_data *
void zend_generator_yield_from(zend_generator *generator, zend_generator *from);
ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_data *ptr);
ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator);
ZEND_API zend_generator *zend_generator_update_root(zend_generator *generator);
ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator, zend_generator *leaf);
static zend_always_inline zend_generator *zend_generator_get_current(zend_generator *generator)
{
zend_generator *leaf;
zend_generator *root;
if (EXPECTED(generator->node.parent == NULL)) {
/* we're not in yield from mode */
return generator;
}
zend_generator *root = generator->node.ptr.root;
if (!root) {
root = zend_generator_update_root(generator);
}
leaf = generator->node.children ? generator->node.ptr.leaf : generator;
root = leaf->node.ptr.root;
if (EXPECTED(root->execute_data)) {
if (EXPECTED(root->execute_data && root->node.parent == NULL)) {
/* generator still running */
return root;
}
return zend_generator_update_current(generator);
return zend_generator_update_current(generator, leaf);
}
END_EXTERN_C()
+13 -17
View File
@@ -2149,7 +2149,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
{
uint32_t idx;
Bucket *p;
zval *t, *s;
zval *t;
IS_CONSISTENT(source);
IS_CONSISTENT(target);
@@ -2158,20 +2158,18 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
if (overwrite) {
for (idx = 0; idx < source->nNumUsed; idx++) {
p = source->arData + idx;
s = &p->val;
if (UNEXPECTED(Z_TYPE_P(s) == IS_INDIRECT)) {
s = Z_INDIRECT_P(s);
}
if (UNEXPECTED(Z_TYPE_P(s) == IS_UNDEF)) {
continue;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
if (UNEXPECTED(Z_TYPE(p->val) == IS_INDIRECT) &&
UNEXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
continue;
}
if (p->key) {
t = _zend_hash_add_or_update_i(target, p->key, s, HASH_UPDATE | HASH_UPDATE_INDIRECT);
t = _zend_hash_add_or_update_i(target, p->key, &p->val, HASH_UPDATE | HASH_UPDATE_INDIRECT);
if (pCopyConstructor) {
pCopyConstructor(t);
}
} else {
t = zend_hash_index_update(target, p->h, s);
t = zend_hash_index_update(target, p->h, &p->val);
if (pCopyConstructor) {
pCopyConstructor(t);
}
@@ -2180,20 +2178,18 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
} else {
for (idx = 0; idx < source->nNumUsed; idx++) {
p = source->arData + idx;
s = &p->val;
if (UNEXPECTED(Z_TYPE_P(s) == IS_INDIRECT)) {
s = Z_INDIRECT_P(s);
}
if (UNEXPECTED(Z_TYPE_P(s) == IS_UNDEF)) {
continue;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
if (UNEXPECTED(Z_TYPE(p->val) == IS_INDIRECT) &&
UNEXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
continue;
}
if (p->key) {
t = _zend_hash_add_or_update_i(target, p->key, s, HASH_ADD | HASH_UPDATE_INDIRECT);
t = _zend_hash_add_or_update_i(target, p->key, &p->val, HASH_ADD | HASH_UPDATE_INDIRECT);
if (t && pCopyConstructor) {
pCopyConstructor(t);
}
} else {
t = zend_hash_index_add(target, p->h, s);
t = zend_hash_index_add(target, p->h, &p->val);
if (t && pCopyConstructor) {
pCopyConstructor(t);
}
+51 -66
View File
@@ -29,8 +29,8 @@
static void add_dependency_obligation(zend_class_entry *ce, zend_class_entry *dependency_ce);
static void add_compatibility_obligation(
zend_class_entry *ce, const zend_function *child_fn, zend_class_entry *child_scope,
const zend_function *parent_fn, zend_class_entry *parent_scope);
zend_class_entry *ce, const zend_function *child_fn, const zend_function *parent_fn,
zend_class_entry *parent_scope);
static void add_property_compatibility_obligation(
zend_class_entry *ce, const zend_property_info *child_prop,
const zend_property_info *parent_prop);
@@ -272,6 +272,8 @@ static zend_class_entry *lookup_class(
/* Instanceof that's safe to use on unlinked classes. */
static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
zend_class_entry *ce;
if (ce1 == ce2) {
return 1;
}
@@ -280,18 +282,18 @@ static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce
return instanceof_function(ce1, ce2);
}
if (ce1->parent) {
zend_class_entry *parent_ce;
if (ce1->ce_flags & ZEND_ACC_RESOLVED_PARENT) {
parent_ce = ce1->parent;
ce = ce1;
while (ce->parent) {
if (ce->ce_flags & ZEND_ACC_RESOLVED_PARENT) {
ce = ce->parent;
} else {
parent_ce = zend_lookup_class_ex(ce1->parent_name, NULL,
ce = zend_lookup_class_ex(ce->parent_name, NULL,
ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (!ce) {
break;
}
}
/* It's not sufficient to only check the parent chain itself, as need to do a full
* recursive instanceof in case the parent interfaces haven't been copied yet. */
if (parent_ce && unlinked_instanceof(parent_ce, ce2)) {
if (ce == ce2) {
return 1;
}
}
@@ -308,7 +310,7 @@ static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce
}
} else {
for (i = 0; i < ce1->num_interfaces; i++) {
zend_class_entry *ce = zend_lookup_class_ex(
ce = zend_lookup_class_ex(
ce1->interface_names[i].name, ce1->interface_names[i].lc_name,
ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (ce && unlinked_instanceof(ce, ce2)) {
@@ -522,12 +524,12 @@ static inheritance_status zend_do_perform_arg_type_hint_check(
}
/* }}} */
/* For trait methods, fe_scope/proto_scope may differ from fe/proto->common.scope,
/* For abstract trait methods, proto_scope will differ from proto->common.scope,
* as self will refer to the self of the class the trait is used in, not the trait
* the method was declared in. */
static inheritance_status zend_do_perform_implementation_check(
const zend_function *fe, zend_class_entry *fe_scope,
const zend_function *proto, zend_class_entry *proto_scope) /* {{{ */
const zend_function *fe, const zend_function *proto,
zend_class_entry *proto_scope) /* {{{ */
{
uint32_t i, num_args, proto_num_args, fe_num_args;
inheritance_status status, local_status;
@@ -589,7 +591,7 @@ static inheritance_status zend_do_perform_implementation_check(
}
local_status = zend_do_perform_arg_type_hint_check(
fe_scope, fe_arg_info, proto_scope, proto_arg_info);
fe->common.scope, fe_arg_info, proto_scope, proto_arg_info);
if (UNEXPECTED(local_status != INHERITANCE_SUCCESS)) {
if (UNEXPECTED(local_status == INHERITANCE_ERROR)) {
@@ -614,7 +616,7 @@ static inheritance_status zend_do_perform_implementation_check(
}
local_status = zend_perform_covariant_type_check(
fe_scope, fe->common.arg_info[-1].type,
fe->common.scope, fe->common.arg_info[-1].type,
proto_scope, proto->common.arg_info[-1].type);
if (UNEXPECTED(local_status != INHERITANCE_SUCCESS)) {
@@ -778,11 +780,10 @@ static zend_always_inline uint32_t func_lineno(const zend_function *fn) {
}
static void ZEND_COLD emit_incompatible_method_error(
const zend_function *child, zend_class_entry *child_scope,
const zend_function *parent, zend_class_entry *parent_scope,
const zend_function *child, const zend_function *parent, zend_class_entry *parent_scope,
inheritance_status status) {
zend_string *parent_prototype = zend_get_function_declaration(parent, parent_scope);
zend_string *child_prototype = zend_get_function_declaration(child, child_scope);
zend_string *child_prototype = zend_get_function_declaration(child, child->common.scope);
if (status == INHERITANCE_UNRESOLVED) {
/* Fetch the first unresolved class from registered autoloads */
zend_string *unresolved_class = NULL;
@@ -804,26 +805,23 @@ static void ZEND_COLD emit_incompatible_method_error(
}
static void perform_delayable_implementation_check(
zend_class_entry *ce,
const zend_function *fe, zend_class_entry *fe_scope,
zend_class_entry *ce, const zend_function *fe,
const zend_function *proto, zend_class_entry *proto_scope)
{
inheritance_status status =
zend_do_perform_implementation_check(fe, fe_scope, proto, proto_scope);
inheritance_status status = zend_do_perform_implementation_check(fe, proto, proto_scope);
if (UNEXPECTED(status != INHERITANCE_SUCCESS)) {
if (EXPECTED(status == INHERITANCE_UNRESOLVED)) {
add_compatibility_obligation(ce, fe, fe_scope, proto, proto_scope);
add_compatibility_obligation(ce, fe, proto, proto_scope);
} else {
ZEND_ASSERT(status == INHERITANCE_ERROR);
emit_incompatible_method_error(fe, fe_scope, proto, proto_scope, status);
emit_incompatible_method_error(fe, proto, proto_scope, status);
}
}
}
static zend_always_inline inheritance_status do_inheritance_check_on_method_ex(
zend_function *child, zend_class_entry *child_scope,
zend_function *parent, zend_class_entry *parent_scope,
zend_class_entry *ce, zval *child_zv,
zend_function *child, zend_function *parent,
zend_class_entry *ce, zend_class_entry *parent_scope, zval *child_zv,
zend_bool check_visibility, zend_bool check_only, zend_bool checked) /* {{{ */
{
uint32_t child_flags;
@@ -923,21 +921,22 @@ static zend_always_inline inheritance_status do_inheritance_check_on_method_ex(
if (!checked) {
if (check_only) {
return zend_do_perform_implementation_check(child, child_scope, parent, parent_scope);
return zend_do_perform_implementation_check(child, parent, parent_scope);
}
perform_delayable_implementation_check(ce, child, child_scope, parent, parent_scope);
perform_delayable_implementation_check(ce, child, parent, parent_scope);
}
return INHERITANCE_SUCCESS;
}
/* }}} */
static zend_never_inline void do_inheritance_check_on_method(
zend_function *child, zend_class_entry *child_scope,
zend_function *parent, zend_class_entry *parent_scope,
zend_class_entry *ce, zval *child_zv, zend_bool check_visibility)
zend_function *child, zend_function *parent,
zend_class_entry *ce, zend_class_entry *parent_scope,
zval *child_zv, zend_bool check_visibility) /* {{{ */
{
do_inheritance_check_on_method_ex(child, child_scope, parent, parent_scope, ce, child_zv, check_visibility, 0, 0);
do_inheritance_check_on_method_ex(child, parent, ce, parent_scope, child_zv, check_visibility, 0, 0);
}
/* }}} */
static zend_always_inline void do_inherit_method(zend_string *key, zend_function *parent, zend_class_entry *ce, zend_bool is_interface, zend_bool checked) /* {{{ */
{
@@ -953,12 +952,11 @@ static zend_always_inline void do_inherit_method(zend_string *key, zend_function
if (checked) {
do_inheritance_check_on_method_ex(
func, func->common.scope, parent, parent->common.scope, ce, child,
func, parent, ce, parent->common.scope, child,
/* check_visibility */ 1, 0, checked);
} else {
do_inheritance_check_on_method(
func, func->common.scope, parent, parent->common.scope, ce, child,
/* check_visibility */ 1);
func, parent, ce, parent->common.scope, child, /* check_visibility */ 1);
}
} else {
@@ -1561,12 +1559,6 @@ static void zend_do_implement_interfaces(zend_class_entry *ce, zend_class_entry
}
/* }}} */
static zend_class_entry *fixup_trait_scope(const zend_function *fn, zend_class_entry *ce)
{
/* self in trait methods should be resolved to the using class, not the trait. */
return fn->common.scope->ce_flags & ZEND_ACC_TRAIT ? ce : fn->common.scope;
}
static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_string *key, zend_function *fn) /* {{{ */
{
zend_function *existing_fn = NULL;
@@ -1587,10 +1579,12 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_
* As such, "abstract protected" was sometimes used to indicate trait requirements,
* even though the "implementing" method was private. Do not check visibility
* requirements to maintain backwards-compatibility with such usage.
*
* The parent_scope passed here is not fn->common.scope, because we want "self" to be
* resolved against the using class, not the declaring trait.
*/
do_inheritance_check_on_method(
existing_fn, fixup_trait_scope(existing_fn, ce), fn, fixup_trait_scope(fn, ce),
ce, NULL, /* check_visibility */ 0);
existing_fn, fn, ce, /* parent_scope */ ce, NULL, /* check_visibility */ 0);
return;
}
@@ -1605,11 +1599,10 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_
ZSTR_VAL(ce->name), ZSTR_VAL(name),
ZSTR_VAL(existing_fn->common.scope->name), ZSTR_VAL(existing_fn->common.function_name));
} else {
/* Inherited members are overridden by members inserted by traits.
* Check whether the trait method fulfills the inheritance requirements. */
/* inherited members are overridden by members inserted by traits */
/* check whether the trait method fulfills the inheritance requirements */
do_inheritance_check_on_method(
fn, fixup_trait_scope(fn, ce), existing_fn, fixup_trait_scope(existing_fn, ce),
ce, NULL, /* check_visibility */ 1);
fn, existing_fn, ce, existing_fn->common.scope, NULL, /* check_visibility */ 1);
}
}
@@ -2195,7 +2188,6 @@ typedef struct {
* so use copies of functions here as well. */
zend_function parent_fn;
zend_function child_fn;
zend_class_entry *child_scope;
zend_class_entry *parent_scope;
};
struct {
@@ -2244,9 +2236,8 @@ static void add_dependency_obligation(zend_class_entry *ce, zend_class_entry *de
}
static void add_compatibility_obligation(
zend_class_entry *ce,
const zend_function *child_fn, zend_class_entry *child_scope,
const zend_function *parent_fn, zend_class_entry *parent_scope) {
zend_class_entry *ce, const zend_function *child_fn, const zend_function *parent_fn,
zend_class_entry *parent_scope) {
HashTable *obligations = get_or_init_obligations_for_class(ce);
variance_obligation *obligation = emalloc(sizeof(variance_obligation));
obligation->type = OBLIGATION_COMPATIBILITY;
@@ -2261,7 +2252,6 @@ static void add_compatibility_obligation(
} else {
memcpy(&obligation->parent_fn, parent_fn, sizeof(zend_op_array));
}
obligation->child_scope = child_scope;
obligation->parent_scope = parent_scope;
zend_hash_next_index_insert_ptr(obligations, obligation);
}
@@ -2291,16 +2281,14 @@ static int check_variance_obligation(zval *zv) {
}
} else if (obligation->type == OBLIGATION_COMPATIBILITY) {
inheritance_status status = zend_do_perform_implementation_check(
&obligation->child_fn, obligation->child_scope,
&obligation->parent_fn, obligation->parent_scope);
&obligation->child_fn, &obligation->parent_fn, obligation->parent_scope);
if (UNEXPECTED(status != INHERITANCE_SUCCESS)) {
if (EXPECTED(status == INHERITANCE_UNRESOLVED)) {
return ZEND_HASH_APPLY_KEEP;
}
ZEND_ASSERT(status == INHERITANCE_ERROR);
emit_incompatible_method_error(
&obligation->child_fn, obligation->child_scope,
&obligation->parent_fn, obligation->parent_scope, status);
&obligation->child_fn, &obligation->parent_fn, obligation->parent_scope, status);
}
/* Either the compatibility check was successful or only threw a warning. */
} else {
@@ -2367,12 +2355,10 @@ static void report_variance_errors(zend_class_entry *ce) {
/* Just used to populate the delayed_autoloads table,
* which will be used when printing the "unresolved" error. */
inheritance_status status = zend_do_perform_implementation_check(
&obligation->child_fn, obligation->child_scope,
&obligation->parent_fn, obligation->parent_scope);
&obligation->child_fn, &obligation->parent_fn, obligation->parent_scope);
ZEND_ASSERT(status == INHERITANCE_UNRESOLVED);
emit_incompatible_method_error(
&obligation->child_fn, obligation->child_scope,
&obligation->parent_fn, obligation->parent_scope, status);
&obligation->child_fn, &obligation->parent_fn, obligation->parent_scope, status);
} else if (obligation->type == OBLIGATION_PROPERTY_COMPATIBILITY) {
emit_incompatible_property_error(obligation->child_prop, obligation->parent_prop);
} else {
@@ -2498,9 +2484,8 @@ static inheritance_status zend_can_early_bind(zend_class_entry *ce, zend_class_e
zend_function *child_func = Z_FUNC_P(zv);
inheritance_status status =
do_inheritance_check_on_method_ex(
child_func, child_func->common.scope,
parent_func, parent_func->common.scope,
ce, NULL, /* check_visibility */ 1, 1, 0);
child_func, parent_func, ce, parent_func->common.scope, NULL,
/* check_visibility */ 1, 1, 0);
if (UNEXPECTED(status != INHERITANCE_SUCCESS)) {
return status;
+1 -1
View File
@@ -52,7 +52,7 @@ interface Serializable
public function serialize();
/** @return void */
public function unserialize(string $data);
public function unserialize(string $serialized);
}
interface Countable
+2 -2
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 29a5ed0b859b0732074c81cf9d26047a6eb9059a */
* Stub hash: 1aa9ef81a738328a334176d37683646b60b2f6fa */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IteratorAggregate_getIterator, 0, 0, 0)
ZEND_END_ARG_INFO()
@@ -30,7 +30,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_Serializable_serialize arginfo_class_IteratorAggregate_getIterator
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Serializable_unserialize, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_Countable_count arginfo_class_IteratorAggregate_getIterator
+2 -3
View File
@@ -772,10 +772,11 @@ found:
} else {
ZEND_ASSERT(!IS_WRONG_PROPERTY_OFFSET(property_offset));
write_std_property:
Z_TRY_ADDREF_P(value);
if (EXPECTED(IS_VALID_PROPERTY_OFFSET(property_offset))) {
variable_ptr = OBJ_PROP(zobj, property_offset);
Z_TRY_ADDREF_P(value);
if (UNEXPECTED(prop_info)) {
ZVAL_COPY_VALUE(&tmp, value);
if (UNEXPECTED(!zend_verify_property_type(prop_info, &tmp, property_uses_strict_types()))) {
@@ -793,8 +794,6 @@ write_std_property:
variable_ptr = &EG(error_zval);
goto exit;
}
Z_TRY_ADDREF_P(value);
if (!zobj->properties) {
rebuild_object_properties(zobj);
}
+12 -13
View File
@@ -950,7 +950,7 @@ static ZEND_COLD zend_never_inline void ZEND_FASTCALL zend_binop_error(const cha
static zend_never_inline void ZEND_FASTCALL add_function_array(zval *result, zval *op1, zval *op2) /* {{{ */
{
if (result == op1 && Z_ARR_P(op1) == Z_ARR_P(op2)) {
if ((result == op1) && (result == op2)) {
/* $a += $a */
return;
}
@@ -1253,9 +1253,7 @@ ZEND_API zend_result ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *o
}
/* }}} */
/* Returns SUCCESS/FAILURE/TYPES_NOT_HANDLED */
#define TYPES_NOT_HANDLED 1
static int ZEND_FASTCALL div_function_base(zval *result, zval *op1, zval *op2) /* {{{ */
static zend_result ZEND_FASTCALL div_function_base(zval *result, zval *op1, zval *op2) /* {{{ */
{
zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2));
@@ -1292,14 +1290,14 @@ static int ZEND_FASTCALL div_function_base(zval *result, zval *op1, zval *op2) /
ZVAL_DOUBLE(result, (double)Z_LVAL_P(op1) / Z_DVAL_P(op2));
return SUCCESS;
} else {
return TYPES_NOT_HANDLED;
return FAILURE;
}
division_by_0:
if (result != op1) {
ZVAL_UNDEF(result);
}
zend_throw_error(zend_ce_division_by_zero_error, "Division by zero");
return FAILURE;
return SUCCESS;
}
/* }}} */
@@ -1307,10 +1305,8 @@ ZEND_API zend_result ZEND_FASTCALL div_function(zval *result, zval *op1, zval *o
{
ZVAL_DEREF(op1);
ZVAL_DEREF(op2);
int retval = div_function_base(result, op1, op2);
if (retval != TYPES_NOT_HANDLED) {
return retval;
if (div_function_base(result, op1, op2) == SUCCESS) {
return SUCCESS;
}
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_DIV);
@@ -1329,9 +1325,12 @@ ZEND_API zend_result ZEND_FASTCALL div_function(zval *result, zval *op1, zval *o
zval_ptr_dtor(result);
}
retval = div_function_base(result, &op1_copy, &op2_copy);
ZEND_ASSERT(retval != TYPES_NOT_HANDLED && "Types should be handled");
return retval;
if (div_function_base(result, &op1_copy, &op2_copy) == SUCCESS) {
return SUCCESS;
}
ZEND_ASSERT(0 && "Operation must succeed");
return FAILURE;
}
/* }}} */
+1 -4
View File
@@ -492,7 +492,6 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
HANDLE hFind = INVALID_HANDLE_VALUE;
ALLOCA_FLAG(use_heap_large)
wchar_t *pathw = NULL;
int may_retry_reparse_point;
#define FREE_PATHW() \
do { free(pathw); } while(0);
@@ -592,7 +591,6 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
#ifdef ZEND_WIN32
retry_reparse_point:
may_retry_reparse_point = 0;
if (save) {
pathw = php_win32_ioutil_any_to_w(path);
if (!pathw) {
@@ -687,7 +685,6 @@ retry_reparse_tag_cloud:
CloseHandle(hLink);
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
may_retry_reparse_point = 1;
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
isabsolute = pbuffer->SymbolicLinkReparseBuffer.Flags == 0;
#if VIRTUAL_CWD_DEBUG
@@ -824,7 +821,7 @@ retry_reparse_tag_cloud:
free_alloca(pbuffer, use_heap_large);
free(substitutename);
if (may_retry_reparse_point) {
{
DWORD attrs;
FREE_PATHW()
+13 -31
View File
@@ -4195,11 +4195,8 @@ ZEND_VM_COLD_CONST_HANDLER(124, ZEND_VERIFY_RETURN_TYPE, CONST|TMP|VAR|UNUSED|CV
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) {
SAVE_OPLINE();
retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1();
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) {
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
}
@@ -6487,7 +6484,14 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET_R, CONST|TMP|VAR|CV, JMP_ADDR)
} else if (OP1_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
zend_object *zobj = Z_OBJ_P(array_ptr);
if (!zobj->ce->get_iterator) {
HashTable *properties = zobj->properties;
HashTable *properties;
result = EX_VAR(opline->result.var);
ZVAL_OBJ(result, zobj);
if (OP1_TYPE != IS_TMP_VAR) {
GC_ADDREF(zobj);
}
properties = zobj->properties;
if (properties) {
if (UNEXPECTED(GC_REFCOUNT(properties) > 1)) {
if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) {
@@ -6498,20 +6502,8 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET_R, CONST|TMP|VAR|CV, JMP_ADDR)
} else {
properties = zobj->handlers->get_properties(zobj);
}
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
result = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(result, array_ptr);
if (OP1_TYPE != IS_TMP_VAR) {
Z_ADDREF_P(array_ptr);
}
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(result) = (uint32_t) -1;
FREE_OP1_IF_VAR();
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
FREE_OP1_IF_VAR();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
@@ -6577,7 +6569,6 @@ ZEND_VM_COLD_CONST_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR)
ZEND_VM_NEXT_OPCODE();
} else if (OP1_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
HashTable *properties;
if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) {
if (array_ptr == array_ref) {
ZVAL_NEW_REF(array_ref, array_ref);
@@ -6596,15 +6587,8 @@ ZEND_VM_COLD_CONST_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR)
}
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
}
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
properties = Z_OBJPROP_P(array_ptr);
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
FREE_OP1_VAR_PTR();
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
@@ -7704,9 +7688,6 @@ ZEND_VM_HELPER(zend_dispatch_try_catch_finally_helper, ANY, ANY, uint32_t try_ca
}
/* Uncaught exception */
if (zend_observer_fcall_op_array_extension != -1) {
zend_observer_fcall_end(execute_data, EX(return_value));
}
cleanup_live_vars(execute_data, op_num, 0);
if (UNEXPECTED((EX_CALL_INFO() & ZEND_CALL_GENERATOR) != 0)) {
zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C);
@@ -7721,7 +7702,7 @@ ZEND_VM_HELPER(zend_dispatch_try_catch_finally_helper, ANY, ANY, uint32_t try_ca
}
}
ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY, SPEC(OBSERVER))
{
const zend_op *throw_op = EG(opline_before_exception);
uint32_t throw_op_num = throw_op - EX(func)->op_array.opcodes;
@@ -7750,6 +7731,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
}
}
ZEND_OBSERVER_FCALL_END(execute_data, EX(return_value));
cleanup_unfinished_calls(execute_data, throw_op_num);
if (throw_op->result_type & (IS_VAR | IS_TMP_VAR)) {
+186 -201
View File
@@ -2894,9 +2894,6 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_dispatch_try
}
/* Uncaught exception */
if (zend_observer_fcall_op_array_extension != -1) {
zend_observer_fcall_end(execute_data, EX(return_value));
}
cleanup_live_vars(execute_data, op_num, 0);
if (UNEXPECTED((EX_CALL_INFO() & ZEND_CALL_GENERATOR) != 0)) {
zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C);
@@ -2965,6 +2962,61 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
ZEND_VM_TAIL_CALL(zend_dispatch_try_catch_finally_helper_SPEC(current_try_catch_offset, throw_op_num ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
const zend_op *throw_op = EG(opline_before_exception);
uint32_t throw_op_num = throw_op - EX(func)->op_array.opcodes;
int i, current_try_catch_offset = -1;
if ((throw_op->opcode == ZEND_FREE || throw_op->opcode == ZEND_FE_FREE)
&& throw_op->extended_value & ZEND_FREE_ON_RETURN) {
/* exceptions thrown because of loop var destruction on return/break/...
* are logically thrown at the end of the foreach loop, so adjust the
* throw_op_num.
*/
const zend_live_range *range = find_live_range(
&EX(func)->op_array, throw_op_num, throw_op->op1.var);
throw_op_num = range->end;
}
/* Find the innermost try/catch/finally the exception was thrown in */
for (i = 0; i < EX(func)->op_array.last_try_catch; i++) {
zend_try_catch_element *try_catch = &EX(func)->op_array.try_catch_array[i];
if (try_catch->try_op > throw_op_num) {
/* further blocks will not be relevant... */
break;
}
if (throw_op_num < try_catch->catch_op || throw_op_num < try_catch->finally_end) {
current_try_catch_offset = i;
}
}
zend_observer_fcall_end(execute_data, EX(return_value));
cleanup_unfinished_calls(execute_data, throw_op_num);
if (throw_op->result_type & (IS_VAR | IS_TMP_VAR)) {
switch (throw_op->opcode) {
case ZEND_ADD_ARRAY_ELEMENT:
case ZEND_ADD_ARRAY_UNPACK:
case ZEND_ROPE_INIT:
case ZEND_ROPE_ADD:
break; /* exception while building structures, live range handling will free those */
case ZEND_FETCH_CLASS:
case ZEND_DECLARE_ANON_CLASS:
break; /* return value is zend_class_entry pointer */
default:
/* smart branch opcodes may not initialize result */
if (!zend_is_smart_branch(throw_op)) {
zval_ptr_dtor_nogc(EX_VAR(throw_op->result.var));
}
}
}
ZEND_VM_TAIL_CALL(zend_dispatch_try_catch_finally_helper_SPEC(current_try_catch_offset, throw_op_num ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -4793,7 +4845,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER(
} else if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
zend_object *zobj = Z_OBJ_P(array_ptr);
if (!zobj->ce->get_iterator) {
HashTable *properties = zobj->properties;
HashTable *properties;
result = EX_VAR(opline->result.var);
ZVAL_OBJ(result, zobj);
if (IS_CONST != IS_TMP_VAR) {
GC_ADDREF(zobj);
}
properties = zobj->properties;
if (properties) {
if (UNEXPECTED(GC_REFCOUNT(properties) > 1)) {
if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) {
@@ -4804,20 +4863,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER(
} else {
properties = zobj->handlers->get_properties(zobj);
}
result = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(result, array_ptr);
if (IS_CONST != IS_TMP_VAR) {
Z_ADDREF_P(array_ptr);
}
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(result) = (uint32_t) -1;
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
@@ -4882,7 +4928,6 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_
ZEND_VM_NEXT_OPCODE();
} else if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
HashTable *properties;
if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
if (array_ptr == array_ref) {
ZVAL_NEW_REF(array_ref, array_ref);
@@ -4901,15 +4946,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_
}
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
}
properties = Z_OBJPROP_P(array_ptr);
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
@@ -9707,11 +9744,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYP
if (IS_CONST == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) {
SAVE_OPLINE();
retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1();
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) {
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
}
@@ -18806,7 +18840,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_TMP_HANDLER(ZE
} else if (IS_TMP_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
zend_object *zobj = Z_OBJ_P(array_ptr);
if (!zobj->ce->get_iterator) {
HashTable *properties = zobj->properties;
HashTable *properties;
result = EX_VAR(opline->result.var);
ZVAL_OBJ(result, zobj);
if (IS_TMP_VAR != IS_TMP_VAR) {
GC_ADDREF(zobj);
}
properties = zobj->properties;
if (properties) {
if (UNEXPECTED(GC_REFCOUNT(properties) > 1)) {
if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) {
@@ -18817,20 +18858,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_TMP_HANDLER(ZE
} else {
properties = zobj->handlers->get_properties(zobj);
}
result = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(result, array_ptr);
if (IS_TMP_VAR != IS_TMP_VAR) {
Z_ADDREF_P(array_ptr);
}
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(result) = (uint32_t) -1;
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
@@ -18896,7 +18924,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z
ZEND_VM_NEXT_OPCODE();
} else if (IS_TMP_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
HashTable *properties;
if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
if (array_ptr == array_ref) {
ZVAL_NEW_REF(array_ref, array_ref);
@@ -18915,15 +18942,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z
}
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
}
properties = Z_OBJPROP_P(array_ptr);
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
@@ -20054,11 +20073,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_TMP_UN
if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) {
SAVE_OPLINE();
retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1();
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) {
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
}
@@ -21374,7 +21390,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_VAR_HANDLER(ZE
} else if (IS_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
zend_object *zobj = Z_OBJ_P(array_ptr);
if (!zobj->ce->get_iterator) {
HashTable *properties = zobj->properties;
HashTable *properties;
result = EX_VAR(opline->result.var);
ZVAL_OBJ(result, zobj);
if (IS_VAR != IS_TMP_VAR) {
GC_ADDREF(zobj);
}
properties = zobj->properties;
if (properties) {
if (UNEXPECTED(GC_REFCOUNT(properties) > 1)) {
if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) {
@@ -21385,20 +21408,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_VAR_HANDLER(ZE
} else {
properties = zobj->handlers->get_properties(zobj);
}
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
result = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(result, array_ptr);
if (IS_VAR != IS_TMP_VAR) {
Z_ADDREF_P(array_ptr);
}
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(result) = (uint32_t) -1;
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
@@ -21464,7 +21475,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z
ZEND_VM_NEXT_OPCODE();
} else if (IS_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
HashTable *properties;
if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
if (array_ptr == array_ref) {
ZVAL_NEW_REF(array_ref, array_ref);
@@ -21483,15 +21493,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z
}
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
}
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
properties = Z_OBJPROP_P(array_ptr);
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
@@ -27662,11 +27665,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UN
if (IS_VAR == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) {
SAVE_OPLINE();
retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1();
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) {
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
}
@@ -34862,11 +34862,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_UNUSED
if (IS_UNUSED == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) {
SAVE_OPLINE();
retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1();
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) {
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
}
@@ -38095,7 +38092,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEN
} else if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
zend_object *zobj = Z_OBJ_P(array_ptr);
if (!zobj->ce->get_iterator) {
HashTable *properties = zobj->properties;
HashTable *properties;
result = EX_VAR(opline->result.var);
ZVAL_OBJ(result, zobj);
if (IS_CV != IS_TMP_VAR) {
GC_ADDREF(zobj);
}
properties = zobj->properties;
if (properties) {
if (UNEXPECTED(GC_REFCOUNT(properties) > 1)) {
if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) {
@@ -38106,20 +38110,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEN
} else {
properties = zobj->handlers->get_properties(zobj);
}
result = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(result, array_ptr);
if (IS_CV != IS_TMP_VAR) {
Z_ADDREF_P(array_ptr);
}
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(result) = (uint32_t) -1;
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
@@ -38184,7 +38175,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE
ZEND_VM_NEXT_OPCODE();
} else if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
HashTable *properties;
if (IS_CV == IS_VAR || IS_CV == IS_CV) {
if (array_ptr == array_ref) {
ZVAL_NEW_REF(array_ref, array_ref);
@@ -38203,15 +38193,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE
}
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
}
properties = Z_OBJPROP_P(array_ptr);
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
@@ -46557,11 +46539,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_CV_UNU
if (IS_CV == IS_CV && UNEXPECTED(Z_ISUNDEF_P(retval_ptr))) {
SAVE_OPLINE();
retval_ref = retval_ptr = ZVAL_UNDEFINED_OP1();
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_NULL) {
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
}
@@ -53110,6 +53089,7 @@ ZEND_API void execute_ex(zend_execute_data *ex)
(void*)&&ZEND_NULL_LABEL,
(void*)&&ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_LABEL,
(void*)&&ZEND_HANDLE_EXCEPTION_SPEC_LABEL,
(void*)&&ZEND_HANDLE_EXCEPTION_SPEC_OBSERVER_LABEL,
(void*)&&ZEND_USER_OPCODE_SPEC_LABEL,
(void*)&&ZEND_ASSERT_CHECK_SPEC_LABEL,
(void*)&&ZEND_JMP_SET_SPEC_CONST_LABEL,
@@ -54565,6 +54545,10 @@ zend_leave_helper_SPEC_LABEL:
VM_TRACE(ZEND_HANDLE_EXCEPTION_SPEC)
ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_HANDLE_EXCEPTION_SPEC_OBSERVER):
VM_TRACE(ZEND_HANDLE_EXCEPTION_SPEC_OBSERVER)
ZEND_HANDLE_EXCEPTION_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_USER_OPCODE_SPEC):
VM_TRACE(ZEND_USER_OPCODE_SPEC)
ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -61117,6 +61101,7 @@ void zend_vm_init(void)
ZEND_NULL_HANDLER,
ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER,
ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
ZEND_HANDLE_EXCEPTION_SPEC_OBSERVER_HANDLER,
ZEND_USER_OPCODE_SPEC_HANDLER,
ZEND_ASSERT_CHECK_SPEC_HANDLER,
ZEND_JMP_SET_SPEC_CONST_HANDLER,
@@ -62397,31 +62382,30 @@ void zend_vm_init(void)
2294,
2295,
2296 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
2321,
2322,
2321 | SPEC_RULE_OBSERVER,
2323,
2324 | SPEC_RULE_OP1,
2329,
2330 | SPEC_RULE_ISSET,
2332 | SPEC_RULE_OP2,
2337,
2338 | SPEC_RULE_OP1,
2343 | SPEC_RULE_OBSERVER,
2345,
2346 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
2371 | SPEC_RULE_OP1 | SPEC_RULE_OBSERVER,
2381,
2324,
2325 | SPEC_RULE_OP1,
2330,
2331 | SPEC_RULE_ISSET,
2333 | SPEC_RULE_OP2,
2338,
2339 | SPEC_RULE_OP1,
2344 | SPEC_RULE_OBSERVER,
2346,
2347 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
2372 | SPEC_RULE_OP1 | SPEC_RULE_OBSERVER,
2382,
2383,
2384,
2385 | SPEC_RULE_OP1,
2390,
2385,
2386 | SPEC_RULE_OP1,
2391,
2392 | SPEC_RULE_OP1,
2397 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
2422,
2423 | SPEC_RULE_OP1,
2428,
2392,
2393 | SPEC_RULE_OP1,
2398 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
2423,
2424 | SPEC_RULE_OP1,
2429,
2430,
2431,
@@ -62429,26 +62413,27 @@ void zend_vm_init(void)
2433,
2434,
2435,
2436 | SPEC_RULE_OP1,
2441,
2436,
2437 | SPEC_RULE_OP1,
2442,
2443,
2444 | SPEC_RULE_OP2,
2449,
2450 | SPEC_RULE_OP1,
2455 | SPEC_RULE_OP1,
2460 | SPEC_RULE_OP1,
2465 | SPEC_RULE_OP1,
2470 | SPEC_RULE_OP1,
2475,
2476 | SPEC_RULE_OP1,
2481 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
2506 | SPEC_RULE_OP1,
2511 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
2536 | SPEC_RULE_OP1,
2541 | SPEC_RULE_OP1,
2546,
3450
2444,
2445 | SPEC_RULE_OP2,
2450,
2451 | SPEC_RULE_OP1,
2456 | SPEC_RULE_OP1,
2461 | SPEC_RULE_OP1,
2466 | SPEC_RULE_OP1,
2471 | SPEC_RULE_OP1,
2476,
2477 | SPEC_RULE_OP1,
2482 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
2507 | SPEC_RULE_OP1,
2512 | SPEC_RULE_OP1 | SPEC_RULE_OP2,
2537 | SPEC_RULE_OP1,
2542 | SPEC_RULE_OP1,
2547,
3451
};
#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
zend_opcode_handler_funcs = labels;
@@ -62621,7 +62606,7 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2549 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
spec = 2550 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
if (op->op1_type < op->op2_type) {
zend_swap_operands(op);
}
@@ -62629,7 +62614,7 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2574 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
spec = 2575 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
if (op->op1_type < op->op2_type) {
zend_swap_operands(op);
}
@@ -62637,7 +62622,7 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2599 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
spec = 2600 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
if (op->op1_type < op->op2_type) {
zend_swap_operands(op);
}
@@ -62648,17 +62633,17 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2624 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
spec = 2625 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
} else if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2649 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
spec = 2650 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2674 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
spec = 2675 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
}
break;
case ZEND_MUL:
@@ -62669,17 +62654,17 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2699 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
spec = 2700 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2724 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
spec = 2725 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2749 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
spec = 2750 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
}
break;
case ZEND_IS_IDENTICAL:
@@ -62690,14 +62675,14 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2774 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
spec = 2775 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2849 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
spec = 2850 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op->op1_type == IS_CV && (op->op2_type & (IS_CONST|IS_CV)) && !(op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) && !(op2_info & (MAY_BE_UNDEF|MAY_BE_REF))) {
spec = 3074 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
spec = 3075 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
}
break;
case ZEND_IS_NOT_IDENTICAL:
@@ -62708,14 +62693,14 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2924 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
spec = 2925 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2999 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
spec = 3000 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op->op1_type == IS_CV && (op->op2_type & (IS_CONST|IS_CV)) && !(op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) && !(op2_info & (MAY_BE_UNDEF|MAY_BE_REF))) {
spec = 3079 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
spec = 3080 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE;
}
break;
case ZEND_IS_EQUAL:
@@ -62726,12 +62711,12 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2774 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
spec = 2775 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2849 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
spec = 2850 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
}
break;
case ZEND_IS_NOT_EQUAL:
@@ -62742,12 +62727,12 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2924 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
spec = 2925 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 2999 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
spec = 3000 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE;
}
break;
case ZEND_IS_SMALLER:
@@ -62755,12 +62740,12 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 3084 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
spec = 3085 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 3159 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
spec = 3160 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
}
break;
case ZEND_IS_SMALLER_OR_EQUAL:
@@ -62768,74 +62753,74 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 3234 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
spec = 3235 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
} else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) {
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 3309 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
spec = 3310 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH;
}
break;
case ZEND_QM_ASSIGN:
if (op1_info == MAY_BE_LONG) {
spec = 3396 | SPEC_RULE_OP1;
spec = 3397 | SPEC_RULE_OP1;
} else if (op1_info == MAY_BE_DOUBLE) {
spec = 3401 | SPEC_RULE_OP1;
spec = 3402 | SPEC_RULE_OP1;
} else if ((op->op1_type == IS_CONST) ? !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1)) : (!(op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE))))) {
spec = 3406 | SPEC_RULE_OP1;
spec = 3407 | SPEC_RULE_OP1;
}
break;
case ZEND_PRE_INC:
if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) {
spec = 3384 | SPEC_RULE_RETVAL;
spec = 3385 | SPEC_RULE_RETVAL;
} else if (op1_info == MAY_BE_LONG) {
spec = 3386 | SPEC_RULE_RETVAL;
spec = 3387 | SPEC_RULE_RETVAL;
}
break;
case ZEND_PRE_DEC:
if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) {
spec = 3388 | SPEC_RULE_RETVAL;
spec = 3389 | SPEC_RULE_RETVAL;
} else if (op1_info == MAY_BE_LONG) {
spec = 3390 | SPEC_RULE_RETVAL;
spec = 3391 | SPEC_RULE_RETVAL;
}
break;
case ZEND_POST_INC:
if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) {
spec = 3392;
} else if (op1_info == MAY_BE_LONG) {
spec = 3393;
} else if (op1_info == MAY_BE_LONG) {
spec = 3394;
}
break;
case ZEND_POST_DEC:
if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) {
spec = 3394;
} else if (op1_info == MAY_BE_LONG) {
spec = 3395;
} else if (op1_info == MAY_BE_LONG) {
spec = 3396;
}
break;
case ZEND_JMP:
if (OP_JMP_ADDR(op, op->op1) > op) {
spec = 2548;
spec = 2549;
}
break;
case ZEND_RECV:
if (op->op2.num == MAY_BE_ANY) {
spec = 2547;
spec = 2548;
}
break;
case ZEND_SEND_VAL:
if (op->op1_type == IS_CONST && op->op2_type == IS_UNUSED && !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1))) {
spec = 3446;
spec = 3447;
}
break;
case ZEND_SEND_VAR_EX:
if (op->op2_type == IS_UNUSED && op->op2.num <= MAX_ARG_FLAG_NUM && (op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) == 0) {
spec = 3441 | SPEC_RULE_OP1;
spec = 3442 | SPEC_RULE_OP1;
}
break;
case ZEND_FE_FETCH_R:
if (op->op2_type == IS_CV && (op1_info & (MAY_BE_ANY|MAY_BE_REF)) == MAY_BE_ARRAY) {
spec = 3448 | SPEC_RULE_RETVAL;
spec = 3449 | SPEC_RULE_RETVAL;
}
break;
case ZEND_FETCH_DIM_R:
@@ -62843,17 +62828,17 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t
if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {
break;
}
spec = 3411 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
spec = 3412 | SPEC_RULE_OP1 | SPEC_RULE_OP2;
}
break;
case ZEND_SEND_VAL_EX:
if (op->op2_type == IS_UNUSED && op->op2.num <= MAX_ARG_FLAG_NUM && op->op1_type == IS_CONST && !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1))) {
spec = 3447;
spec = 3448;
}
break;
case ZEND_SEND_VAR:
if (op->op2_type == IS_UNUSED && (op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) == 0) {
spec = 3436 | SPEC_RULE_OP1;
spec = 3437 | SPEC_RULE_OP1;
}
break;
case ZEND_BW_OR:
+603 -602
View File
File diff suppressed because it is too large. Load diff
+1 -12
View File
@@ -3,7 +3,6 @@ trigger:
branches:
include:
- PHP-7.4
- PHP-8.0
- master
paths:
exclude:
@@ -12,15 +11,6 @@ trigger:
- UPGRADING
- UPGRADING.INTERNALS
schedules:
- cron: "0 1 * * *"
displayName: Nightly build
branches:
include:
- PHP-7.4
- PHP-8.0
- master
jobs:
- template: azure/job.yml
parameters:
@@ -84,7 +74,7 @@ jobs:
parameters:
configurationName: DEBUG_ZTS_MSAN
configurationParameters: '--enable-debug --enable-zts'
runTestsParameters: --msan
runTestsParameters: --asan
timeoutInMinutes: 90
- template: azure/community_job.yml
parameters:
@@ -102,4 +92,3 @@ jobs:
parameters:
configurationName: DEBUG_NTS_FILE_CACHE
configurationParameters: '--enable-debug --disable-zts'
timeoutInMinutes: 90
+11 -8
View File
@@ -51,22 +51,25 @@ jobs:
- script: |
git clone https://github.com/laravel/framework.git --branch=master --depth=1
cd framework
#php7.3 /usr/bin/composer require "doctrine/dbal:^3.0" --no-interaction
php7.3 /usr/bin/composer install --no-progress
# Hack to disable a test that hangs on azure
sed -i 's/PHP_OS/"Darwin"/' tests/Filesystem/FilesystemTest.php
export USE_ZEND_ALLOC=0
export ASAN_OPTIONS=exitcode=139
sed -i 's/$exit = true/$exit = false/g' vendor/phpunit/phpunit/src/TextUI/Command.php
# Avoid test using exit(), which thus leaks.
# We can use USE_TRACKED_ALLOC=1 if more of these show up.
sed -i "s/function_exists('pcntl_fork')/false/" tests/Filesystem/FilesystemTest.php
# Work around PHP 8 incompatibility in Doctrine
sed -i 's/function query()/function query(...$args)/' vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
sed -i 's/function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)/function setFetchMode($fetchMode, $arg2 = null, $arg3 = null, ...$args)/' vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php
sed -i 's/public function getMessage();//' vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/DriverException.php
php vendor/bin/phpunit
if [ $? -gt 128 ]; then
exit 1
fi
displayName: 'Test Laravel'
- script: |
git clone https://github.com/symfony/symfony.git --depth=1
git clone https://github.com/symfony/symfony.git --branch=master --depth=1
cd symfony
php7.3 /usr/bin/composer install --no-progress
php7.3 ./phpunit install
# Work around PHP 8 incompatibility in Doctrine
sed -i 's/function query()/function query(...$args)/' vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
export USE_ZEND_ALLOC=0
export USE_TRACKED_ALLOC=1
export ASAN_OPTIONS=exitcode=139
+147 -424
View File
@@ -12,12 +12,7 @@ use PhpParser\PrettyPrinterAbstract;
error_reporting(E_ALL);
/**
* @return FileInfo[]
*/
function processDirectory(string $dir, Context $context): array {
$fileInfos = [];
function processDirectory(string $dir, Context $context) {
$it = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($dir),
RecursiveIteratorIterator::LEAVES_ONLY
@@ -25,51 +20,40 @@ function processDirectory(string $dir, Context $context): array {
foreach ($it as $file) {
$pathName = $file->getPathName();
if (preg_match('/\.stub\.php$/', $pathName)) {
$fileInfo = processStubFile($pathName, $context);
if ($fileInfo) {
$fileInfos[] = $fileInfo;
}
processStubFile($pathName, $context);
}
}
return $fileInfos;
}
function processStubFile(string $stubFile, Context $context): ?FileInfo {
function processStubFile(string $stubFile, Context $context) {
try {
if (!file_exists($stubFile)) {
throw new Exception("File $stubFile does not exist");
}
$arginfoFile = str_replace('.stub.php', '_arginfo.h', $stubFile);
$legacyFile = str_replace('.stub.php', '_legacy_arginfo.h', $stubFile);
$arginfoFile = str_replace('.stub.php', '', $stubFile) . '_arginfo.h';
$stubCode = file_get_contents($stubFile);
$stubHash = computeStubHash($stubCode);
$oldStubHash = extractStubHash($arginfoFile);
if ($stubHash === $oldStubHash && !$context->forceParse) {
if ($stubHash === $oldStubHash && $context->forceRegeneration === false) {
/* Stub file did not change, do not regenerate. */
return null;
return;
}
initPhpParser();
$fileInfo = parseStubFile($stubCode);
$arginfoCode = generateArgInfoCode($fileInfo, $stubHash);
if (($context->forceRegeneration || $stubHash !== $oldStubHash) && file_put_contents($arginfoFile, $arginfoCode)) {
echo "Saved $arginfoFile\n";
file_put_contents($arginfoFile, $arginfoCode);
// Collect parameter name statistics.
foreach ($fileInfo->getAllFuncInfos() as $funcInfo) {
foreach ($funcInfo->args as $argInfo) {
if (!isset($context->parameterStats[$argInfo->name])) {
$context->parameterStats[$argInfo->name] = 0;
}
$context->parameterStats[$argInfo->name]++;
}
}
if ($fileInfo->generateLegacyArginfo) {
foreach ($fileInfo->getAllFuncInfos() as $funcInfo) {
$funcInfo->discardInfoForOldPhpVersions();
}
$arginfoCode = generateArgInfoCode($fileInfo, $stubHash);
if (($context->forceRegeneration || $stubHash !== $oldStubHash) && file_put_contents($legacyFile, $arginfoCode)) {
echo "Saved $legacyFile\n";
}
}
return $fileInfo;
} catch (Exception $e) {
echo "In $stubFile:\n{$e->getMessage()}\n";
exit(1);
@@ -94,10 +78,10 @@ function extractStubHash(string $arginfoFile): ?string {
}
class Context {
/** @var bool */
public $forceParse = false;
/** @var bool */
public $forceRegeneration = false;
/** @var array */
public $parameterStats = [];
}
class SimpleType {
@@ -113,11 +97,6 @@ class SimpleType {
public static function fromNode(Node $node) {
if ($node instanceof Node\Name) {
if ($node->toLowerString() === 'static') {
// PHP internally considers "static" a builtin type.
return new SimpleType($node->toString(), true);
}
assert($node->isFullyQualified());
return new SimpleType($node->toString(), false);
}
@@ -154,8 +133,6 @@ class SimpleType {
return "IS_ITERABLE";
case "mixed":
return "IS_MIXED";
case "static":
return "IS_STATIC";
default:
throw new Exception("Not implemented: $this->name");
}
@@ -184,8 +161,6 @@ class SimpleType {
return "MAY_BE_CALLABLE";
case "mixed":
return "MAY_BE_ANY";
case "static":
return "MAY_BE_STATIC";
default:
throw new Exception("Not implemented: $this->name");
}
@@ -355,104 +330,30 @@ class ArgInfo {
}
}
interface FunctionOrMethodName {
public function getDeclaration(): string;
public function getArgInfoName(): string;
public function __toString(): string;
public function isMethod(): bool;
public function isConstructor(): bool;
public function isDestructor(): bool;
}
class FunctionName {
/** @var string|null */
public $className;
/** @var string */
public $name;
class FunctionName implements FunctionOrMethodName {
/** @var Name */
private $name;
public function __construct(Name $name) {
public function __construct(?string $className, string $name)
{
$this->className = $className;
$this->name = $name;
}
public function getNamespace(): ?string {
if ($this->name->isQualified()) {
return $this->name->slice(0, -1)->toString();
public function getDeclaration(): string
{
if ($this->className) {
return "ZEND_METHOD($this->className, $this->name);\n";
}
return null;
return "ZEND_FUNCTION($this->name);\n";
}
public function getNonNamespacedName(): string {
if ($this->name->isQualified()) {
throw new Exception("Namespaced name not supported here");
}
return $this->name->toString();
}
public function getDeclarationName(): string {
return $this->name->getLast();
}
public function getDeclaration(): string {
return "ZEND_FUNCTION({$this->getDeclarationName()});\n";
}
public function getArgInfoName(): string {
$underscoreName = implode('_', $this->name->parts);
return "arginfo_$underscoreName";
}
public function __toString(): string {
return $this->name->toString();
}
public function isMethod(): bool {
return false;
}
public function isConstructor(): bool {
return false;
}
public function isDestructor(): bool {
return false;
}
}
class MethodName implements FunctionOrMethodName {
/** @var Name */
private $className;
/** @var string */
public $methodName;
public function __construct(Name $className, string $methodName) {
$this->className = $className;
$this->methodName = $methodName;
}
public function getDeclarationClassName(): string {
return implode('_', $this->className->parts);
}
public function getDeclaration(): string {
return "ZEND_METHOD({$this->getDeclarationClassName()}, $this->methodName);\n";
}
public function getArgInfoName(): string {
return "arginfo_class_{$this->getDeclarationClassName()}_{$this->methodName}";
}
public function __toString(): string {
return "$this->className::$this->methodName";
}
public function isMethod(): bool {
return true;
}
public function isConstructor(): bool {
return $this->methodName === "__construct";
}
public function isDestructor(): bool {
return $this->methodName === "__destruct";
public function __toString()
{
return $this->className ? "$this->className::$this->name" : $this->name;
}
}
@@ -474,11 +375,9 @@ class ReturnInfo {
}
class FuncInfo {
/** @var FunctionOrMethodName */
/** @var FunctionName */
public $name;
/** @var int */
public $classFlags;
/** @var int */
public $flags;
/** @var string|null */
public $aliasType;
@@ -486,8 +385,6 @@ class FuncInfo {
public $alias;
/** @var bool */
public $isDeprecated;
/** @var bool */
public $verify;
/** @var ArgInfo[] */
public $args;
/** @var ReturnInfo */
@@ -498,46 +395,27 @@ class FuncInfo {
public $cond;
public function __construct(
FunctionOrMethodName $name,
int $classFlags,
FunctionName $name,
int $flags,
?string $aliasType,
?FunctionOrMethodName $alias,
?FunctionName $alias,
bool $isDeprecated,
bool $verify,
array $args,
ReturnInfo $return,
int $numRequiredArgs,
?string $cond
) {
$this->name = $name;
$this->classFlags = $classFlags;
$this->flags = $flags;
$this->aliasType = $aliasType;
$this->alias = $alias;
$this->isDeprecated = $isDeprecated;
$this->verify = $verify;
$this->args = $args;
$this->return = $return;
$this->numRequiredArgs = $numRequiredArgs;
$this->cond = $cond;
}
public function isMethod(): bool
{
return $this->name->isMethod();
}
public function isFinalMethod(): bool
{
return ($this->flags & Class_::MODIFIER_FINAL) || ($this->classFlags & Class_::MODIFIER_FINAL);
}
public function isInstanceMethod(): bool
{
return !($this->flags & Class_::MODIFIER_STATIC) && $this->isMethod() && !$this->name->isConstructor();
}
public function equalsApartFromName(FuncInfo $other): bool {
if (count($this->args) !== count($other->args)) {
return false;
@@ -555,7 +433,10 @@ class FuncInfo {
}
public function getArgInfoName(): string {
return $this->name->getArgInfoName();
if ($this->name->className) {
return 'arginfo_class_' . $this->name->className . '_' . $this->name->name;
}
return 'arginfo_' . $this->name->name;
}
public function getDeclarationKey(): string
@@ -577,71 +458,52 @@ class FuncInfo {
}
public function getFunctionEntry(): string {
if ($this->name instanceof MethodName) {
if ($this->name->className) {
if ($this->alias) {
if ($this->alias instanceof MethodName) {
if ($this->alias->className) {
return sprintf(
"\tZEND_MALIAS(%s, %s, %s, %s, %s)\n",
$this->alias->getDeclarationClassName(), $this->name->methodName,
$this->alias->methodName, $this->getArgInfoName(), $this->getFlagsAsString()
);
} else if ($this->alias instanceof FunctionName) {
return sprintf(
"\tZEND_ME_MAPPING(%s, %s, %s, %s)\n",
$this->name->methodName, $this->alias->getNonNamespacedName(),
$this->getArgInfoName(), $this->getFlagsAsString()
$this->alias->className, $this->name->name, $this->alias->name, $this->getArgInfoName(), $this->getFlagsAsString()
);
} else {
throw new Error("Cannot happen");
return sprintf(
"\tZEND_ME_MAPPING(%s, %s, %s, %s)\n",
$this->name->name, $this->alias->name, $this->getArgInfoName(), $this->getFlagsAsString()
);
}
} else {
$declarationClassName = $this->name->getDeclarationClassName();
if ($this->flags & Class_::MODIFIER_ABSTRACT) {
return sprintf(
"\tZEND_ABSTRACT_ME_WITH_FLAGS(%s, %s, %s, %s)\n",
$declarationClassName, $this->name->methodName, $this->getArgInfoName(),
$this->getFlagsAsString()
$this->name->className, $this->name->name, $this->getArgInfoName(), $this->getFlagsAsString()
);
}
return sprintf(
"\tZEND_ME(%s, %s, %s, %s)\n",
$declarationClassName, $this->name->methodName, $this->getArgInfoName(),
$this->getFlagsAsString()
$this->name->className, $this->name->name, $this->getArgInfoName(), $this->getFlagsAsString()
);
}
} else if ($this->name instanceof FunctionName) {
$namespace = $this->name->getNamespace();
$declarationName = $this->name->getDeclarationName();
} else {
if ($this->alias && $this->isDeprecated) {
return sprintf(
"\tZEND_DEP_FALIAS(%s, %s, %s)\n",
$declarationName, $this->alias->getNonNamespacedName(), $this->getArgInfoName()
$this->name, $this->alias->name, $this->getArgInfoName()
);
}
if ($this->alias) {
return sprintf(
"\tZEND_FALIAS(%s, %s, %s)\n",
$declarationName, $this->alias->getNonNamespacedName(), $this->getArgInfoName()
$this->name, $this->alias->name, $this->getArgInfoName()
);
}
if ($this->isDeprecated) {
return sprintf(
"\tZEND_DEP_FE(%s, %s)\n", $declarationName, $this->getArgInfoName());
return sprintf("\tZEND_DEP_FE(%s, %s)\n", $this->name, $this->getArgInfoName());
}
if ($namespace) {
return sprintf(
"\tZEND_NS_FE(\"%s\", %s, %s)\n",
$namespace, $declarationName, $this->getArgInfoName());
} else {
return sprintf("\tZEND_FE(%s, %s)\n", $declarationName, $this->getArgInfoName());
}
} else {
throw new Error("Cannot happen");
return sprintf("\tZEND_FE(%s, %s)\n", $this->name, $this->getArgInfoName());
}
}
@@ -672,23 +534,15 @@ class FuncInfo {
return $flags;
}
public function discardInfoForOldPhpVersions(): void {
$this->return->type = null;
foreach ($this->args as $arg) {
$arg->type = null;
$arg->defaultValue = null;
}
}
}
class ClassInfo {
/** @var Name */
/** @var string */
public $name;
/** @var FuncInfo[] */
public $funcInfos;
public function __construct(Name $name, array $funcInfos) {
public function __construct(string $name, array $funcInfos) {
$this->name = $name;
$this->funcInfos = $funcInfos;
}
@@ -696,15 +550,18 @@ class ClassInfo {
class FileInfo {
/** @var FuncInfo[] */
public $funcInfos = [];
public $funcInfos;
/** @var ClassInfo[] */
public $classInfos = [];
public $classInfos;
/** @var bool */
public $generateFunctionEntries = false;
/** @var string */
public $declarationPrefix = "";
/** @var bool */
public $generateLegacyArginfo = false;
public $generateFunctionEntries;
public function __construct(
array $funcInfos, array $classInfos, bool $generateFunctionEntries) {
$this->funcInfos = $funcInfos;
$this->classInfos = $classInfos;
$this->generateFunctionEntries = $generateFunctionEntries;
}
/**
* @return iterable<FuncInfo>
@@ -774,8 +631,7 @@ function parseDocComment(DocComment $comment): array {
function parseFunctionLike(
PrettyPrinterAbstract $prettyPrinter,
FunctionOrMethodName $name,
int $classFlags,
FunctionName $name,
int $flags,
Node\FunctionLike $func,
?string $cond
@@ -785,7 +641,6 @@ function parseFunctionLike(
$aliasType = null;
$alias = null;
$isDeprecated = false;
$verify = true;
$haveDocReturnType = false;
$docParamTypes = [];
@@ -802,14 +657,12 @@ function parseFunctionLike(
$aliasType = $tag->name;
$aliasParts = explode("::", $tag->getValue());
if (count($aliasParts) === 1) {
$alias = new FunctionName(new Name($aliasParts[0]));
$alias = new FunctionName(null, $aliasParts[0]);
} else {
$alias = new MethodName(new Name($aliasParts[0]), $aliasParts[1]);
$alias = new FunctionName($aliasParts[0], $aliasParts[1]);
}
} else if ($tag->name === 'deprecated') {
$isDeprecated = true;
} else if ($tag->name === 'no-verify') {
$verify = false;
} else if ($tag->name === 'return') {
$haveDocReturnType = true;
} else if ($tag->name === 'param') {
@@ -879,7 +732,7 @@ function parseFunctionLike(
}
$returnType = $func->getReturnType();
if ($returnType === null && !$haveDocReturnType && !$name->isConstructor() && !$name->isDestructor()) {
if ($returnType === null && !$haveDocReturnType && strpos($name->name, '__') !== 0) {
throw new Exception("Missing return type for function $name()");
}
@@ -890,12 +743,10 @@ function parseFunctionLike(
return new FuncInfo(
$name,
$classFlags,
$flags,
$aliasType,
$alias,
$isDeprecated,
$verify,
$args,
$return,
$numRequiredArgs,
@@ -948,76 +799,6 @@ function getFileDocComment(array $stmts): ?DocComment {
return null;
}
function handleStatements(FileInfo $fileInfo, array $stmts, PrettyPrinterAbstract $prettyPrinter) {
$conds = [];
foreach ($stmts as $stmt) {
if ($stmt instanceof Stmt\Nop) {
continue;
}
if ($stmt instanceof Stmt\Namespace_) {
handleStatements($fileInfo, $stmt->stmts, $prettyPrinter);
continue;
}
$cond = handlePreprocessorConditions($conds, $stmt);
if ($stmt instanceof Stmt\Function_) {
$fileInfo->funcInfos[] = parseFunctionLike(
$prettyPrinter,
new FunctionName($stmt->namespacedName),
0,
0,
$stmt,
$cond
);
continue;
}
if ($stmt instanceof Stmt\ClassLike) {
$className = $stmt->namespacedName;
$methodInfos = [];
foreach ($stmt->stmts as $classStmt) {
$cond = handlePreprocessorConditions($conds, $classStmt);
if ($classStmt instanceof Stmt\Nop) {
continue;
}
if (!$classStmt instanceof Stmt\ClassMethod) {
throw new Exception("Not implemented {$classStmt->getType()}");
}
$classFlags = 0;
if ($stmt instanceof Class_) {
$classFlags = $stmt->flags;
}
$flags = $classStmt->flags;
if ($stmt instanceof Stmt\Interface_) {
$flags |= Class_::MODIFIER_ABSTRACT;
}
if (!($flags & Class_::VISIBILITY_MODIFIER_MASK)) {
throw new Exception("Method visibility modifier is required");
}
$methodInfos[] = parseFunctionLike(
$prettyPrinter,
new MethodName($className, $classStmt->name->toString()),
$classFlags,
$flags,
$classStmt,
$cond
);
}
$fileInfo->classInfos[] = new ClassInfo($className, $methodInfos);
continue;
}
throw new Exception("Unexpected node {$stmt->getType()}");
}
}
function parseStubFile(string $code): FileInfo {
$lexer = new PhpParser\Lexer();
$parser = new PhpParser\Parser\Php7($lexer);
@@ -1032,22 +813,74 @@ function parseStubFile(string $code): FileInfo {
$stmts = $parser->parse($code);
$nodeTraverser->traverse($stmts);
$fileInfo = new FileInfo;
$generateFunctionEntries = false;
$fileDocComment = getFileDocComment($stmts);
if ($fileDocComment) {
$fileTags = parseDocComment($fileDocComment);
foreach ($fileTags as $tag) {
if ($tag->name === 'generate-function-entries') {
$fileInfo->generateFunctionEntries = true;
$fileInfo->declarationPrefix = $tag->value ? $tag->value . " " : "";
} else if ($tag->name === 'generate-legacy-arginfo') {
$fileInfo->generateLegacyArginfo = true;
}
if (strpos($fileDocComment->getText(), '@generate-function-entries') !== false) {
$generateFunctionEntries = true;
}
}
handleStatements($fileInfo, $stmts, $prettyPrinter);
return $fileInfo;
$funcInfos = [];
$classInfos = [];
$conds = [];
foreach ($stmts as $stmt) {
$cond = handlePreprocessorConditions($conds, $stmt);
if ($stmt instanceof Stmt\Nop) {
continue;
}
if ($stmt instanceof Stmt\Function_) {
$funcInfos[] = parseFunctionLike(
$prettyPrinter,
new FunctionName(null, $stmt->name->toString()),
0,
$stmt,
$cond
);
continue;
}
if ($stmt instanceof Stmt\ClassLike) {
$className = $stmt->name->toString();
$methodInfos = [];
foreach ($stmt->stmts as $classStmt) {
$cond = handlePreprocessorConditions($conds, $classStmt);
if ($classStmt instanceof Stmt\Nop) {
continue;
}
if (!$classStmt instanceof Stmt\ClassMethod) {
throw new Exception("Not implemented {$classStmt->getType()}");
}
$flags = $classStmt->flags;
if ($stmt instanceof Stmt\Interface_) {
$flags |= Class_::MODIFIER_ABSTRACT;
}
if (!($flags & Class_::VISIBILITY_MODIFIER_MASK)) {
throw new Exception("Method visibility modifier is required");
}
$methodInfos[] = parseFunctionLike(
$prettyPrinter,
new FunctionName($className, $classStmt->name->toString()),
$flags,
$classStmt,
$cond
);
}
$classInfos[] = new ClassInfo($className, $methodInfos);
continue;
}
throw new Exception("Unexpected node {$stmt->getType()}");
}
return new FileInfo($funcInfos, $classInfos, $generateFunctionEntries);
}
function funcInfoToCode(FuncInfo $funcInfo): string {
@@ -1210,14 +1043,15 @@ function generateArgInfoCode(FileInfo $fileInfo, string $stubHash): string {
$generatedFunctionDeclarations = [];
$code .= generateCodeWithConditions(
$fileInfo->getAllFuncInfos(), "",
function (FuncInfo $funcInfo) use($fileInfo, &$generatedFunctionDeclarations) {
function (FuncInfo $funcInfo) use(&$generatedFunctionDeclarations) {
$key = $funcInfo->getDeclarationKey();
if (isset($generatedFunctionDeclarations[$key])) {
return null;
}
$generatedFunctionDeclarations[$key] = true;
return $fileInfo->declarationPrefix . $funcInfo->getDeclaration();
return $funcInfo->getDeclaration();
}
);
@@ -1234,14 +1068,10 @@ function generateArgInfoCode(FileInfo $fileInfo, string $stubHash): string {
}
/** @param FuncInfo[] $funcInfos */
function generateFunctionEntries(?Name $className, array $funcInfos): string {
function generateFunctionEntries(?string $className, array $funcInfos): string {
$code = "";
$functionEntryName = "ext_functions";
if ($className) {
$underscoreName = implode("_", $className->parts);
$functionEntryName = "class_{$underscoreName}_methods";
}
$functionEntryName = $className ? "class_{$className}_methods" : "ext_functions";
$code .= "\n\nstatic const zend_function_entry {$functionEntryName}[] = {\n";
$code .= generateCodeWithConditions($funcInfos, "", function (FuncInfo $funcInfo) {
@@ -1318,132 +1148,25 @@ function initPhpParser() {
}
$optind = null;
$options = getopt("fh", ["force-regeneration", "parameter-stats", "help", "verify"], $optind);
$options = getopt("f", ["force-regeneration", "parameter-stats"], $optind);
$context = new Context;
$printParameterStats = isset($options["parameter-stats"]);
$verify = isset($options["verify"]);
$context->forceRegeneration = isset($options["f"]) || isset($options["force-regeneration"]);
$context->forceParse = $context->forceRegeneration || $printParameterStats || $verify;
$context->forceRegeneration =
isset($options["f"]) || isset($options["force-regeneration"]) || $printParameterStats;
if (isset($options["h"]) || isset($options["help"])) {
die("\nusage: gen-stub.php [ -f | --force-regeneration ] [ --parameter-stats ] [ --verify ] [ -h | --help ] [ name.stub.php | directory ]\n\n");
}
$fileInfos = [];
$location = $argv[$optind] ?? ".";
if (is_file($location)) {
// Generate single file.
$fileInfo = processStubFile($location, $context);
if ($fileInfo) {
$fileInfos[] = $fileInfo;
}
processStubFile($location, $context);
} else if (is_dir($location)) {
$fileInfos = processDirectory($location, $context);
processDirectory($location, $context);
} else {
echo "$location is neither a file nor a directory.\n";
exit(1);
}
if ($printParameterStats) {
$parameterStats = [];
foreach ($fileInfos as $fileInfo) {
foreach ($fileInfo->getAllFuncInfos() as $funcInfo) {
foreach ($funcInfo->args as $argInfo) {
if (!isset($parameterStats[$argInfo->name])) {
$parameterStats[$argInfo->name] = 0;
}
$parameterStats[$argInfo->name]++;
}
}
}
arsort($parameterStats);
echo json_encode($parameterStats, JSON_PRETTY_PRINT), "\n";
}
if ($verify) {
$errors = [];
$funcMap = [];
$aliases = [];
foreach ($fileInfos as $fileInfo) {
foreach ($fileInfo->getAllFuncInfos() as $funcInfo) {
/** @var FuncInfo $funcInfo */
$funcMap[$funcInfo->name->__toString()] = $funcInfo;
if ($funcInfo->aliasType === "alias") {
$aliases[] = $funcInfo;
}
}
}
foreach ($aliases as $aliasFunc) {
if (!isset($funcMap[$aliasFunc->alias->__toString()])) {
$errors[] = "Aliased function {$aliasFunc->alias}() cannot be found";
continue;
}
if (!$aliasFunc->verify) {
continue;
}
$aliasedFunc = $funcMap[$aliasFunc->alias->__toString()];
$aliasedArgs = $aliasedFunc->args;
$aliasArgs = $aliasFunc->args;
if ($aliasFunc->isInstanceMethod() !== $aliasedFunc->isInstanceMethod()) {
if ($aliasFunc->isInstanceMethod()) {
$aliasedArgs = array_slice($aliasedArgs, 1);
}
if ($aliasedFunc->isInstanceMethod()) {
$aliasArgs = array_slice($aliasArgs, 1);
}
}
array_map(
function(?ArgInfo $aliasArg, ?ArgInfo $aliasedArg) use ($aliasFunc, $aliasedFunc, &$errors) {
if ($aliasArg === null) {
assert($aliasedArg !== null);
$errors[] = "{$aliasFunc->name}(): Argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() is missing";
return null;
}
if ($aliasedArg === null) {
assert($aliasArg !== null);
$errors[] = "{$aliasedFunc->name}(): Argument \$$aliasArg->name of alias function {$aliasFunc->name}() is missing";
return null;
}
if ($aliasArg->name !== $aliasedArg->name) {
$errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same name";
return null;
}
if ($aliasArg->type != $aliasedArg->type) {
$errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same type";
}
if ($aliasArg->defaultValue !== $aliasedArg->defaultValue) {
$errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same default value";
}
},
$aliasArgs, $aliasedArgs
);
if ((!$aliasedFunc->isMethod() || $aliasedFunc->isFinalMethod()) &&
(!$aliasFunc->isMethod() || $aliasFunc->isFinalMethod()) &&
$aliasFunc->return != $aliasedFunc->return
) {
$errors[] = "{$aliasFunc->name}() and {$aliasedFunc->name}() must have the same return type";
}
}
echo implode("\n", $errors);
if (!empty($errors)) {
echo "\n";
exit(1);
}
arsort($context->parameterStats);
echo json_encode($context->parameterStats, JSON_PRETTY_PRINT), "\n";
}
+10 -10
View File
@@ -1158,11 +1158,11 @@ $1
int main() {
int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
if (fd < 0) return 1;
if (pwrite(fd, "text", 4, 0) != 4) return 1;
if (fd < 0) exit(1);
if (pwrite(fd, "text", 4, 0) != 4) exit(1);
/* Linux glibc breakage until 2.2.5 */
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) return 1;
return 0;
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1);
exit(0);
}
]])],[
@@ -1192,11 +1192,11 @@ $1
int main() {
char buf[3];
int fd = open("conftest_in", O_RDONLY);
if (fd < 0) return 1;
if (pread(fd, buf, 2, 0) != 2) return 1;
if (fd < 0) exit(1);
if (pread(fd, buf, 2, 0) != 2) exit(1);
/* Linux glibc breakage until 2.2.5 */
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) return 1;
return 0;
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
exit(0);
}
]])],[
ac_cv_pread=yes
@@ -1464,8 +1464,8 @@ int main() {
FILE *fp = fopencookie(&g, "r", funcs);
if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)
return 0;
return 1;
exit(0);
exit(1);
}
]])], [
+6 -7
View File
@@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice.
dnl ----------------------------------------------------------------------------
AC_PREREQ([2.68])
AC_INIT([PHP],[8.0.0RC3],[https://bugs.php.net],[php],[https://www.php.net])
AC_INIT([PHP],[8.0.0rc1],[https://bugs.php.net],[php],[https://www.php.net])
AC_CONFIG_SRCDIR([main/php_version.h])
AC_CONFIG_AUX_DIR([build])
AC_PRESERVE_HELP_ORDER
@@ -612,7 +612,6 @@ dnl getaddrinfo.
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
[[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);]])],[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <string.h>
@@ -627,11 +626,11 @@ int main(void) {
hints.ai_flags = AI_NUMERICHOST;
if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
return 1;
exit(1);
}
if (ai == 0) {
return 1;
exit(1);
}
pai = ai;
@@ -639,16 +638,16 @@ int main(void) {
while (pai) {
if (pai->ai_family != AF_INET) {
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
return 1;
exit(1);
}
if (pai->ai_addr->sa_family != AF_INET) {
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
return 1;
exit(1);
}
pai = pai->ai_next;
}
freeaddrinfo(ai);
return 0;
exit(0);
}
]])],[ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no], [ac_cv_func_getaddrinfo=no])],
[ac_cv_func_getaddrinfo=no])])
+1 -5
View File
@@ -542,11 +542,7 @@ PHP_FUNCTION(bcscale)
RETURN_THROWS();
}
zend_string *ini_name = zend_string_init("bcmath.scale", sizeof("bcmath.scale") - 1, 0);
zend_string *new_scale_str = zend_long_to_str(new_scale);
zend_alter_ini_entry(ini_name, new_scale_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
zend_string_release(new_scale_str);
zend_string_release(ini_name);
BCG(bc_precision) = (int) new_scale;
}
RETURN_LONG(old_scale);
@@ -6,21 +6,13 @@ bcscale() return value
bcmath.scale=0
--FILE--
<?php
var_dump((int) ini_get('bcmath.scale'));
var_dump(bcscale(1));
var_dump((int) ini_get('bcmath.scale'));
var_dump(bcscale(4));
var_dump((int) ini_get('bcmath.scale'));
var_dump(bcscale());
var_dump((int) ini_get('bcmath.scale'));
var_dump(bcscale());
?>
--EXPECT--
int(0)
int(0)
int(1)
int(1)
int(4)
int(4)
int(4)
int(4)
+2 -2
View File
@@ -496,7 +496,7 @@ PHP_FUNCTION(bzdecompress)
zend_string *dest;
size_t source_len;
int error;
zend_bool small = 0;
zend_long small = 0;
#ifdef PHP_WIN32
unsigned __int64 size = 0;
#else
@@ -504,7 +504,7 @@ PHP_FUNCTION(bzdecompress)
#endif
bz_stream bzs;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &source, &source_len, &small)) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &small)) {
RETURN_THROWS();
}
+6 -6
View File
@@ -13,19 +13,19 @@ function bzread($bz, int $length = 1024): string|false {}
/**
* @param resource $bz
* @implementation-alias fwrite
* @alias fwrite
*/
function bzwrite($bz, string $data, ?int $length = null): int|false {}
function bzwrite($bz, string $str, ?int $length = null): int|false {}
/**
* @param resource $bz
* @implementation-alias fflush
* @alias fflush
*/
function bzflush($bz): bool {}
/**
* @param resource $bz
* @implementation-alias fclose
* @alias fclose
*/
function bzclose($bz): bool {}
@@ -38,6 +38,6 @@ function bzerrstr($bz): string {}
/** @param resource $bz */
function bzerror($bz): array {}
function bzcompress(string $data, int $block_size = 4, int $work_factor = 0): string|int {}
function bzcompress(string $source, int $blocksize = 4, int $workfactor = 0): string|int {}
function bzdecompress(string $data, bool $use_less_memory = false): string|int|false {}
function bzdecompress(string $source, int $small = 0): string|int|false {}
+7 -7
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 0cd7792480671883ebae30ae8358b8f8e3390474 */
* Stub hash: 9bcd75ddbde225e65ee9f00d86d16677d671b4e4 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_bzopen, 0, 0, 2)
ZEND_ARG_INFO(0, file)
@@ -13,7 +13,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_bzwrite, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_INFO(0, bz)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null")
ZEND_END_ARG_INFO()
@@ -36,14 +36,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bzerror, 0, 1, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_bzcompress, 0, 1, MAY_BE_STRING|MAY_BE_LONG)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, block_size, IS_LONG, 0, "4")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, work_factor, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, blocksize, IS_LONG, 0, "4")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, workfactor, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_bzdecompress, 0, 1, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_less_memory, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, small, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
+4 -5
View File
@@ -26,8 +26,9 @@ var_dump(bzdecompress(1,1));
var_dump(bzdecompress($data3));
var_dump(bzdecompress($data3,1));
var_dump(bzdecompress($data, -1));
var_dump(bzdecompress($data, 0));
var_dump(bzdecompress($data, 1));
var_dump(bzdecompress($data, 1000));
var_dump(bzdecompress($data));
var_dump(bzdecompress($data2));
@@ -42,14 +43,12 @@ int(-2)
int(-5)
int(-5)
int(-5)
bool(false)
string(110) "Life it seems, will fade away
Drifting further everyday
Getting lost within myself
Nothing matters no one else"
string(110) "Life it seems, will fade away
Drifting further everyday
Getting lost within myself
Nothing matters no one else"
bool(false)
string(110) "Life it seems, will fade away
Drifting further everyday
Getting lost within myself
+3 -5
View File
@@ -21,8 +21,6 @@
#include "sdncal.h"
#include <time.h>
#define SECS_PER_DAY (24 * 3600)
/* {{{ Convert UNIX timestamp to Julian Day */
PHP_FUNCTION(unixtojd)
{
@@ -62,11 +60,11 @@ PHP_FUNCTION(jdtounix)
}
uday -= 2440588 /* J.D. of 1.1.1970 */;
if (uday < 0 || uday > ZEND_LONG_MAX / SECS_PER_DAY) { /* before beginning of unix epoch or greater than representable */
zend_value_error("jday must be between 2440588 and " ZEND_LONG_FMT, ZEND_LONG_MAX / SECS_PER_DAY + 2440588);
if (uday < 0 || uday > 24755) {
zend_value_error("jday must be within the Unix epoch");
RETURN_THROWS();
}
RETURN_LONG(uday * SECS_PER_DAY);
RETURN_LONG(uday * 24 * 3600);
}
/* }}} */
+10 -10
View File
@@ -4,33 +4,33 @@
function cal_days_in_month(int $calendar, int $month, int $year): int {}
function cal_from_jd(int $julian_day, int $calendar): array {}
function cal_from_jd(int $jd, int $calendar): array {}
function cal_info(int $calendar = -1): array {}
function cal_to_jd(int $calendar, int $month, int $day, int $year): int {}
function easter_date(?int $year = null, int $mode = CAL_EASTER_DEFAULT): int {}
function easter_date(?int $year = null, int $method = CAL_EASTER_DEFAULT): int {}
function easter_days(?int $year = null, int $mode = CAL_EASTER_DEFAULT): int {}
function easter_days(?int $year = null, int $method = CAL_EASTER_DEFAULT): int {}
function frenchtojd(int $month, int $day, int $year): int {}
function gregoriantojd(int $month, int $day, int $year): int {}
function jddayofweek(int $julian_day, int $mode = CAL_DOW_DAYNO): int|string {}
function jddayofweek(int $juliandaycount, int $mode = CAL_DOW_DAYNO): int|string {}
function jdmonthname(int $julian_day, int $mode): string {}
function jdmonthname(int $juliandaycount, int $mode): string {}
function jdtofrench(int $julian_day): string {}
function jdtofrench(int $juliandaycount): string {}
function jdtogregorian(int $julian_day): string {}
function jdtogregorian(int $juliandaycount): string {}
function jdtojewish(int $julian_day, bool $hebrew = false, int $flags = 0): string {}
function jdtojewish(int $juliandaycount, bool $hebrew = false, int $fl = 0): string {}
function jdtojulian(int $julian_day): string {}
function jdtojulian(int $juliandaycount): string {}
function jdtounix(int $julian_day): int {}
function jdtounix(int $jday): int {}
function jewishtojd(int $month, int $day, int $year): int {}
+9 -9
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: ced2659f54bb25693831315625fe90b33e2f7cbe */
* Stub hash: 1ace9d7ae3e505ae2e14323e21fa6ac0a490896d */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_cal_days_in_month, 0, 3, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, calendar, IS_LONG, 0)
@@ -8,7 +8,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_cal_days_in_month, 0, 3, IS_LONG
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_cal_from_jd, 0, 2, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, julian_day, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, jd, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, calendar, IS_LONG, 0)
ZEND_END_ARG_INFO()
@@ -25,7 +25,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_easter_date, 0, 0, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, year, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "CAL_EASTER_DEFAULT")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, method, IS_LONG, 0, "CAL_EASTER_DEFAULT")
ZEND_END_ARG_INFO()
#define arginfo_easter_days arginfo_easter_date
@@ -39,31 +39,31 @@ ZEND_END_ARG_INFO()
#define arginfo_gregoriantojd arginfo_frenchtojd
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_jddayofweek, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
ZEND_ARG_TYPE_INFO(0, julian_day, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, juliandaycount, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "CAL_DOW_DAYNO")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_jdmonthname, 0, 2, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, julian_day, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, juliandaycount, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_jdtofrench, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, julian_day, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, juliandaycount, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_jdtogregorian arginfo_jdtofrench
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_jdtojewish, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, julian_day, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, juliandaycount, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, hebrew, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fl, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
#define arginfo_jdtojulian arginfo_jdtofrench
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_jdtounix, 0, 1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, julian_day, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, jday, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_jewishtojd arginfo_frenchtojd
-21
View File
@@ -1,21 +0,0 @@
--TEST--
Bug #80185 (jdtounix() fails after 2037)
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
if (PHP_INT_SIZE != 8) die("skip for 64bit platforms only");
?>
--FILE--
<?php
var_dump(jdtounix(2465712));
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440588));
try {
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440589));
} catch (ValueError $ex) {
echo $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
int(2170713600)
int(9223372036854720000)
jday must be between 2440588 and 106751993607888
-25
View File
@@ -1,25 +0,0 @@
--TEST--
Bug #80185 (jdtounix() fails after 2037)
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
if (PHP_INT_SIZE != 4) die("skip for 32bit platforms only");
?>
--FILE--
<?php
try {
var_dump(jdtounix(2465712));
} catch (ValueError $ex) {
echo $ex->getMessage(), PHP_EOL;
}
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440588));
try {
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440589));
} catch (ValueError $ex) {
echo $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
jday must be between 2440588 and 2465443
int(2147472000)
jday must be between 2440588 and 2465443
+2 -2
View File
@@ -14,5 +14,5 @@ try {
echo $ex->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
jday must be between 2440588 and %d
--EXPECT--
jday must be within the Unix epoch
+13 -12
View File
@@ -30,19 +30,19 @@ function variant_pow(mixed $left, mixed $right): variant {}
function variant_xor(mixed $left, mixed $right): variant {}
function variant_abs(mixed $value): variant {}
function variant_abs(mixed $left): variant {}
function variant_fix(mixed $value): variant {}
function variant_fix(mixed $left): variant {}
function variant_int(mixed $value): variant {}
function variant_int(mixed $left): variant {}
function variant_neg(mixed $value): variant {}
function variant_neg(mixed $left): variant {}
function variant_not(mixed $value): variant {}
function variant_not(mixed $left): variant {}
function variant_round(mixed $value, int $decimals): ?variant {}
function variant_round(mixed $left, int $decimals): ?variant {}
function variant_cmp(mixed $left, mixed $right, int $locale_id = LOCALE_SYSTEM_DEFAULT, int $flags = 0): int {}
function variant_cmp(mixed $left, mixed $right, int $lcid = LOCALE_SYSTEM_DEFAULT, int $flags = 0): int {}
function variant_date_to_timestamp(variant $variant): ?int {}
@@ -54,17 +54,18 @@ function variant_set_type(variant $variant, int $type): void {}
function variant_cast(variant $variant, int $type): variant {}
function com_get_active_object(string $prog_id, ?int $codepage = null): variant {}
function com_get_active_object(string $progid, ?int $code_page = null): variant {}
function com_create_guid(): string|false {}
function com_event_sink(variant $variant, object $sink_object, array|string|null $sink_interface = null): bool {}
function com_event_sink(variant $comobject, object $sinkobject, array|string|null $sinkinterface = null): bool {}
function com_print_typeinfo(variant|string $variant, ?string $dispatch_interface = null, bool $display_sink = false): bool {}
/** @param com|dotnet|variant|string $comobject */
function com_print_typeinfo($comobject, ?string $dispinterface = null, bool $wantsink = false): bool {}
function com_message_pump(int $timeout_milliseconds = 0): bool {}
function com_message_pump(int $timeoutms = 0): bool {}
function com_load_typelib(string $typelib, bool $case_insensitive = true): bool {}
function com_load_typelib(string $typelib_name, bool $case_insensitive = true): bool {}
class variant
{
+14 -14
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: da1da8fcfe8a04d08d354ad2cc5a3658d16c3076 */
* Stub hash: 637bee9d71fb0d566ce38004eec8bc6f75656837 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_set, 0, 2, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(0, variant, variant, 0)
@@ -36,7 +36,7 @@ ZEND_END_ARG_INFO()
#define arginfo_variant_xor arginfo_variant_add
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_variant_abs, 0, 1, variant, 0)
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO(0, left, IS_MIXED, 0)
ZEND_END_ARG_INFO()
#define arginfo_variant_fix arginfo_variant_abs
@@ -48,14 +48,14 @@ ZEND_END_ARG_INFO()
#define arginfo_variant_not arginfo_variant_abs
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_variant_round, 0, 2, variant, 1)
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO(0, left, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO(0, decimals, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_cmp, 0, 2, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, left, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO(0, right, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, locale_id, IS_LONG, 0, "LOCALE_SYSTEM_DEFAULT")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, lcid, IS_LONG, 0, "LOCALE_SYSTEM_DEFAULT")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
@@ -82,31 +82,31 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_variant_cast, 0, 2, variant, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_com_get_active_object, 0, 1, variant, 0)
ZEND_ARG_TYPE_INFO(0, prog_id, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, codepage, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO(0, progid, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code_page, IS_LONG, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_com_create_guid, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_com_event_sink, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, variant, variant, 0)
ZEND_ARG_TYPE_INFO(0, sink_object, IS_OBJECT, 0)
ZEND_ARG_TYPE_MASK(0, sink_interface, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_OBJ_INFO(0, comobject, variant, 0)
ZEND_ARG_TYPE_INFO(0, sinkobject, IS_OBJECT, 0)
ZEND_ARG_TYPE_MASK(0, sinkinterface, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_com_print_typeinfo, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_TYPE_MASK(0, variant, variant, MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dispatch_interface, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, display_sink, _IS_BOOL, 0, "false")
ZEND_ARG_INFO(0, comobject)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dispinterface, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, wantsink, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_com_message_pump, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout_milliseconds, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeoutms, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_com_load_typelib, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, typelib, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, typelib_name, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, case_insensitive, _IS_BOOL, 0, "true")
ZEND_END_ARG_INFO()
+2 -2
View File
@@ -4,13 +4,13 @@
final class COMPersistHelper
{
public function __construct(?variant $variant) {}
public function __construct(?VARIANT $com_object) {}
public function GetCurFileName(): string|false {}
public function SaveToFile(?string $filename, bool $remember = true): bool {}
public function LoadFromFile(string $filename, int $flags = 0): bool {}
public function LoadFromFile(string $path, int $flags = 0): bool {}
public function GetMaxStreamSize(): int {}
+3 -3
View File
@@ -1,8 +1,8 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: d04d007cac328014c6cc76a00cc291237965d56d */
* Stub hash: 47d926b2ba30bb3616f4175664723352fff164e7 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_COMPersistHelper___construct, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, variant, variant, 1)
ZEND_ARG_OBJ_INFO(0, com_object, VARIANT, 1)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_COMPersistHelper_GetCurFileName, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
@@ -14,7 +14,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_COMPersistHelper_SaveToFil
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_COMPersistHelper_LoadFromFile, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
+19 -23
View File
@@ -306,20 +306,18 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
if (obj) {
if (dispname == NULL && sink) {
if (V_VT(&obj->v) == VT_DISPATCH) {
IProvideClassInfo2 *pci2;
IProvideClassInfo *pci;
IProvideClassInfo2 *pci2;
IProvideClassInfo *pci;
if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo2, (void**)&pci2))) {
gotguid = SUCCEEDED(IProvideClassInfo2_GetGUID(pci2, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &iid));
IProvideClassInfo2_Release(pci2);
}
if (!gotguid && SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo, (void**)&pci))) {
/* examine the available interfaces */
/* TODO: write some code here */
php_error_docref(NULL, E_WARNING, "IProvideClassInfo: this code not yet written!");
IProvideClassInfo_Release(pci);
}
if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo2, (void**)&pci2))) {
gotguid = SUCCEEDED(IProvideClassInfo2_GetGUID(pci2, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &iid));
IProvideClassInfo2_Release(pci2);
}
if (!gotguid && SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo, (void**)&pci))) {
/* examine the available interfaces */
/* TODO: write some code here */
php_error_docref(NULL, E_WARNING, "IProvideClassInfo: this code not yet written!");
IProvideClassInfo_Release(pci);
}
} else if (dispname == NULL) {
if (obj->typeinfo) {
@@ -336,17 +334,15 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
/* get the library from the object; the rest will be dealt with later */
ITypeInfo_GetContainingTypeLib(obj->typeinfo, &typelib, &idx);
} else if (typelibname == NULL) {
if (V_VT(&obj->v) == VT_DISPATCH) {
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &typeinfo);
if (dispname) {
unsigned int idx;
/* get the library from the object; the rest will be dealt with later */
ITypeInfo_GetContainingTypeLib(typeinfo, &typelib, &idx);
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &typeinfo);
if (dispname) {
unsigned int idx;
/* get the library from the object; the rest will be dealt with later */
ITypeInfo_GetContainingTypeLib(typeinfo, &typelib, &idx);
if (typelib) {
ITypeInfo_Release(typeinfo);
typeinfo = NULL;
}
if (typelib) {
ITypeInfo_Release(typeinfo);
typeinfo = NULL;
}
}
}
-14
View File
@@ -1,14 +0,0 @@
--TEST--
Bug #62474 (com_event_sink crashes on certain arguments)
--SKIPIF--
<?php
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
?>
--FILE--
<?php
var_dump(com_event_sink(new variant, function() {}, array()));
var_dump(com_event_sink(new variant, new variant, 'a'));
?>
--EXPECT--
bool(false)
bool(false)
+5 -9
View File
@@ -3308,12 +3308,6 @@ static void curl_free_obj(zend_object *object)
fprintf(stderr, "DTOR CALLED, ch = %x\n", ch);
#endif
if (!ch->cp) {
/* Can happen if constructor throws. */
zend_object_std_dtor(&ch->std);
return;
}
_php_curl_verify_handlers(ch, 0);
/*
@@ -3327,10 +3321,12 @@ static void curl_free_obj(zend_object *object)
*
* Libcurl commit d021f2e8a00 fix this issue and should be part of 7.28.2
*/
curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_nothing);
curl_easy_setopt(ch->cp, CURLOPT_WRITEFUNCTION, curl_write_nothing);
if (ch->cp != NULL) {
curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_nothing);
curl_easy_setopt(ch->cp, CURLOPT_WRITEFUNCTION, curl_write_nothing);
curl_easy_cleanup(ch->cp);
curl_easy_cleanup(ch->cp);
}
/* cURL destructors should be invoked only by last curl handle */
if (--(*ch->clone) == 0) {
-6
View File
@@ -537,12 +537,6 @@ void curl_multi_free_obj(zend_object *object)
php_curl *ch;
zval *pz_ch;
if (!mh->multi) {
/* Can happen if constructor throws. */
zend_object_std_dtor(&mh->std);
return;
}
for (pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch;
pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
if (!(OBJ_FLAGS(Z_OBJ_P(pz_ch)) & IS_OBJ_FREE_CALLED)) {
-26
View File
@@ -1,26 +0,0 @@
--TEST--
Bug #80121: Null pointer deref if CurlHandle directly instantiated
--FILE--
<?php
try {
new CurlHandle;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
new CurlMultiHandle;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
new CurlShareHandle;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Cannot directly construct CurlHandle, use curl_init() instead
Cannot directly construct CurlMultiHandle, use curl_multi_init() instead
Cannot directly construct CurlShareHandle, use curl_share_init() instead
+1 -1
View File
@@ -48,7 +48,7 @@ PSL => No
HTTPS_PROXY => Yes
MULTI_SSL => %s
BROTLI => %s
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, %r(mqtt, )?%rpop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host => %s-pc-win32
SSL Version => OpenSSL/%s
ZLib Version => %s
-1
View File
@@ -1,7 +1,6 @@
// vim:ft=javascript
EXTENSION("date", "php_date.c", false, "/Iext/date/lib /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /DHAVE_TIMELIB_CONFIG_H=1");
PHP_DATE = "yes";
ADD_SOURCES("ext/date/lib", "astro.c timelib.c dow.c parse_date.c parse_tz.c tm2unixtime.c unixtime2tm.c parse_iso_intervals.c interval.c", "date");
ADD_FLAG('CFLAGS_DATE', "/wd4244");
+923 -795
View File
File diff suppressed because it is too large. Load diff
+4 -10
View File
@@ -69,7 +69,7 @@ function date_time_set(
function date_date_set(DateTime $object, int $year, int $month, int $day): DateTime {}
function date_isodate_set(DateTime $object, int $year, int $week, int $dayOfWeek = 1): DateTime {}
function date_isodate_set(DateTime $object, int $year, int $week, int $day = 1): DateTime {}
function date_timestamp_set(DateTime $object, int $timestamp): DateTime {}
@@ -98,7 +98,7 @@ function date_interval_create_from_date_string(string $datetime): DateInterval|f
function date_interval_format(DateInterval $object, string $format): string {}
function date_default_timezone_set(string $timezoneId): bool {}
function date_default_timezone_set(string $timezoneID): bool {}
function date_default_timezone_get(): string {}
@@ -134,7 +134,6 @@ interface DateTimeInterface
/** @return DateInterval|false */
public function diff(DateTimeInterface $targetObject, bool $absolute = false);
/** @return void */
public function __wakeup();
}
@@ -142,7 +141,6 @@ class DateTime implements DateTimeInterface
{
public function __construct(string $datetime = "now", ?DateTimeZone $timezone = null) {}
/** @return void */
public function __wakeup() {}
/** @return DateTime */
@@ -248,7 +246,6 @@ class DateTimeImmutable implements DateTimeInterface
{
public function __construct(string $datetime = "now", ?DateTimeZone $timezone = null) {}
/** @return void */
public function __wakeup() {}
/** @return DateTimeZone */
@@ -294,7 +291,7 @@ class DateTimeImmutable implements DateTimeInterface
* @return DateInterval|false
* @alias date_diff
*/
public function diff(DateTimeInterface $targetObject, bool $absolute = false) {}
public function diff(DateTimeInterface $object, bool $absolute = false) {}
/** @return DateTimeImmutable|false */
public function modify(string $modifier) {}
@@ -340,7 +337,7 @@ class DateTimeZone
* @return int
* @alias timezone_offset_get
*/
public function getOffset(DateTimeInterface $datetime) {}
public function getOffset(DateTimeInterface $object) {}
/**
* @return array|false
@@ -366,7 +363,6 @@ class DateTimeZone
*/
public static function listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null) {}
/** @return void */
public function __wakeup() {}
/** @return DateTimeZone */
@@ -389,7 +385,6 @@ class DateInterval
*/
public function format(string $format) {}
/** @return void */
public function __wakeup() {}
/** @return DateInterval */
@@ -418,7 +413,6 @@ class DatePeriod implements IteratorAggregate
/** @return int|null */
public function getRecurrences() {}
/** @return void */
public function __wakeup() {}
/** @return DatePeriod */
+8 -5
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 07d0e6179d838847d4a5d454f8b56438f8df19c0 */
* Stub hash: cb1532309655d85eb2644cdcfbf23063dfa1ddaf */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strtotime, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0)
@@ -143,7 +143,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_date_isodate_set, 0, 3, DateTime,
ZEND_ARG_OBJ_INFO(0, object, DateTime, 0)
ZEND_ARG_TYPE_INFO(0, year, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, week, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dayOfWeek, IS_LONG, 0, "1")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, day, IS_LONG, 0, "1")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_date_timestamp_set, 0, 2, DateTime, 0)
@@ -203,7 +203,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_date_interval_format, 0, 2, IS_S
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_date_default_timezone_set, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, timezoneId, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, timezoneID, IS_STRING, 0)
ZEND_END_ARG_INFO()
#define arginfo_date_default_timezone_get arginfo_timezone_version_get
@@ -335,7 +335,10 @@ ZEND_END_ARG_INFO()
#define arginfo_class_DateTimeImmutable_getTimestamp arginfo_class_DateTimeInterface_getTimezone
#define arginfo_class_DateTimeImmutable_diff arginfo_class_DateTimeInterface_diff
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeImmutable_diff, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, object, DateTimeInterface, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, absolute, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
#define arginfo_class_DateTimeImmutable_modify arginfo_class_DateTime_modify
@@ -368,7 +371,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_DateTimeZone_getName arginfo_class_DateTimeInterface_getTimezone
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeZone_getOffset, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, datetime, DateTimeInterface, 0)
ZEND_ARG_OBJ_INFO(0, object, DateTimeInterface, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeZone_getTransitions, 0, 0, 0)
+1 -1
View File
@@ -15,4 +15,4 @@ try {
?>
--EXPECT--
3600
DateTimeZone::getOffset(): Argument #1 ($datetime) must be of type DateTimeInterface, int given
DateTimeZone::getOffset(): Argument #1 ($object) must be of type DateTimeInterface, int given
+7 -7
View File
@@ -4,7 +4,7 @@ Bug #48097 (date_timezone_set function produces wrong datetime result)
date.timezone=UTC
--FILE--
<?php
$d = date_create( "Sun, 22 May 1955 02:00:00 +0200" );
$d = date_create( "Mon, 23 May 1955 00:00:00 +0200" );
var_dump( $d );
echo $d->format( DATE_ISO8601 ), "\n";
echo $d->format( 'U' ), "\n\n";
@@ -17,23 +17,23 @@ echo $d->format( 'U' ), "\n\n";
--EXPECT--
object(DateTime)#1 (3) {
["date"]=>
string(26) "1955-05-22 02:00:00.000000"
string(26) "1955-05-23 00:00:00.000000"
["timezone_type"]=>
int(1)
["timezone"]=>
string(6) "+02:00"
}
1955-05-22T02:00:00+0200
-461203200
1955-05-23T00:00:00+0200
-461124000
object(DateTime)#1 (3) {
["date"]=>
string(26) "1955-05-22 01:00:00.000000"
string(26) "1955-05-22 23:00:00.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(15) "Europe/Budapest"
}
1955-05-22T01:00:00+0100
1955-05-22T23:00:00+0100
-461203200
-461124000
+28 -28
View File
@@ -5,68 +5,68 @@
/**
* @param string $path
* @param string $mode
* @param string $handler
* @param string $handler_params
* @param string $handlername
* @param string $handler_parameters
* @return resource|false
*/
function dba_popen($path, $mode, $handler = UNKNOWN, ...$handler_params) {}
function dba_popen($path, $mode, $handlername = UNKNOWN, ...$handler_parameters) {}
/**
* @param string $path
* @param string $mode
* @param string $handler
* @param string $handler_params
* @param string $handlername
* @param string $handler_parameters
* @return resource|false
*/
function dba_open($path, $mode, $handler = UNKNOWN, ...$handler_params) {}
function dba_open($path, $mode, $handlername = UNKNOWN, ...$handler_parameters) {}
/** @param resource $dba */
function dba_close($dba): void {}
/** @param resource $handle */
function dba_close($handle): void {}
/**
* @param string|array $key
* @param resource $dba
* @param resource $handle
*/
function dba_exists($key, $dba): bool {}
function dba_exists($key, $handle): bool {}
/**
* @param string|array $key
* @param int|resource $skip actually this parameter is optional, not $dba
* @param resource $dba
* @param int|resource $skip actually this parameter is optional, not $handle
* @param resource $handle
*/
function dba_fetch($key, $skip, $dba = UNKNOWN): string|false {}
function dba_fetch($key, $skip, $handle = UNKNOWN): string|false {}
function dba_key_split(string|false|null $key): array|false {}
function dba_key_split(string $key): array|false {}
/** @param resource $dba */
function dba_firstkey($dba): string|false {}
/** @param resource $handle */
function dba_firstkey($handle): string|false {}
/** @param resource $dba */
function dba_nextkey($dba): string|false {}
/** @param resource $handle */
function dba_nextkey($handle): string|false {}
/**
* @param string|array $key
* @param resource $dba
* @param resource $handle
*/
function dba_delete($key, $dba): bool {}
function dba_delete($key, $handle): bool {}
/**
* @param string|array $key
* @param resource $dba
* @param resource $handle
*/
function dba_insert($key, string $value, $dba): bool {}
function dba_insert($key, string $value, $handle): bool {}
/**
* @param string|array $key
* @param resource $dba
* @param resource $handle
*/
function dba_replace($key, string $value, $dba): bool {}
function dba_replace($key, string $value, $handle): bool {}
/** @param resource $dba */
function dba_optimize($dba): bool {}
/** @param resource $handle */
function dba_optimize($handle): bool {}
/** @param resource $dba */
function dba_sync($dba): bool {}
/** @param resource $handle */
function dba_sync($handle): bool {}
function dba_handlers(bool $full_info = false): array {}
+10 -10
View File
@@ -1,36 +1,36 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 63980c2a7227d1b5dbd566efb3efbf8c45c55c0d */
* Stub hash: 5b43c7cfcb48f3081d5585192eaaa5185df036f8 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_popen, 0, 0, 2)
ZEND_ARG_INFO(0, path)
ZEND_ARG_INFO(0, mode)
ZEND_ARG_INFO(0, handler)
ZEND_ARG_VARIADIC_INFO(0, handler_params)
ZEND_ARG_INFO(0, handlername)
ZEND_ARG_VARIADIC_INFO(0, handler_parameters)
ZEND_END_ARG_INFO()
#define arginfo_dba_open arginfo_dba_popen
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dba_close, 0, 1, IS_VOID, 0)
ZEND_ARG_INFO(0, dba)
ZEND_ARG_INFO(0, handle)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dba_exists, 0, 2, _IS_BOOL, 0)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, dba)
ZEND_ARG_INFO(0, handle)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_dba_fetch, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, skip)
ZEND_ARG_INFO(0, dba)
ZEND_ARG_INFO(0, handle)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_dba_key_split, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_MASK(0, key, MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL, NULL)
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_dba_firstkey, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_INFO(0, dba)
ZEND_ARG_INFO(0, handle)
ZEND_END_ARG_INFO()
#define arginfo_dba_nextkey arginfo_dba_firstkey
@@ -40,13 +40,13 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dba_insert, 0, 3, _IS_BOOL, 0)
ZEND_ARG_INFO(0, key)
ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0)
ZEND_ARG_INFO(0, dba)
ZEND_ARG_INFO(0, handle)
ZEND_END_ARG_INFO()
#define arginfo_dba_replace arginfo_dba_insert
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dba_optimize, 0, 1, _IS_BOOL, 0)
ZEND_ARG_INFO(0, dba)
ZEND_ARG_INFO(0, handle)
ZEND_END_ARG_INFO()
#define arginfo_dba_sync arginfo_dba_optimize
+2 -4
View File
@@ -7,9 +7,8 @@ DBA Split Test
?>
--FILE--
<?php
var_dump(dba_key_split(null));
var_dump(dba_key_split(false));
var_dump(dba_key_split(1));
var_dump(dba_key_split(null));
var_dump(dba_key_split(""));
var_dump(dba_key_split("name1"));
var_dump(dba_key_split("[key1"));
@@ -21,14 +20,13 @@ var_dump(dba_key_split("[key1]name1"));
?>
--EXPECT--
bool(false)
bool(false)
array(2) {
[0]=>
string(0) ""
[1]=>
string(1) "1"
}
bool(false)
array(2) {
[0]=>
string(0) ""
+1
View File
@@ -1840,6 +1840,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
}
ctxt = htmlCreateFileParserCtxt(source, NULL);
} else {
source_len = xmlStrlen((xmlChar *) source);
if (ZEND_SIZE_T_INT_OVFL(source_len)) {
php_error_docref(NULL, E_WARNING, "Input string is too long");
RETURN_FALSE;
-24
View File
@@ -1,24 +0,0 @@
--TEST--
Bug #80268 (loadHTML() truncates at NUL bytes)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument;
$doc->loadHTML("<p>foo\0bar</p>");
$html = $doc->saveHTML();
var_dump(strpos($html, '<p>foo</p>') !== false);
file_put_contents(__DIR__ . '/80268.html', "<p>foo\0bar</p>");
$doc = new DOMDocument;
$doc->loadHTMLFile(__DIR__ . '/80268.html');
$html = $doc->saveHTML();
var_dump(strpos($html, '<p>foo</p>') !== false);
?>
--CLEAN--
<?php
unlink(__DIR__ . '/80268.html');
?>
--EXPECT--
bool(true)
bool(true)
+14 -14
View File
@@ -18,10 +18,10 @@ function enchant_broker_free(EnchantBroker $broker): bool {}
function enchant_broker_get_error(EnchantBroker $broker): string|false {}
/** @deprecated */
function enchant_broker_set_dict_path(EnchantBroker $broker, int $type, string $path): bool {}
function enchant_broker_set_dict_path(EnchantBroker $broker, int $name, string $value): bool {}
/** @deprecated */
function enchant_broker_get_dict_path(EnchantBroker $broker, int $type): string|false {}
function enchant_broker_get_dict_path(EnchantBroker $broker, int $name): string|false {}
function enchant_broker_list_dicts(EnchantBroker $broker): array {}
@@ -30,7 +30,7 @@ function enchant_broker_request_dict(EnchantBroker $broker, string $tag): Enchan
function enchant_broker_request_pwl_dict(EnchantBroker $broker, string $filename): EnchantDictionary|false {}
/** @deprecated */
function enchant_broker_free_dict(EnchantDictionary $dictionary): bool {}
function enchant_broker_free_dict(EnchantDictionary $dict): bool {}
function enchant_broker_dict_exists(EnchantBroker $broker, string $tag): bool {}
@@ -39,32 +39,32 @@ function enchant_broker_set_ordering(EnchantBroker $broker, string $tag, string
function enchant_broker_describe(EnchantBroker $broker): array {}
/** @param array $suggestions */
function enchant_dict_quick_check(EnchantDictionary $dictionary, string $word, &$suggestions = null): bool {}
function enchant_dict_quick_check(EnchantDictionary $dict, string $word, &$suggestions = null): bool {}
function enchant_dict_check(EnchantDictionary $dictionary, string $word): bool {}
function enchant_dict_check(EnchantDictionary $dict, string $word): bool {}
function enchant_dict_suggest(EnchantDictionary $dictionary, string $word): array {}
function enchant_dict_suggest(EnchantDictionary $dict, string $word): array {}
function enchant_dict_add(EnchantDictionary $dictionary, string $word): void {}
function enchant_dict_add(EnchantDictionary $dict, string $word): void {}
/**
* @alias enchant_dict_add
* @deprecated
*/
function enchant_dict_add_to_personal(EnchantDictionary $dictionary, string $word): void {}
function enchant_dict_add_to_personal(EnchantDictionary $dict, string $word): void {}
function enchant_dict_add_to_session(EnchantDictionary $dictionary, string $word): void {}
function enchant_dict_add_to_session(EnchantDictionary $dict, string $word): void {}
function enchant_dict_is_added(EnchantDictionary $dictionary, string $word): bool {}
function enchant_dict_is_added(EnchantDictionary $dict, string $word): bool {}
/**
* @alias enchant_dict_is_added
* @deprecated
*/
function enchant_dict_is_in_session(EnchantDictionary $dictionary, string $word): bool {}
function enchant_dict_is_in_session(EnchantDictionary $dict, string $word): bool {}
function enchant_dict_store_replacement(EnchantDictionary $dictionary, string $misspelled, string $correct): void {}
function enchant_dict_store_replacement(EnchantDictionary $dict, string $mis, string $cor): void {}
function enchant_dict_get_error(EnchantDictionary $dictionary): string|false {}
function enchant_dict_get_error(EnchantDictionary $dict): string|false {}
function enchant_dict_describe(EnchantDictionary $dictionary): array {}
function enchant_dict_describe(EnchantDictionary $dict): array {}
+14 -14
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 31f7c4cd39e58d6474b90acd65f4b7bda7a6ddf3 */
* Stub hash: 22c47f0b30f6952a42546c403fbd2e92836661fa */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_enchant_broker_init, 0, 0, EnchantBroker, MAY_BE_FALSE)
ZEND_END_ARG_INFO()
@@ -14,13 +14,13 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_enchant_broker_set_dict_path, 0, 3, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, broker, EnchantBroker, 0)
ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, name, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_enchant_broker_get_dict_path, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, broker, EnchantBroker, 0)
ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, name, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_enchant_broker_list_dicts, 0, 1, IS_ARRAY, 0)
@@ -38,7 +38,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_enchant_broker_request_pwl_d
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_enchant_broker_free_dict, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, dictionary, EnchantDictionary, 0)
ZEND_ARG_OBJ_INFO(0, dict, EnchantDictionary, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_enchant_broker_dict_exists, 0, 2, _IS_BOOL, 0)
@@ -55,23 +55,23 @@ ZEND_END_ARG_INFO()
#define arginfo_enchant_broker_describe arginfo_enchant_broker_list_dicts
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_enchant_dict_quick_check, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, dictionary, EnchantDictionary, 0)
ZEND_ARG_OBJ_INFO(0, dict, EnchantDictionary, 0)
ZEND_ARG_TYPE_INFO(0, word, IS_STRING, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, suggestions, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_enchant_dict_check, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, dictionary, EnchantDictionary, 0)
ZEND_ARG_OBJ_INFO(0, dict, EnchantDictionary, 0)
ZEND_ARG_TYPE_INFO(0, word, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_enchant_dict_suggest, 0, 2, IS_ARRAY, 0)
ZEND_ARG_OBJ_INFO(0, dictionary, EnchantDictionary, 0)
ZEND_ARG_OBJ_INFO(0, dict, EnchantDictionary, 0)
ZEND_ARG_TYPE_INFO(0, word, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_enchant_dict_add, 0, 2, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(0, dictionary, EnchantDictionary, 0)
ZEND_ARG_OBJ_INFO(0, dict, EnchantDictionary, 0)
ZEND_ARG_TYPE_INFO(0, word, IS_STRING, 0)
ZEND_END_ARG_INFO()
@@ -84,17 +84,17 @@ ZEND_END_ARG_INFO()
#define arginfo_enchant_dict_is_in_session arginfo_enchant_dict_check
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_enchant_dict_store_replacement, 0, 3, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(0, dictionary, EnchantDictionary, 0)
ZEND_ARG_TYPE_INFO(0, misspelled, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, correct, IS_STRING, 0)
ZEND_ARG_OBJ_INFO(0, dict, EnchantDictionary, 0)
ZEND_ARG_TYPE_INFO(0, mis, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, cor, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_enchant_dict_get_error, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, dictionary, EnchantDictionary, 0)
ZEND_ARG_OBJ_INFO(0, dict, EnchantDictionary, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_enchant_dict_describe, 0, 1, IS_ARRAY, 0)
ZEND_ARG_OBJ_INFO(0, dictionary, EnchantDictionary, 0)
ZEND_ARG_OBJ_INFO(0, dict, EnchantDictionary, 0)
ZEND_END_ARG_INFO()
+5 -5
View File
@@ -4,15 +4,15 @@
function exif_tagname(int $index): string|false {}
/** @param resource|string $file */
function exif_read_data($file, ?string $required_sections = null, bool $as_arrays = false, bool $read_thumbnail = false): array|false {}
/** @param resource|string $filename */
function exif_read_data($filename, ?string $sections_needed = null, bool $sub_arrays = false, bool $read_thumbnail = false): array|false {}
/**
* @param resource|string $file
* @param resource|string $filename
* @param int $width
* @param int $height
* @param int $image_type
* @param int $imagetype
*/
function exif_thumbnail($file, &$width = null, &$height = null, &$image_type = null): string|false {}
function exif_thumbnail($filename, &$width = null, &$height = null, &$imagetype = null): string|false {}
function exif_imagetype(string $filename): int|false {}
+6 -6
View File
@@ -1,22 +1,22 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: ef23ff502ea9658af29e50d57366c281f7a7eb6c */
* Stub hash: d8cb3719a7de74b27b306c30b6be0af0647b6af4 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_exif_tagname, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_exif_read_data, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_INFO(0, file)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, required_sections, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, as_arrays, _IS_BOOL, 0, "false")
ZEND_ARG_INFO(0, filename)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sections_needed, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sub_arrays, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, read_thumbnail, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_exif_thumbnail, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_INFO(0, file)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, width, "null")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, height, "null")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, image_type, "null")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, imagetype, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_exif_imagetype, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
+4 -4
View File
@@ -29,7 +29,7 @@ try {
?>
--EXPECT--
exif_read_data(): Argument #1 ($file) cannot be empty
exif_thumbnail(): Argument #1 ($file) cannot be empty
exif_read_data(): Argument #1 ($file) must not contain any null bytes
exif_thumbnail(): Argument #1 ($file) must not contain any null bytes
exif_read_data(): Argument #1 ($filename) cannot be empty
exif_thumbnail(): Argument #1 ($filename) cannot be empty
exif_read_data(): Argument #1 ($filename) must not contain any null bytes
exif_thumbnail(): Argument #1 ($filename) must not contain any null bytes
+11 -13
View File
@@ -4428,7 +4428,7 @@ ZEND_METHOD(FFI, isNull) /* {{{ */
/* }}} */
ZEND_METHOD(FFI_CType, getName) /* {{{ */
ZEND_METHOD(CType, getName) /* {{{ */
{
zend_ffi_ctype *ctype = (zend_ffi_ctype*)(Z_OBJ_P(ZEND_THIS));
if (zend_parse_parameters_none() == FAILURE) {
@@ -5004,7 +5004,7 @@ ZEND_MINIT_FUNCTION(ffi)
zend_ffi_cdata_free_handlers.get_properties = zend_fake_get_properties;
zend_ffi_cdata_free_handlers.get_gc = zend_fake_get_gc;
INIT_NS_CLASS_ENTRY(ce, "FFI", "CType", class_FFI_CType_methods);
INIT_NS_CLASS_ENTRY(ce, "FFI", "CType", class_CType_methods);
zend_ffi_ctype_ce = zend_register_internal_class(&ce);
zend_ffi_ctype_ce->ce_flags |= ZEND_ACC_FINAL;
zend_ffi_ctype_ce->create_object = zend_ffi_ctype_new;
@@ -7302,11 +7302,11 @@ void zend_ffi_val_character(zend_ffi_val *val, const char *str, size_t str_len)
val->ch = '\t';
} else if (str[2] == 'v' && str_len == 4) {
val->ch = '\v';
} else if (str[2] >= '0' && str[2] <= '7') {
} else if (str[2] >= '0' || str[2] <= '7') {
n = str[2] - '0';
if (str[3] >= '0' && str[3] <= '7') {
if (str[3] >= '0' || str[3] <= '7') {
n = n * 8 + (str[3] - '0');
if ((str[4] >= '0' && str[4] <= '7') && str_len == 6) {
if ((str[4] >= '0' || str[4] <= '7') && str_len == 6) {
n = n * 8 + (str[4] - '0');
} else if (str_len != 5) {
val->kind = ZEND_FFI_VAL_ERROR;
@@ -7320,25 +7320,23 @@ void zend_ffi_val_character(zend_ffi_val *val, const char *str, size_t str_len)
val->kind = ZEND_FFI_VAL_ERROR;
}
} else if (str[2] == 'x') {
if (str[3] >= '0' && str[3] <= '9') {
if (str[3] >= '0' || str[3] <= '7') {
n = str[3] - '0';
} else if (str[3] >= 'A' && str[3] <= 'F') {
} else if (str[3] >= 'A' || str[3] <= 'F') {
n = str[3] - 'A';
} else if (str[3] >= 'a' && str[3] <= 'f') {
} else if (str[3] >= 'a' || str[3] <= 'f') {
n = str[3] - 'a';
} else {
val->kind = ZEND_FFI_VAL_ERROR;
return;
}
if ((str[4] >= '0' && str[4] <= '9') && str_len == 6) {
if ((str[4] >= '0' || str[4] <= '7') && str_len == 6) {
n = n * 16 + (str[4] - '0');
} else if ((str[4] >= 'A' && str[4] <= 'F') && str_len == 6) {
} else if ((str[4] >= 'A' || str[4] <= 'F') && str_len == 6) {
n = n * 16 + (str[4] - 'A');
} else if ((str[4] >= 'a' && str[4] <= 'f') && str_len == 6) {
} else if ((str[4] >= 'a' || str[4] <= 'f') && str_len == 6) {
n = n * 16 + (str[4] - 'a');
} else if (str_len != 5) {
val->kind = ZEND_FFI_VAL_ERROR;
return;
}
val->ch = n;
} else if (str_len == 4) {
+7 -15
View File
@@ -2,15 +2,13 @@
/** @generate-function-entries */
namespace {
final class FFI
{
public static function cdef(string $code = "", ?string $lib = null): FFI {}
public static function load(string $filename): ?FFI {}
public static function scope(string $name): ?FFI {}
public static function scope(string $scope_name): ?FFI {}
public static function new(FFI\CType|string $type, bool $owned = true, bool $persistent = false): ?FFI\CData {}
@@ -28,7 +26,7 @@ final class FFI
/** @prefer-ref $ptr */
public static function typeof(FFI\CData $ptr): ?FFI\CType {}
public static function arrayType(FFI\CType $type, array $dimensions): ?FFI\CType {}
public static function arrayType(FFI\CType $type, array $dims): ?FFI\CType {}
/** @prefer-ref $ptr */
public static function addr(FFI\CData $ptr): FFI\CData {}
@@ -40,11 +38,11 @@ final class FFI
public static function alignof(object $ptr): ?int {}
/**
* @param FFI\CData|string $from
* @prefer-ref $to
* @prefer-ref $from
* @param FFI\CData|string $src
* @prefer-ref $dst
* @prefer-ref $src
*/
public static function memcpy(FFI\CData $to, $from, int $size): void {}
public static function memcpy(FFI\CData $dst, $src, int $size): void {}
/**
* @prefer-ref $ptr1
@@ -55,7 +53,7 @@ final class FFI
public static function memcmp($ptr1, $ptr2, int $size): ?int {}
/** @prefer-ref $ptr */
public static function memset(FFI\CData $ptr, int $value, int $size): void {}
public static function memset(FFI\CData $ptr, int $ch, int $size): void {}
/** @prefer-ref $ptr */
public static function string(FFI\CData $ptr, ?int $size = null): ?string {}
@@ -64,12 +62,6 @@ final class FFI
public static function isNull(FFI\CData $ptr): bool {}
}
}
namespace FFI {
final class CType {
public function getName() : string {}
}
}
+10 -10
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: abd3bc186ae3f71f2b7eb1d47f3b6bab84fb2bda */
* Stub hash: cf08aabbc0e1c50204772ace9285f1c5ef7a22fe */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_cdef, 0, 0, FFI, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_STRING, 0, "\"\"")
@@ -11,7 +11,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_load, 0, 1, FFI, 1)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_scope, 0, 1, FFI, 1)
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, scope_name, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_new, 0, 1, FFI\\CData, 1)
@@ -39,7 +39,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_arrayType, 0, 2, FFI\\CType, 1)
ZEND_ARG_OBJ_INFO(0, type, FFI\\CType, 0)
ZEND_ARG_TYPE_INFO(0, dimensions, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, dims, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_addr, 0, 1, FFI\\CData, 0)
@@ -53,8 +53,8 @@ ZEND_END_ARG_INFO()
#define arginfo_class_FFI_alignof arginfo_class_FFI_sizeof
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memcpy, 0, 3, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, to, FFI\\CData, 0)
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, from)
ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, dst, FFI\\CData, 0)
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, src)
ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
ZEND_END_ARG_INFO()
@@ -66,7 +66,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memset, 0, 3, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, ch, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
ZEND_END_ARG_INFO()
@@ -79,7 +79,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_isNull, 0, 1, _IS_BOOL
ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_CType_getName, 0, 0, IS_STRING, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_CType_getName, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
@@ -100,7 +100,7 @@ ZEND_METHOD(FFI, memcmp);
ZEND_METHOD(FFI, memset);
ZEND_METHOD(FFI, string);
ZEND_METHOD(FFI, isNull);
ZEND_METHOD(FFI_CType, getName);
ZEND_METHOD(CType, getName);
static const zend_function_entry class_FFI_methods[] = {
@@ -125,7 +125,7 @@ static const zend_function_entry class_FFI_methods[] = {
};
static const zend_function_entry class_FFI_CType_methods[] = {
ZEND_ME(FFI_CType, getName, arginfo_class_FFI_CType_getName, ZEND_ACC_PUBLIC)
static const zend_function_entry class_CType_methods[] = {
ZEND_ME(CType, getName, arginfo_class_CType_getName, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
-15
View File
@@ -1,15 +0,0 @@
--TEST--
Bug #80186 (Segfault when iterating over FFI object)
--SKIPIF--
<?php
if (!extension_loaded('ffi')) die('skip ffi extension not available');
?>
--FILE--
<?php
$ffi = FFI::cdef('typedef int dummy;');
foreach ($ffi as $_) { }
foreach ($ffi as &$_) { }
?>
===DONE===
--EXPECT--
===DONE===
+1 -5
View File
@@ -35,7 +35,6 @@
#include "fileinfo_arginfo.h"
#include "fopen_wrappers.h" /* needed for is_url */
#include "Zend/zend_exceptions.h"
#include "Zend/zend_interfaces.h"
/* {{{ macros and type definitions */
typedef struct _php_fileinfo {
@@ -133,16 +132,13 @@ PHP_MINIT_FUNCTION(finfo)
{
zend_class_entry _finfo_class_entry;
INIT_CLASS_ENTRY(_finfo_class_entry, "finfo", class_finfo_methods);
_finfo_class_entry.create_object = finfo_objects_new;
finfo_class_entry = zend_register_internal_class(&_finfo_class_entry);
finfo_class_entry->create_object = finfo_objects_new;
finfo_class_entry->serialize = zend_class_serialize_deny;
finfo_class_entry->unserialize = zend_class_unserialize_deny;
/* copy the standard object handlers to you handler table */
memcpy(&finfo_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
finfo_object_handlers.offset = XtOffsetOf(finfo_object, zo);
finfo_object_handlers.free_obj = finfo_objects_free;
finfo_object_handlers.clone_obj = NULL;
le_fileinfo = zend_register_list_destructors_ex(finfo_resource_destructor, NULL, "file_info", module_number);
-25
View File
@@ -1,25 +0,0 @@
--TEST--
Cloning and serializing finfo is not supported
--FILE--
<?php
$finfo = new finfo;
var_dump($finfo->buffer("Test string"));
try {
$finfo2 = clone $finfo;
var_dump($finfo2->buffer("Test string"));
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
$finfo3 = unserialize(serialize($finfo));
var_dump($finfo3->buffer("Test string"));
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
string(%d) "%s"
Trying to clone an uncloneable object of class finfo
Serialization of 'finfo' is not allowed
+21 -21
View File
@@ -3,11 +3,11 @@
/** @generate-function-entries */
/** @return resource|false */
function ftp_connect(string $hostname, int $port = 21, int $timeout = 90) {}
function ftp_connect(string $host, int $port = 21, int $timeout = 90) {}
#ifdef HAVE_FTP_SSL
/** @return resource|false */
function ftp_ssl_connect(string $hostname, int $port = 21, int $timeout = 90) {}
function ftp_ssl_connect(string $host, int $port = 21, int $timeout = 90) {}
#endif
/** @param resource $ftp */
@@ -35,7 +35,7 @@ function ftp_mkdir($ftp, string $directory): string|false {}
function ftp_rmdir($ftp, string $directory): bool {}
/** @param resource $ftp */
function ftp_chmod($ftp, int $permissions, string $filename): int|false {}
function ftp_chmod($ftp, int $mode, string $filename): int|false {}
/**
* @param resource $ftp
@@ -47,7 +47,7 @@ function ftp_alloc($ftp, int $size, &$response = null): bool {}
function ftp_nlist($ftp, string $directory): array|false {}
/** @param resource $ftp */
function ftp_rawlist($ftp, string $directory, bool $recursive = false): array|false {}
function ftp_rawlist($ftp, string $directory, bool $recurse = false): array|false {}
/** @param resource $ftp */
function ftp_mlsd($ftp, string $directory): array|false {}
@@ -57,48 +57,48 @@ function ftp_systype($ftp): string|false {}
/**
* @param resource $ftp
* @param resource $stream
* @param resource $fp
*/
function ftp_fget($ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
function ftp_fget($ftp, $fp, string $remote_file, int $mode = FTP_BINARY, int $resumepos = 0): bool {}
/**
* @param resource $ftp
* @param resource $stream
* @param resource $fp
*/
function ftp_nb_fget($ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): int {}
function ftp_nb_fget($ftp, $fp, string $remote_file, int $mode = FTP_BINARY, int $resumpos = 0): int {}
/** @param resource $ftp */
function ftp_pasv($ftp, bool $enable): bool {}
function ftp_pasv($ftp, bool $pasv): bool {}
/** @param resource $ftp */
function ftp_get($ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
function ftp_get($ftp, string $local_file, string $remote_file, int $mode = FTP_BINARY, int $resumepos = 0): bool {}
/** @param resource $ftp */
function ftp_nb_get($ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): int {}
function ftp_nb_get($ftp, string $local_file, string $remote_file, int $mode = FTP_BINARY, int $resume_pos = 0): int {}
/** @param resource $ftp */
function ftp_nb_continue($ftp): int {}
/**
* @param resource $ftp
* @param resource $stream
* @param resource $fp
*/
function ftp_fput($ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0): bool {}
function ftp_fput($ftp, string $remote_file, $fp, int $mode = FTP_BINARY, int $startpos = 0): bool {}
/**
* @param resource $ftp
* @param resource $stream
* @param resource $fp
*/
function ftp_nb_fput($ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0): int {}
function ftp_nb_fput($ftp, string $remote_file, $fp, int $mode = FTP_BINARY, int $startpos = 0): int {}
/** @param resource $ftp */
function ftp_put($ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
function ftp_put($ftp, string $remote_file, string $local_file, int $mode = FTP_BINARY, int $startpos = 0): bool {}
/** @param resource $ftp */
function ftp_append($ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY): bool {}
function ftp_append($ftp, string $remove_file, string $local_file, int $mode = FTP_BINARY): bool {}
/** @param resource $ftp */
function ftp_nb_put($ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): int|false {}
function ftp_nb_put($ftp, string $remote_file, string $local_file, int $mode = FTP_BINARY, int $startpos = 0): int|false {}
/** @param resource $ftp */
function ftp_size($ftp, string $filename): int {}
@@ -107,13 +107,13 @@ function ftp_size($ftp, string $filename): int {}
function ftp_mdtm($ftp, string $filename): int {}
/** @param resource $ftp */
function ftp_rename($ftp, string $from, string $to): bool {}
function ftp_rename($ftp, string $src, string $dest): bool {}
/** @param resource $ftp */
function ftp_delete($ftp, string $filename): bool {}
function ftp_delete($ftp, string $file): bool {}
/** @param resource $ftp */
function ftp_site($ftp, string $command): bool {}
function ftp_site($ftp, string $cmd): bool {}
/** @param resource $ftp */
function ftp_close($ftp): bool {}
+39 -36
View File
@@ -1,15 +1,15 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 4957601533b387d70ebb15811821fc06507cdbc2 */
* Stub hash: 7cf8b5776e7d2ad943683d1f1c43d44b85dea7a1 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_connect, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "21")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "90")
ZEND_END_ARG_INFO()
#if defined(HAVE_FTP_SSL)
ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_ssl_connect, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "21")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "90")
ZEND_END_ARG_INFO()
@@ -53,7 +53,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_chmod, 0, 3, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, permissions, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
ZEND_END_ARG_INFO()
@@ -71,7 +71,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_rawlist, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, recursive, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, recurse, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
#define arginfo_ftp_mlsd arginfo_ftp_nlist
@@ -80,39 +80,39 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_fget, 0, 3, _IS_BOOL, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, stream)
ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
ZEND_ARG_INFO(0, fp)
ZEND_ARG_TYPE_INFO(0, remote_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, resumepos, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_nb_fget, 0, 3, IS_LONG, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, stream)
ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
ZEND_ARG_INFO(0, fp)
ZEND_ARG_TYPE_INFO(0, remote_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, resumpos, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_pasv, 0, 2, _IS_BOOL, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, pasv, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_get, 0, 3, _IS_BOOL, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, local_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, local_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, remote_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, resumepos, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_nb_get, 0, 3, IS_LONG, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, local_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, local_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, remote_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, resume_pos, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_nb_continue, 0, 1, IS_LONG, 0)
@@ -121,41 +121,41 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_fput, 0, 3, _IS_BOOL, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
ZEND_ARG_INFO(0, stream)
ZEND_ARG_TYPE_INFO(0, remote_file, IS_STRING, 0)
ZEND_ARG_INFO(0, fp)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, startpos, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_nb_fput, 0, 3, IS_LONG, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
ZEND_ARG_INFO(0, stream)
ZEND_ARG_TYPE_INFO(0, remote_file, IS_STRING, 0)
ZEND_ARG_INFO(0, fp)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, startpos, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_put, 0, 3, _IS_BOOL, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, local_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, remote_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, local_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, startpos, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_append, 0, 3, _IS_BOOL, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, local_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, remove_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, local_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_nb_put, 0, 3, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, local_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, remote_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, local_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, startpos, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_size, 0, 2, IS_LONG, 0)
@@ -167,16 +167,19 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_rename, 0, 3, _IS_BOOL, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, from, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, src, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, dest, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_delete, 0, 2, _IS_BOOL, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0)
ZEND_END_ARG_INFO()
#define arginfo_ftp_site arginfo_ftp_exec
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_site, 0, 2, _IS_BOOL, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_TYPE_INFO(0, cmd, IS_STRING, 0)
ZEND_END_ARG_INFO()
#define arginfo_ftp_close arginfo_ftp_cdup
+11 -11
View File
@@ -199,9 +199,9 @@ zend_object *php_gd_image_object_create(zend_class_entry *class_type)
static void php_gd_image_object_free(zend_object *intern)
{
php_gd_image_object *img_obj_ptr = php_gd_exgdimage_from_zobj_p(intern);
if (img_obj_ptr->image) {
gdImageDestroy(img_obj_ptr->image);
}
gdImageDestroy(img_obj_ptr->image);
img_obj_ptr->image = NULL;
zend_object_std_dtor(intern);
}
@@ -222,7 +222,7 @@ static void php_gd_object_minit_helper()
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "GdImage", class_GdImage_methods);
gd_image_ce = zend_register_internal_class(&ce);
gd_image_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
gd_image_ce->ce_flags |= ZEND_ACC_FINAL;
gd_image_ce->create_object = php_gd_image_object_create;
gd_image_ce->serialize = zend_class_serialize_deny;
gd_image_ce->unserialize = zend_class_unserialize_deny;
@@ -1140,7 +1140,7 @@ PHP_FUNCTION(imagecopyresampled)
PHP_FUNCTION(imagegrabwindow)
{
HWND window;
zend_bool client_area = 0;
zend_long client_area = 0;
RECT rc = {0};
int Width, Height;
HDC hdc;
@@ -1150,7 +1150,7 @@ PHP_FUNCTION(imagegrabwindow)
zend_long lwindow_handle;
gdImagePtr im = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|b", &lwindow_handle, &client_area) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &lwindow_handle, &client_area) == FAILURE) {
RETURN_THROWS();
}
@@ -1269,9 +1269,9 @@ PHP_FUNCTION(imagerotate)
gdImagePtr im_dst, im_src;
double degrees;
zend_long color;
zend_bool ignoretransparent = 0;
zend_long ignoretransparent = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Odl|b", &SIM, gd_image_ce, &degrees, &color, &ignoretransparent) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Odl|l", &SIM, gd_image_ce, &degrees, &color, &ignoretransparent) == FAILURE) {
RETURN_THROWS();
}
@@ -1956,7 +1956,7 @@ PHP_FUNCTION(imagewbmp)
gdIOCtx *ctx = NULL;
zval *to_zval = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|z!l!", &imgind, gd_image_ce, &to_zval, &foreground_color, &foreground_color_is_null) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|z!l!", &imgind, gd_image_ce, &to_zval, &foreground_color) == FAILURE) {
RETURN_THROWS();
}
@@ -2579,11 +2579,11 @@ PHP_FUNCTION(imagecolortransparent)
PHP_FUNCTION(imageinterlace)
{
zval *IM;
zend_bool INT = 0;
zend_long INT = 0;
zend_bool INT_IS_NULL = 1;
gdImagePtr im;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b!", &IM, gd_image_ce, &INT, &INT_IS_NULL) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l!", &IM, gd_image_ce, &INT, &INT_IS_NULL) == FAILURE) {
RETURN_THROWS();
}
+94 -96
View File
@@ -10,60 +10,59 @@ function gd_info(): array {}
function imageloadfont(string $filename): int|false {}
function imagesetstyle(GdImage $image, array $style): bool {}
function imagesetstyle(GdImage $im, array $styles): bool {}
function imagecreatetruecolor(int $width, int $height): GdImage|false {}
function imagecreatetruecolor(int $x_size, int $y_size): GdImage|false {}
function imageistruecolor(GdImage $image): bool {}
function imageistruecolor(GdImage $im): bool {}
function imagetruecolortopalette(GdImage $image, bool $dither, int $num_colors): bool {}
function imagetruecolortopalette(GdImage $im, bool $ditherFlag, int $colorWanted): bool {}
function imagepalettetotruecolor(GdImage $image): bool {}
function imagepalettetotruecolor(GdImage $im): bool {}
function imagecolormatch(GdImage $image1, GdImage $image2): bool {}
function imagecolormatch(GdImage $im1, GdImage $im2): bool {}
function imagesetthickness(GdImage $image, int $thickness): bool {}
function imagesetthickness(GdImage $im, int $thickness): bool {}
function imagefilledellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): bool {}
function imagefilledellipse(GdImage $im, int $cx, int $cy, int $w, int $h, int $color): bool {}
function imagefilledarc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): bool {}
function imagefilledarc(GdImage $im, int $cx, int $cy, int $w, int $h, int $s, int $e, int $col, int $style): bool {}
function imagealphablending(GdImage $image, bool $enable): bool {}
function imagealphablending(GdImage $im, bool $blend): bool {}
function imagesavealpha(GdImage $image, bool $enable): bool {}
function imagesavealpha(GdImage $im, bool $save): bool {}
function imagelayereffect(GdImage $image, int $effect): bool {}
function imagelayereffect(GdImage $im, int $effect): bool {}
function imagecolorallocatealpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int|false {}
function imagecolorallocatealpha(GdImage $im, int $red, int $green, int $blue, int $alpha): int|false {}
function imagecolorresolvealpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int|false {}
function imagecolorresolvealpha(GdImage $im, int $red, int $green, int $blue, int $alpha): int|false {}
function imagecolorclosestalpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int|false {}
function imagecolorclosestalpha(GdImage $im, int $red, int $green, int $blue, int $alpha): int|false {}
function imagecolorexactalpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int|false {}
function imagecolorexactalpha(GdImage $im, int $red, int $green, int $blue, int $alpha): int|false {}
function imagecopyresampled(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): bool {}
function imagecopyresampled(GdImage $dst_im, GdImage $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_w, int $dst_h, int $src_w, int $src_h): bool {}
#ifdef PHP_WIN32
function imagegrabwindow(int $handle, bool $client_area = false): GdImage|false {}
function imagegrabwindow(int $handle, int $client_area = 0): GdImage|false {}
function imagegrabscreen(): GdImage|false {}
#endif
// TODO: $ignore_transparent is ignored???
function imagerotate(GdImage $image, float $angle, int $background_color, bool $ignore_transparent = false): GdImage|false {}
function imagerotate(GdImage $im, float $angle, int $bgdcolor, int $ignoretransparent = 0): GdImage|false {}
function imagesettile(GdImage $image, GdImage $tile): bool {}
function imagesettile(GdImage $im, GdImage $tile): bool {}
function imagesetbrush(GdImage $image, GdImage $brush): bool {}
function imagesetbrush(GdImage $im, GdImage $brush): bool {}
function imagecreate(int $width, int $height): GdImage|false {}
function imagecreate(int $x_size, int $y_size): GdImage|false {}
function imagetypes(): int {}
function imagecreatefromstring(string $data): GdImage|false {}
function imagecreatefromstring(string $image): GdImage|false {}
function imagecreatefromgif(string $filename): GdImage|false {}
@@ -91,7 +90,7 @@ function imagecreatefromgd(string $filename): GdImage|false {}
function imagecreatefromgd2(string $filename): GdImage|false {}
function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height): GdImage|false {}
function imagecreatefromgd2part(string $filename, int $srcX, int $srcY, int $width, int $height): GdImage|false {}
#ifdef HAVE_GD_BMP
function imagecreatefrombmp(string $filename): GdImage|false {}
@@ -101,157 +100,156 @@ function imagecreatefrombmp(string $filename): GdImage|false {}
function imagecreatefromtga(string $filename): GdImage|false {}
#endif
function imagexbm(GdImage $image, ?string $filename, ?int $foreground_color = null): bool {}
function imagexbm(GdImage $im, ?string $filename, ?int $foreground = null): bool {}
/** @param resource|string|null $file */
function imagegif(GdImage $image, $file = null): bool {}
/** @param resource|string|null $to */
function imagegif(GdImage $im, $to = null): bool {}
#ifdef HAVE_GD_PNG
/** @param resource|string|null $file */
function imagepng(GdImage $image, $file = null, int $quality = -1, int $filters = -1): bool {}
/** @param resource|string|null $to */
function imagepng(GdImage $im, $to = null, int $quality = -1, int $filters = -1): bool {}
#endif
#ifdef HAVE_GD_WEBP
/** @param resource|string|null $file */
function imagewebp(GdImage $image, $file = null, int $quality = -1): bool {}
/** @param resource|string|null $to */
function imagewebp(GdImage $im, $to = null, int $quality = -1): bool {}
#endif
#ifdef HAVE_GD_JPG
/** @param resource|string|null $file */
function imagejpeg(GdImage $image, $file = null, int $quality = -1): bool {}
/** @param resource|string|null $to */
function imagejpeg(GdImage $im, $to = null, int $quality = -1): bool {}
#endif
/** @param resource|string|null $file */
function imagewbmp(GdImage $image, $file = null, ?int $foreground_color = null): bool {}
/** @param resource|string|null $to */
function imagewbmp(GdImage $im, $to = null, ?int $foreground = null): bool {}
function imagegd(GdImage $image, string $file = UNKNOWN): bool {}
function imagegd(GdImage $im, string $to = UNKNOWN): bool {}
function imagegd2(GdImage $image, string $file = UNKNOWN, int $chunk_size = UNKNOWN, int $mode = UNKNOWN): bool {}
function imagegd2(GdImage $im, string $to = UNKNOWN, int $chunk_size = UNKNOWN, int $type = UNKNOWN): bool {}
#ifdef HAVE_GD_BMP
/** @param resource|string|null $file */
function imagebmp(GdImage $image, $file = null, bool $compressed = true): bool {}
/** @param resource|string|null $to */
function imagebmp(GdImage $im, $to = null, bool $compressed = true): bool {}
#endif
function imagedestroy(GdImage $image): bool {}
function imagedestroy(GdImage $im): bool {}
function imagecolorallocate(GdImage $image, int $red, int $green, int $blue): int|false {}
function imagecolorallocate(GdImage $im, int $red, int $green, int $blue): int|false {}
function imagepalettecopy(GdImage $dst, GdImage $src): void {}
function imagecolorat(GdImage $image, int $x, int $y): int|false {}
function imagecolorat(GdImage $im, int $x, int $y): int|false {}
function imagecolorclosest(GdImage $image, int $red, int $green, int $blue): int|false {}
function imagecolorclosest(GdImage $im, int $red, int $green, int $blue): int|false {}
function imagecolorclosesthwb(GdImage $image, int $red, int $green, int $blue): int|false {}
function imagecolorclosesthwb(GdImage $im, int $red, int $green, int $blue): int|false {}
function imagecolordeallocate(GdImage $image, int $color): bool {}
function imagecolordeallocate(GdImage $im, int $index): bool {}
function imagecolorresolve(GdImage $image, int $red, int $green, int $blue): int|false {}
function imagecolorresolve(GdImage $im, int $red, int $green, int $blue): int|false {}
function imagecolorexact(GdImage $image, int $red, int $green, int $blue): int|false {}
function imagecolorexact(GdImage $im, int $red, int $green, int $blue): int|false {}
function imagecolorset(GdImage $image, int $color, int $red, int $green, int $blue, int $alpha = 0): ?bool {}
function imagecolorset(GdImage $im, int $color, int $red, int $green, int $blue, int $alpha = 0): ?bool {}
function imagecolorsforindex(GdImage $image, int $color): array|false {}
function imagecolorsforindex(GdImage $im, int $index): array|false {}
function imagegammacorrect(GdImage $image, float $input_gamma, float $output_gamma): bool {}
function imagegammacorrect(GdImage $im, float $inputgamma, float $outputgamma): bool {}
function imagesetpixel(GdImage $image, int $x, int $y, int $color): bool {}
function imagesetpixel(GdImage $im, int $x, int $y, int $col): bool {}
function imageline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {}
function imageline(GdImage $im, int $x1, int $y1, int $x2, int $y2, int $col): bool {}
function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {}
function imagedashedline(GdImage $im, int $x1, int $y1, int $x2, int $y2, int $col): bool {}
function imagerectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {}
function imagerectangle(GdImage $im, int $x1, int $y1, int $x2, int $y2, int $col): bool {}
function imagefilledrectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {}
function imagefilledrectangle(GdImage $im, int $x1, int $y1, int $x2, int $y2, int $col): bool {}
function imagearc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): bool {}
function imagearc(GdImage $im, int $cx, int $cy, int $w, int $h, int $s, int $e, int $col): bool {}
function imageellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): bool {}
function imageellipse(GdImage $im, int $cx, int $cy, int $w, int $h, int $color): bool {}
function imagefilltoborder(GdImage $image, int $x, int $y, int $border_color, int $color): bool {}
function imagefilltoborder(GdImage $im, int $x, int $y, int $border, int $col): bool {}
function imagefill(GdImage $image, int $x, int $y, int $color): bool {}
function imagefill(GdImage $im, int $x, int $y, int $col): bool {}
function imagecolorstotal(GdImage $image): int {}
function imagecolorstotal(GdImage $im): int {}
function imagecolortransparent(GdImage $image, ?int $color = null): ?int {}
function imagecolortransparent(GdImage $im, ?int $col = null): ?int {}
function imageinterlace(GdImage $image, ?bool $enable = null): ?int {}
function imageinterlace(GdImage $im, ?int $interlace = null): ?int {}
function imagepolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color = null): bool {}
function imagepolygon(GdImage $im, array $points, int $num_points_or_col, ?int $col = null): bool {}
function imageopenpolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color = null): bool {}
function imageopenpolygon(GdImage $im, array $points, int $num_points_or_col, ?int $col = null): bool {}
function imagefilledpolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color = null): bool {}
function imagefilledpolygon(GdImage $im, array $points, int $num_points_or_col, ?int $col = null): bool {}
function imagefontwidth(int $font): int {}
function imagefontheight(int $font): int {}
function imagechar(GdImage $image, int $font, int $x, int $y, string $char, int $color): bool {}
function imagechar(GdImage $im, int $font, int $x, int $y, string $c, int $col): bool {}
function imagecharup(GdImage $image, int $font, int $x, int $y, string $char, int $color): bool {}
function imagecharup(GdImage $im, int $font, int $x, int $y, string $c, int $col): bool {}
function imagestring(GdImage $image, int $font, int $x, int $y, string $string, int $color): bool {}
function imagestring(GdImage $im, int $font, int $x, int $y, string $str, int $col): bool {}
function imagestringup(GdImage $image, int $font, int $x, int $y, string $string, int $color): bool {}
function imagestringup(GdImage $im, int $font, int $x, int $y, string $str, int $col): bool {}
function imagecopy(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): bool {}
function imagecopy(GdImage $dst_im, GdImage $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h): bool {}
function imagecopymerge(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): bool {}
function imagecopymerge(GdImage $dst_im, GdImage $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h, int $pct): bool {}
function imagecopymergegray(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): bool {}
function imagecopymergegray(GdImage $dst_im, GdImage $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h, int $pct): bool {}
function imagecopyresized(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): bool {}
function imagecopyresized(GdImage $dst_im, GdImage $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_w, int $dst_h, int $src_w, int $src_h): bool {}
function imagesx(GdImage $image): int {}
function imagesx(GdImage $im): int {}
function imagesy(GdImage $image): int {}
function imagesy(GdImage $im): int {}
function imagesetclip(GdImage $image, int $x1, int $x2, int $y1, int $y2): bool {}
function imagesetclip(GdImage $im, int $x1, int $x2, int $y1, int $y2): bool {}
function imagegetclip(GdImage $image): array {}
function imagegetclip(GdImage $im): array {}
#ifdef HAVE_GD_FREETYPE
function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array|false {}
function imageftbbox(float $size, float $angle, string $font_file, string $text, array $extrainfo = []): array|false {}
function imagefttext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array|false {}
function imagefttext(GdImage $im, float $size, float $angle, int $x, int $y, int $col, string $font_file, string $text, array $extrainfo = []): array|false {}
/** @alias imageftbbox */
function imagettfbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array|false {}
function imagettfbbox(float $size, float $angle, string $font_file, string $text, array $extrainfo = []): array|false {}
/** @alias imagefttext */
function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array|false {}
function imagettftext(GdImage $im, float $size, float $angle, int $x, int $y, int $col, string $font_file, string $text, array $extrainfo = []): array|false {}
#endif
/** @param array|int|float|bool $args */
function imagefilter(GdImage $image, int $filter, ...$args): bool {}
/** @param array|int|float|bool $filter_args */
function imagefilter(GdImage $im, int $filtertype, ...$filter_args): bool {}
function imageconvolution(GdImage $image, array $matrix, float $divisor, float $offset): bool {}
function imageconvolution(GdImage $im, array $matrix3x3, float $div, float $offset): bool {}
function imageflip(GdImage $image, int $mode): bool {}
function imageflip(GdImage $im, int $mode): bool {}
function imageantialias(GdImage $image, bool $enable): bool {}
function imageantialias(GdImage $im, bool $on): bool {}
function imagecrop(GdImage $image, array $rectangle): GdImage|false {}
function imagecrop(GdImage $im, array $rect): GdImage|false {}
function imagecropauto(GdImage $image, int $mode = IMG_CROP_DEFAULT, float $threshold = 0.5, int $color = -1): GdImage|false {}
function imagecropauto(GdImage $im, int $mode = IMG_CROP_DEFAULT, float $threshold = 0.5, int $color = -1): GdImage|false {}
function imagescale(GdImage $image, int $width, int $height = -1, int $mode = IMG_BILINEAR_FIXED): GdImage|false {}
function imagescale(GdImage $im, int $new_width, int $new_height = -1, int $mode = IMG_BILINEAR_FIXED): GdImage|false {}
function imageaffine(GdImage $image, array $affine, ?array $clip = null): GdImage|false {}
function imageaffine(GdImage $im, array $affine, ?array $clip = null): GdImage|false {}
/** @param array|float $options */
function imageaffinematrixget(int $type, $options): array|false {}
function imageaffinematrixconcat(array $matrix1, array $matrix2): array|false {}
function imageaffinematrixconcat(array $m1, array $m2): array|false {}
function imagegetinterpolation(GdImage $image): int {}
function imagegetinterpolation(GdImage $im): int {}
function imagesetinterpolation(GdImage $image, int $method = IMG_BILINEAR_FIXED): bool {}
function imageresolution(GdImage $image, ?int $resolution_x = null, ?int $resolution_y = null): array|bool {}
function imagesetinterpolation(GdImage $im, int $method = IMG_BILINEAR_FIXED): bool {}
function imageresolution(GdImage $im, ?int $res_x = null, ?int $res_y = null): array|bool {}
+148 -142
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 59256d0de105f1a2f5d5fc1e20f8090031b42a76 */
* Stub hash: 20849891a4907e348f1a509388ab08b0b7f6633d */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
@@ -9,72 +9,75 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imageloadfont, 0, 1, MAY_BE_LONG
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetstyle, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, style, IS_ARRAY, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, styles, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagecreatetruecolor, 0, 2, GdImage, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, x_size, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, y_size, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageistruecolor, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagetruecolortopalette, 0, 3, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, dither, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, num_colors, IS_LONG, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, ditherFlag, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, colorWanted, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_imagepalettetotruecolor arginfo_imageistruecolor
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolormatch, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image1, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, image2, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im1, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im2, GdImage, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetthickness, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, thickness, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledellipse, 0, 6, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, center_x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, center_y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, cx, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, cy, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, w, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, h, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledarc, 0, 9, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, center_x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, center_y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, start_angle, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, end_angle, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, cx, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, cy, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, w, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, h, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, s, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, e, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, col, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, style, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagealphablending, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, blend, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
#define arginfo_imagesavealpha arginfo_imagealphablending
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesavealpha, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, save, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagelayereffect, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, effect, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imagecolorallocatealpha, 0, 5, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, red, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, green, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, blue, IS_LONG, 0)
@@ -88,22 +91,22 @@ ZEND_END_ARG_INFO()
#define arginfo_imagecolorexactalpha arginfo_imagecolorallocatealpha
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopyresampled, 0, 10, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, dst_image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, src_image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, dst_im, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, src_im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, dst_x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, dst_y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, dst_width, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, dst_height, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_width, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_height, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, dst_w, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, dst_h, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_w, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_h, IS_LONG, 0)
ZEND_END_ARG_INFO()
#if defined(PHP_WIN32)
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagegrabwindow, 0, 1, GdImage, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, handle, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, client_area, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, client_area, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
#endif
@@ -113,19 +116,19 @@ ZEND_END_ARG_INFO()
#endif
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagerotate, 0, 3, GdImage, MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0)
ZEND_ARG_TYPE_INFO(0, background_color, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ignore_transparent, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO(0, bgdcolor, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ignoretransparent, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesettile, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, tile, GdImage, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetbrush, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, brush, GdImage, 0)
ZEND_END_ARG_INFO()
@@ -135,7 +138,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagetypes, 0, 0, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagecreatefromstring, 0, 1, GdImage, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, image, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagecreatefromgif, 0, 1, GdImage, MAY_BE_FALSE)
@@ -176,8 +179,8 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagecreatefromgd2part, 0, 5, GdImage, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, srcX, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, srcY, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0)
ZEND_END_ARG_INFO()
@@ -195,20 +198,20 @@ ZEND_END_ARG_INFO()
#endif
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagexbm, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 1)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, foreground_color, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, foreground, IS_LONG, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagegif, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, file, "null")
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, to, "null")
ZEND_END_ARG_INFO()
#if defined(HAVE_GD_PNG)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagepng, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, file, "null")
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, to, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, quality, IS_LONG, 0, "-1")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filters, IS_LONG, 0, "-1")
ZEND_END_ARG_INFO()
@@ -216,42 +219,42 @@ ZEND_END_ARG_INFO()
#if defined(HAVE_GD_WEBP)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagewebp, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, file, "null")
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, to, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, quality, IS_LONG, 0, "-1")
ZEND_END_ARG_INFO()
#endif
#if defined(HAVE_GD_JPG)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagejpeg, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, file, "null")
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, to, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, quality, IS_LONG, 0, "-1")
ZEND_END_ARG_INFO()
#endif
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagewbmp, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, file, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, foreground_color, IS_LONG, 1, "null")
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, to, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, foreground, IS_LONG, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagegd, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagegd2, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, chunk_size, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
ZEND_END_ARG_INFO()
#if defined(HAVE_GD_BMP)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagebmp, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, file, "null")
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, to, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, compressed, _IS_BOOL, 0, "true")
ZEND_END_ARG_INFO()
#endif
@@ -259,7 +262,7 @@ ZEND_END_ARG_INFO()
#define arginfo_imagedestroy arginfo_imageistruecolor
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imagecolorallocate, 0, 4, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, red, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, green, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, blue, IS_LONG, 0)
@@ -271,7 +274,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagepalettecopy, 0, 2, IS_VOID,
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imagecolorat, 0, 3, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0)
ZEND_END_ARG_INFO()
@@ -281,8 +284,8 @@ ZEND_END_ARG_INFO()
#define arginfo_imagecolorclosesthwb arginfo_imagecolorallocate
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolordeallocate, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_imagecolorresolve arginfo_imagecolorallocate
@@ -290,7 +293,7 @@ ZEND_END_ARG_INFO()
#define arginfo_imagecolorexact arginfo_imagecolorallocate
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolorset, 0, 5, _IS_BOOL, 1)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, red, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, green, IS_LONG, 0)
@@ -299,30 +302,30 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolorset, 0, 5, _IS_BOOL, 1
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imagecolorsforindex, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagegammacorrect, 0, 3, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, input_gamma, IS_DOUBLE, 0)
ZEND_ARG_TYPE_INFO(0, output_gamma, IS_DOUBLE, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, inputgamma, IS_DOUBLE, 0)
ZEND_ARG_TYPE_INFO(0, outputgamma, IS_DOUBLE, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetpixel, 0, 4, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, col, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageline, 0, 6, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, x1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, y1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, x2, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, y2, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, col, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_imagedashedline arginfo_imageline
@@ -332,47 +335,47 @@ ZEND_END_ARG_INFO()
#define arginfo_imagefilledrectangle arginfo_imageline
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagearc, 0, 8, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, center_x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, center_y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, start_angle, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, end_angle, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, cx, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, cy, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, w, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, h, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, s, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, e, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, col, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_imageellipse arginfo_imagefilledellipse
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilltoborder, 0, 5, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, border_color, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, border, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, col, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_imagefill arginfo_imagesetpixel
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolorstotal, 0, 1, IS_LONG, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolortransparent, 0, 1, IS_LONG, 1)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, color, IS_LONG, 1, "null")
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, col, IS_LONG, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageinterlace, 0, 1, IS_LONG, 1)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 1, "null")
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, interlace, IS_LONG, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagepolygon, 0, 3, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, points, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, num_points_or_color, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, color, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO(0, num_points_or_col, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, col, IS_LONG, 1, "null")
ZEND_END_ARG_INFO()
#define arginfo_imageopenpolygon arginfo_imagepolygon
@@ -386,47 +389,47 @@ ZEND_END_ARG_INFO()
#define arginfo_imagefontheight arginfo_imagefontwidth
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagechar, 0, 6, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, font, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, char, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, c, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, col, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_imagecharup arginfo_imagechar
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagestring, 0, 6, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, font, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, col, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_imagestringup arginfo_imagestring
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopy, 0, 8, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, dst_image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, src_image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, dst_im, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, src_im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, dst_x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, dst_y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_width, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_height, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_w, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_h, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopymerge, 0, 9, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, dst_image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, src_image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, dst_im, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, src_im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, dst_x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, dst_y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_width, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_height, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_w, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, src_h, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, pct, IS_LONG, 0)
ZEND_END_ARG_INFO()
@@ -439,7 +442,7 @@ ZEND_END_ARG_INFO()
#define arginfo_imagesy arginfo_imagecolorstotal
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetclip, 0, 5, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, x1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, x2, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, y1, IS_LONG, 0)
@@ -447,30 +450,30 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetclip, 0, 5, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagegetclip, 0, 1, IS_ARRAY, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_END_ARG_INFO()
#if defined(HAVE_GD_FREETYPE)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imageftbbox, 0, 4, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, size, IS_DOUBLE, 0)
ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0)
ZEND_ARG_TYPE_INFO(0, font_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
ZEND_ARG_TYPE_INFO(0, font_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extrainfo, IS_ARRAY, 0, "[]")
ZEND_END_ARG_INFO()
#endif
#if defined(HAVE_GD_FREETYPE)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imagefttext, 0, 8, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, size, IS_DOUBLE, 0)
ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0)
ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, font_filename, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, col, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, font_file, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extrainfo, IS_ARRAY, 0, "[]")
ZEND_END_ARG_INFO()
#endif
@@ -483,46 +486,49 @@ ZEND_END_ARG_INFO()
#endif
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilter, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, filter, IS_LONG, 0)
ZEND_ARG_VARIADIC_INFO(0, args)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, filtertype, IS_LONG, 0)
ZEND_ARG_VARIADIC_INFO(0, filter_args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageconvolution, 0, 4, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, matrix, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, divisor, IS_DOUBLE, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, matrix3x3, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, div, IS_DOUBLE, 0)
ZEND_ARG_TYPE_INFO(0, offset, IS_DOUBLE, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageflip, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_imageantialias arginfo_imagealphablending
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageantialias, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, on, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagecrop, 0, 2, GdImage, MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, rectangle, IS_ARRAY, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, rect, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagecropauto, 0, 1, GdImage, MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "IMG_CROP_DEFAULT")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, threshold, IS_DOUBLE, 0, "0.5")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, color, IS_LONG, 0, "-1")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imagescale, 0, 2, GdImage, MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, height, IS_LONG, 0, "-1")
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, new_width, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, new_height, IS_LONG, 0, "-1")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "IMG_BILINEAR_FIXED")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imageaffine, 0, 2, GdImage, MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, affine, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, clip, IS_ARRAY, 1, "null")
ZEND_END_ARG_INFO()
@@ -533,21 +539,21 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imageaffinematrixget, 0, 2, MAY_
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imageaffinematrixconcat, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, matrix1, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, matrix2, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, m1, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, m2, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
#define arginfo_imagegetinterpolation arginfo_imagecolorstotal
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetinterpolation, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, method, IS_LONG, 0, "IMG_BILINEAR_FIXED")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imageresolution, 0, 1, MAY_BE_ARRAY|MAY_BE_BOOL)
ZEND_ARG_OBJ_INFO(0, image, GdImage, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, resolution_x, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, resolution_y, IS_LONG, 1, "null")
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, res_x, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, res_y, IS_LONG, 1, "null")
ZEND_END_ARG_INFO()
+2 -2
View File
@@ -17,5 +17,5 @@ trycatch_dump(
);
?>
--EXPECT--
!! [ValueError] imagefilledpolygon(): Argument #3 ($num_points_or_color) must be greater than or equal to 3
!! [ValueError] imagepolygon(): Argument #3 ($num_points_or_color) must be greater than or equal to 3
!! [ValueError] imagefilledpolygon(): Argument #3 ($num_points_or_col) must be greater than or equal to 3
!! [ValueError] imagepolygon(): Argument #3 ($num_points_or_col) must be greater than or equal to 3
+1 -1
View File
@@ -19,5 +19,5 @@ trycatch_dump(
?>
DONE
--EXPECT--
!! [ValueError] imagetruecolortopalette(): Argument #3 ($num_colors) must be greater than 0 and less than 2147483647
!! [ValueError] imagetruecolortopalette(): Argument #3 ($colorWanted) must be greater than 0 and less than 2147483647
DONE
+1 -1
View File
@@ -20,5 +20,5 @@ imagedestroy($im);
?>
====DONE====
--EXPECT--
imagesetstyle(): Argument #2 ($style) cannot be empty
imagesetstyle(): Argument #2 ($styles) cannot be empty
====DONE====
+1 -1
View File
@@ -17,4 +17,4 @@ trycatch_dump(
?>
--EXPECT--
!! [ValueError] imagegammacorrect(): Argument #2 ($input_gamma) must be greater than 0
!! [ValueError] imagegammacorrect(): Argument #2 ($inputgamma) must be greater than 0
Loaded 100 of 513 files, more files were not shown because too many files have changed in this diff. Show more