Compare commits

..
8 Commits
Author SHA1 Message Date
Joe Watkins 9f1492bb89 bump version for release 2017-03-14 13:16:07 +00:00
Joe Watkins e6e45428d3 sync news 2017-03-14 13:11:58 +00:00
Derick Rethans b29369b539 Make sure we anchor this test to February 2017-03-03 10:20:57 +00:00
Mitch Hagstrand 4ba4fc8a46 Fix bug73858.phpt to work in months without 31 days
Used hardcoded months in bug73858.phpt rather than the current and previous
month.
2017-03-03 10:20:45 +00:00
Joe Watkins d03d7ee6b8 Revert "Fix bug #74159"
This reverts commit e9873d9853.
2017-03-03 06:29:46 +00:00
Joe Watkins f19c3d4bdf Revert "Update test for bug #74159"
This reverts commit ff8a6b1232.
2017-03-03 06:29:31 +00:00
Remi Collet 33444dc0b0 make test slower again 2017-02-28 14:14:31 +00:00
Joe Watkins a64b17ffde bump version for RC1 2017-02-28 09:48:37 +00:00
179 changed files with 9442 additions and 11608 deletions

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
PHP_BUILD_OBJ_DIR: c:\obj
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.1
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.0beta1
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
#MYSQL_TEST_USER: root
-139
View File
@@ -1,134 +1,5 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 May 2017, PHP 7.1.5
- Core:
. Fixed bug #74408 (Endless loop bypassing execution time limit). (Laruence)
. Fixed bug #74353 (Segfault when killing within bash script trap code).
(Laruence)
. Fixed bug #74340 (Magic function __get has different behavior in php 7.1.x).
(Nikita)
. Fixed bug #74188 (Null coalescing operator fails for undeclared static
class properties). (tpunt)
. Fixed bug #74444 (multiple catch freezes in some cases). (David Matějka)
. Fixed bug #74410 (stream_select() is broken on Windows Nanoserver).
(Matt Ficken)
. Fixed bug #74337 (php-cgi.exe crash on facebook callback).
(Anton Serbulov)
- Date:
. Fixed bug #74404 (Wrong reflection on DateTimeZone::getTransitions).
(krakjoe)
. Fixed bug #74080 (add constant for RFC7231 format datetime). (duncan3dc)
- DOM:
. Fixed bug #74416 (Wrong reflection on DOMNode::cloneNode).
(Remi, Fabien Villepinte)
- Fileinfo:
. Fixed bug #74379 (syntax error compile error in libmagic/apprentice.c).
(Laruence)
- GD:
. Fixed bug #74343 (compile fails on solaris 11 with system gd2 library).
(krakjoe)
- MySQLnd:
. Fixed bug #74376 (Invalid free of persistent results on error/connection
loss). (Yussuf Khalil)
- Intl:
. Fixed bug #65683 (Intl does not support DateTimeImmutable). (Ben Scholzen)
. Fixed bug #74298 (IntlDateFormatter->format() doesn't return
microseconds/fractions). (Andrew Nester)
. Fixed bug #74433 (wrong reflection for Normalizer methods). (villfa)
. Fixed bug #74439 (wrong reflection for Locale methods). (villfa)
- Opcache:
. Fixed bug #74456 (Segmentation error while running a script in CLI mode).
(Laruence)
. Fixed bug #74431 (foreach infinite loop). (Nikita)
. Fixed bug #74442 (Opcached version produces a nested array). (Nikita)
- OpenSSL:
. Fixed bug #73833 (null character not allowed in openssl_pkey_get_private).
(Jakub Zelenka)
. Fixed bug #73711 (Segfault in openssl_pkey_new when generating DSA or DH
key). (Jakub Zelenka)
. Fixed bug #74341 (openssl_x509_parse fails to parse ASN.1 UTCTime without
seconds). (Moritz Fain)
- phar:
. Fixed bug #74383 (phar method parameters reflection correction).
(mhagstrand)
- Readline:
. Fixed bug #74489 (readline() immediately returns false in interactive
console mode). (Anatol)
- Standard:
. Fixed bug #72071 (setcookie allows max-age to be negative). (Craig Duncan)
. Fixed bug #74361 (Compaction in array_rand() violates COW). (Nikita)
- Streams:
. Fixed bug #74429 (Remote socket URI with unique persistence identifier
broken). (Sara)
13 Apr 2017, PHP 7.1.4
- Core:
. Fixed bug #74149 (static embed SAPI linkage error). (krakjoe)
. Fixed bug #73370 (falsely exits with "Out of Memory" when using
USE_ZEND_ALLOC=0). (Nikita)
. Fixed bug #73960 (Leak with instance method calling static method with
referenced return). (Nikita)
. Fixed bug #69676 (Resolution of self::FOO in class constants not correct).
(Nikita)
. Fixed bug #74265 (Build problems after 7.0.17 release: undefined reference
to `isfinite'). (Nikita)
. Fixed bug #74302 (yield fromLABEL is over-greedy). (Sara)
- Apache:
. Reverted patch for bug #61471, fixes bug #74318. (Anatol)
- Date:
. Fixed bug #72096 (Swatch time value incorrect for dates before 1970). (mcq8)
- DOM:
. Fixed bug #74004 (LIBXML_NOWARNING flag ingnored on loadHTML*).
(somedaysummer)
- iconv:
. Fixed bug #74230 (iconv fails to fail on surrogates). (Anatol)
- OCI8:
. Fixed uninitialized data causing random crash. (Dmitry)
- Opcache:
. Fixed bug #74250 (OPcache compilation performance regression in PHP 5.6/7
with huge classes). (Nikita)
- OpenSSL:
. Fixed bug #72333 (fwrite() on non-blocking SSL sockets doesn't work).
(Jakub Zelenka)
- PDO MySQL:
. Fixed bug #71003 (Expose MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT to PDO
interface). (Thomas Orozco)
- SPL:
. Fixed bug #74058 (ArrayObject can not notice changes). (Andrew Nester)
- Sqlite:
. Implemented FR #74217 (Allow creation of deterministic sqlite functions).
(Andrew Nester)
- Streams:
. Fixed bug #74216 (Correctly fail on invalid IP address ports). (Sara)
- Zlib:
. Fixed bug #74240 (deflate_add can allocate too much memory). (Matt Bonneau)
16 Mar 2017, PHP 7.1.3
- Core:
@@ -173,22 +44,12 @@ PHP NEWS
(Andrew Nester, Nikita)
- Opcache:
. Fixed bug #74152 (if statement says true to a null variable). (Laruence)
. Fixed bug #74019 (Segfault with list). (Laruence)
- OpenSSL:
. Fixed bug #74022 (PHP Fast CGI crashes when reading from a pfx file).
(Anatol)
. Fixed bug #74099 (Memory leak with openssl_encrypt()). (Andrew Nester)
. Fixed bug #74159 (Writing a large buffer to a non-blocking encrypted stream
fails with "bad write retry"). (trowski)
- PDO_OCI:
. Fixed bug #54379 (PDO_OCI: UTF-8 output gets truncated). (gureedo / Oracle)
- SQLite3:
. Fixed bug #74413 (incorrect reflection for SQLite3::enableExceptions).
(krakjoe)
- Standard:
. Fixed bug #74005 (mail.add_x_header causes RFC-breaking lone line feed).
+3 -2
View File
@@ -721,6 +721,7 @@ TSRM_API int shmget(int key, int size, int flags)
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
{
shm_pair *shm = shm_get(key, NULL);
int err;
if (!shm->segment) {
return (void*)-1;
@@ -728,8 +729,8 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
if (NULL == shm->addr) {
int err = GetLastError();
err = GetLastError();
if (err) {
SET_ERRNO_FROM_WIN32_CODE(err);
return (void*)-1;
}
+3 -3
View File
@@ -70,7 +70,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#ifndef zend_isnan
#if HAVE_DECL_ISNAN
#ifdef HAVE_DECL_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@@ -79,7 +79,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#endif
#if HAVE_DECL_ISINF
#ifdef HAVE_DECL_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
@@ -90,7 +90,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_isinf(a) 0
#endif
#if HAVE_DECL_ISFINITE
#if defined(HAVE_DECL_ISFINITE)
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #69676: Resolution of self::FOO in class constants not correct (variation)
--FILE--
<?php
class Foo {
const A = 'Foo::A';
const B = self::A . ' and ' . self::C;
const C = 'Foo::C';
}
class Bar extends Foo {
const A = 'Bar::A';
const C = 'Bar::C';
}
var_dump(Bar::B);
?>
--EXPECT--
string(17) "Foo::A and Foo::C"
-69
View File
@@ -1,69 +0,0 @@
--TEST--
Bug #69676: Resolution of self::FOO in class constants not correct (variation)
--FILE--
<?php
class P {
const N = 'P';
}
class A extends P {
const selfN = self::N;
const parentN = parent::N;
const N = 'A';
}
class B extends A {
const N = 'B';
}
var_dump(B::selfN); // A
var_dump(B::parentN); // P
class A2 {
const selfN = self::N;
const N = 'A2';
}
class B2 extends A2 {
const indSelfN = self::selfN;
const N = 'B2';
}
class C2 extends B2 {
const N = 'C2';
}
var_dump(C2::indSelfN); // A2
class A3 {
const selfN = self::N;
const N = 'A3';
}
class B3 extends A3 {
const exprSelfN = "expr" . self::selfN;
const N = 'B3';
}
class C3 extends B3 {
const N = 'C3';
}
var_dump(C3::exprSelfN); // exprA3
class A4 {
const selfN = self::N;
const N = 'A4';
}
class B4 extends A4 {
const N = 'B4';
public $prop = self::selfN;
}
class C4 extends B4 {
const N = 'C4';
}
var_dump((new C4)->prop); // A4
?>
--EXPECT--
string(1) "A"
string(1) "P"
string(2) "A2"
string(6) "exprA3"
string(2) "A4"
+1 -1
View File
@@ -79,7 +79,7 @@ Stack trace:
#0 %sbug72101.php(8): {closure}(2, 'Parameter 1 to ...', '%s', 8, Array)
#1 %sbug72101.php(27): PHPUnit_Framework_MockObject_Stub_ReturnCallback->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#2 %sbug72101.php(19): PHPUnit_Framework_MockObject_Matcher->invoked(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#3 %sbug72101.php(52): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#3 %sbug72101.php(51): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#4 %sbug72101.php(72): Mock_MethodCallbackByReference_7b180d26->bar(0, 0, 0)
#5 {main}
thrown in %sbug72101.php on line 61
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Bug #73960: Leak with instance method calling static method with referenced return
--FILE--
<?php
$value = 'one';
$array = array($value);
$array = $ref =& $array;
var_dump($array);
?>
--EXPECT--
array(1) {
[0]=>
string(3) "one"
}
-14
View File
@@ -1,14 +0,0 @@
--TEST--
Fixes bug 74188 (undeclared static variables emit a warning with ?? operator)
--FILE--
<?php
abstract class Test
{
public static function get()
{
static::$a ?? true;
}
}
Test::get();
?>
--EXPECT--
-30
View File
@@ -1,30 +0,0 @@
--TEST--
Bug #74340: Magic function __get has different behavior in php 7.1.x
--FILE--
<?php
class Test
{
public function __get($var)
{
static $first = true;
echo '__get '.$var.PHP_EOL;
if ($first) {
$first = false;
$this->$var;
$this->{$var.'2'};
$this->$var;
}
}
}
$test = new Test;
$test->test;
?>
--EXPECTF--
__get test
Notice: Undefined property: Test::$test in %s on line %d
__get test2
Notice: Undefined property: Test::$test in %s on line %d
-38
View File
@@ -1,38 +0,0 @@
--TEST--
Bug #74408 (Endless loop bypassing execution time limit)
--INI--
error_reporting = E_ALL | E_DEPRECATED | E_STRICT
--FILE--
<?php
//php.ini: error_reporting = E_ALL | E_DEPRECATED | E_STRICT
class ErrorHandling {
public function error_handler($errno, $errstr, $errfile, $errline) {
$bla = new NonExistingClass2();
}
public function exception_handler(Error $e) {
echo "Caught, exception: " . $e->getMessage();
}
}
set_error_handler('ErrorHandling::error_handler');
set_exception_handler('ErrorHandling::exception_handler');
$blubb = new NonExistingClass();
?>
--EXPECTF--
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in Unknown on line 0
Fatal error: Uncaught Error: Class 'NonExistingClass2' not found in %sbug74408.php:%d
Stack trace:
#0 [internal function]: ErrorHandling::error_handler(8192, 'Non-static meth...', '%s', %d, Array)
#1 %sbug74408.php(%d): set_exception_handler('ErrorHandling::...')
#2 {main}
thrown in %sbug74408.php on line %d
-10
View File
@@ -1,10 +0,0 @@
--TEST--
Use of non-literals in declare ticks values crashes compiler
--FILE--
<?php
declare(ticks = UNKNOWN_CONST) {
echo 'Done';
}
--EXPECTF--
Fatal error: declare(ticks) value must be a literal in %sdeclare_006.php on line 2
@@ -1,24 +0,0 @@
--TEST--
yield from parses too greedily
--FILE--
<?php
function from1234($x) {
return $x;
}
function bar() {
yield 24;
}
function foo() {
yield from1234(42);
yield from(bar());
}
foreach (foo() as $value) {
var_dump($value);
}
--EXPECT--
int(42)
int(24)
-77
View File
@@ -1,77 +0,0 @@
--TEST--
Bug #74444 (multiple catch freezes in some cases)
--FILE--
<?php
function foo()
{
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
try {
throw new \RuntimeException();
} catch (\FooEx | \RuntimeException $e) {
echo 1;
}
echo 2;
}
foo();
--EXPECT--
12
+1 -1
View File
@@ -1132,7 +1132,7 @@ ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
ZEND_HASH_FOREACH_PTR(&class_type->constants_table, c) {
val = &c->value;
if (Z_CONSTANT_P(val)) {
if (UNEXPECTED(zval_update_constant_ex(val, c->ce) != SUCCESS)) {
if (UNEXPECTED(zval_update_constant_ex(val, class_type) != SUCCESS)) {
return FAILURE;
}
}
+2 -2
View File
@@ -2818,7 +2818,7 @@ static ZEND_COLD ZEND_NORETURN void zend_out_of_memory(void)
ZEND_API void * __zend_malloc(size_t len)
{
void *tmp = malloc(len);
if (EXPECTED(tmp || !len)) {
if (EXPECTED(tmp)) {
return tmp;
}
zend_out_of_memory();
@@ -2834,7 +2834,7 @@ ZEND_API void * __zend_calloc(size_t nmemb, size_t len)
ZEND_API void * __zend_realloc(void *p, size_t len)
{
p = realloc(p, len);
if (EXPECTED(p || !len)) {
if (EXPECTED(p)) {
return p;
}
zend_out_of_memory();
+3 -14
View File
@@ -57,21 +57,17 @@ ZEND_API zend_ast *zend_ast_create_znode(znode *node) {
return (zend_ast *) ast;
}
ZEND_API zend_ast *zend_ast_create_zval_with_lineno(zval *zv, zend_ast_attr attr, uint32_t lineno) {
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
zend_ast_zval *ast;
ast = zend_ast_alloc(sizeof(zend_ast_zval));
ast->kind = ZEND_AST_ZVAL;
ast->attr = attr;
ZVAL_COPY_VALUE(&ast->val, zv);
ast->val.u2.lineno = lineno;
ast->val.u2.lineno = CG(zend_lineno);
return (zend_ast *) ast;
}
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
return zend_ast_create_zval_with_lineno(zv, attr, CG(zend_lineno));
}
ZEND_API zend_ast *zend_ast_create_decl(
zend_ast_kind kind, uint32_t flags, uint32_t start_lineno, zend_string *doc_comment,
zend_string *name, zend_ast *child0, zend_ast *child1, zend_ast *child2, zend_ast *child3
@@ -159,14 +155,7 @@ ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind ki
uint32_t i;
va_start(va, kind);
for (i = 0; i < init_children; ++i) {
zend_ast *child = va_arg(va, zend_ast *);
ast = zend_ast_list_add(ast, child);
if (child != NULL) {
uint32_t lineno = zend_ast_get_lineno(child);
if (lineno < ast->lineno) {
ast->lineno = lineno;
}
}
ast = zend_ast_list_add(ast, va_arg(va, zend_ast *));
}
va_end(va);
}
-1
View File
@@ -189,7 +189,6 @@ typedef struct _zend_ast_decl {
typedef void (*zend_ast_process_t)(zend_ast *ast);
extern ZEND_API zend_ast_process_t zend_ast_process;
ZEND_API zend_ast *zend_ast_create_zval_with_lineno(zval *zv, zend_ast_attr attr, uint32_t lineno);
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr);
ZEND_API zend_ast *zend_ast_create_ex(zend_ast_kind kind, zend_ast_attr attr, ...);
+2 -11
View File
@@ -1690,7 +1690,6 @@ int zendlex(zend_parser_stack_elem *elem) /* {{{ */
{
zval zv;
int retval;
uint32_t start_lineno;
if (CG(increment_lineno)) {
CG(zend_lineno)++;
@@ -1699,7 +1698,6 @@ int zendlex(zend_parser_stack_elem *elem) /* {{{ */
again:
ZVAL_UNDEF(&zv);
start_lineno = CG(zend_lineno);
retval = lex_scan(&zv);
if (EG(exception)) {
return T_ERROR;
@@ -1723,7 +1721,7 @@ again:
break;
}
if (Z_TYPE(zv) != IS_UNDEF) {
elem->ast = zend_ast_create_zval_with_lineno(&zv, 0, start_lineno);
elem->ast = zend_ast_create_zval(&zv);
}
return retval;
@@ -4810,7 +4808,6 @@ void zend_compile_try(zend_ast *ast) /* {{{ */
if (!is_last_class) {
jmp_multicatch[j] = zend_emit_jump(0);
opline = &CG(active_op_array)->opcodes[opnum_catch];
opline->extended_value = get_next_op_number(CG(active_op_array));
}
}
@@ -4968,12 +4965,8 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */
zend_ast *declare_ast = declares->child[i];
zend_ast *name_ast = declare_ast->child[0];
zend_ast *value_ast = declare_ast->child[1];
zend_string *name = zend_ast_get_str(name_ast);
if (value_ast->kind != ZEND_AST_ZVAL) {
zend_error_noreturn(E_COMPILE_ERROR, "declare(%s) value must be a literal", ZSTR_VAL(name));
}
if (zend_string_equals_literal_ci(name, "ticks")) {
zval value_zv;
zend_const_expr_to_zval(&value_zv, value_ast);
@@ -8011,8 +8004,6 @@ void zend_compile_expr(znode *result, zend_ast *ast) /* {{{ */
void zend_compile_var(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
CG(zend_lineno) = zend_ast_get_lineno(ast);
switch (ast->kind) {
case ZEND_AST_VAR:
zend_compile_simple_var(result, ast, type, 0);
+2 -3
View File
@@ -327,7 +327,6 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
size_t const_name_len = name_len - class_name_len - 2;
zend_string *constant_name = zend_string_init(colon + 1, const_name_len, 0);
zend_string *class_name = zend_string_init(name, class_name_len, 0);
zend_class_constant *c = NULL;
zval *ret_constant = NULL;
if (zend_string_equals_literal_ci(class_name, "self")) {
@@ -356,7 +355,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
ce = zend_fetch_class(class_name, flags);
}
if (ce) {
c = zend_hash_find_ptr(&ce->constants_table, constant_name);
zend_class_constant *c = zend_hash_find_ptr(&ce->constants_table, constant_name);
if (c == NULL) {
if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
zend_throw_error(NULL, "Undefined class constant '%s::%s'", ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
@@ -381,7 +380,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
}
MARK_CONSTANT_VISITED(ret_constant);
}
if (UNEXPECTED(zval_update_constant_ex(ret_constant, c->ce) != SUCCESS)) {
if (UNEXPECTED(zval_update_constant_ex(ret_constant, ce) != SUCCESS)) {
RESET_CONSTANT_VISITED(ret_constant);
ret_constant = NULL;
goto failure;
-4
View File
@@ -81,10 +81,6 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
return variable_ptr;
}
if (ZEND_CONST_COND(value_type & (IS_VAR|IS_CV), 1) && variable_ptr == value) {
if (value_type == IS_VAR && ref) {
ZEND_ASSERT(GC_REFCOUNT(ref) > 1);
--GC_REFCOUNT(ref);
}
return variable_ptr;
}
garbage = Z_COUNTED_P(variable_ptr);
-9
View File
@@ -748,15 +748,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
}
zend_error(E_DEPRECATED, "%s", error);
efree(error);
if (UNEXPECTED(EG(exception))) {
if (callable_name) {
zend_string_release(callable_name);
}
if (EG(current_execute_data) == &dummy_execute_data) {
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
}
return FAILURE;
}
}
zend_string_release(callable_name);
}
+3 -6
View File
@@ -325,12 +325,9 @@ static zend_always_inline gc_root_buffer* gc_find_additional_buffer(zend_refcoun
/* We have to check each additional_buffer to find which one holds the ref */
while (additional_buffer) {
uint32_t idx = GC_ADDRESS(GC_INFO(ref)) - GC_ROOT_BUFFER_MAX_ENTRIES;
if (idx < additional_buffer->used) {
gc_root_buffer *root = additional_buffer->buf + idx;
if (root->ref == ref) {
return root;
}
gc_root_buffer *root = additional_buffer->buf + (GC_ADDRESS(GC_INFO(ref)) - GC_ROOT_BUFFER_MAX_ENTRIES);
if (root->ref == ref) {
return root;
}
additional_buffer = additional_buffer->next;
}
+4963 -5151
View File
File diff suppressed because it is too large. Load diff
+1 -2
View File
@@ -1142,8 +1142,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
RETURN_TOKEN(T_RETURN);
}
<ST_IN_SCRIPTING>"yield"{WHITESPACE}"from"[^a-zA-Z0-9_\x80-\xff] {
yyless(yyleng - 1);
<ST_IN_SCRIPTING>"yield"{WHITESPACE}"from" {
HANDLE_NEWLINES(yytext, yyleng);
RETURN_TOKEN(T_YIELD_FROM);
}
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.16 */
/* Generated by re2c 0.13.5 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {
+1 -1
View File
@@ -545,7 +545,7 @@ ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *membe
ALLOC_HASHTABLE(guards);
zend_hash_init(guards, 8, NULL, zend_property_guard_dtor, 0);
/* mark pointer as "special" using low bit */
zend_hash_add_new_ptr(guards, str,
zend_hash_add_new_ptr(guards, member,
(void*)(((zend_uintptr_t)&zv->u2.property_guard) | 1));
zend_string_release(Z_STR_P(zv));
ZVAL_ARR(zv, guards);
+3 -15
View File
@@ -86,17 +86,12 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
{
int errno_save = errno;
zend_signal_queue_t *queue, *qtmp;
zend_bool is_handling_safe = 1;
#ifdef ZTS
ZEND_TSRMLS_CACHE_UPDATE();
/* A signal could hit after TSRM shutdown, in this case globals are already freed. */
if (NULL == TSRMLS_CACHE || NULL == TSRMG_BULK_STATIC(zend_signal_globals_id, zend_signal_globals_t *)) {
is_handling_safe = 0;
}
#endif
if (EXPECTED(is_handling_safe && SIGG(active))) {
if (EXPECTED(SIGG(active))) {
if (UNEXPECTED(SIGG(depth) == 0)) { /* try to handle signal */
if (UNEXPECTED(SIGG(blocked))) {
SIGG(blocked) = 0;
@@ -179,14 +174,7 @@ static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context)
int errno_save = errno;
struct sigaction sa;
sigset_t sigset;
zend_signal_entry_t p_sig;
#ifdef ZTS
if (NULL == TSRMLS_CACHE || NULL == TSRMG_BULK_STATIC(zend_signal_globals_id, zend_signal_globals_t *)) {
p_sig.flags = 0;
p_sig.handler = SIG_DFL;
} else
#endif
p_sig = SIGG(handlers)[signo-1];
zend_signal_entry_t p_sig = SIGG(handlers)[signo-1];
if (p_sig.handler == SIG_DFL) { /* raise default handler */
if (sigaction(signo, NULL, &sa) == 0) {
@@ -210,7 +198,7 @@ static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context)
#endif
}
}
} else if (p_sig.handler != SIG_IGN) {
} else {
if (p_sig.flags & SA_SIGINFO) {
if (p_sig.flags & SA_RESETHAND) {
SIGG(handlers)[signo-1].flags = 0;
-2
View File
@@ -88,9 +88,7 @@ END_EXTERN_C()
ZEND_API void zend_signal_handler_unblock(void);
void zend_signal_activate(void);
void zend_signal_deactivate(void);
BEGIN_EXTERN_C()
void zend_signal_startup(void);
END_EXTERN_C()
void zend_signal_init(void);
ZEND_API int zend_signal(int signo, void (*handler)(int));
+1 -1
View File
@@ -380,7 +380,7 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
size_t len = strlen(path);
if (len >= 4 && path[len-4] == '.') {
if (path[len-4] == '.') {
if (_memicmp(path+len-3, "exe", 3) == 0 ||
_memicmp(path+len-3, "com", 3) == 0 ||
_memicmp(path+len-3, "bat", 3) == 0 ||
+15 -26
View File
@@ -1692,13 +1692,9 @@ ZEND_VM_HELPER(zend_fetch_static_prop_helper, CONST|TMPVAR|CV, UNUSED|CONST|VAR,
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
}
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
}
ZEND_VM_C_GOTO(fetch_static_prop_return);
@@ -1733,31 +1729,24 @@ ZEND_VM_HELPER(zend_fetch_static_prop_helper, CONST|TMPVAR|CV, UNUSED|CONST|VAR,
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
}
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
}
ZEND_VM_C_GOTO(fetch_static_prop_return);
}
}
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(retval == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
ZEND_ASSERT(EG(exception));
if (OP1_TYPE != IS_CONST) {
zend_string_release(name);
}
FREE_OP1();
HANDLE_EXCEPTION();
ZEND_ASSERT(EG(exception));
if (OP1_TYPE != IS_CONST) {
zend_string_release(name);
}
} else if (OP1_TYPE == IS_CONST) {
FREE_OP1();
HANDLE_EXCEPTION();
}
if (OP1_TYPE == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
@@ -5202,7 +5191,7 @@ ZEND_VM_HANDLER(181, ZEND_FETCH_CLASS_CONSTANT, VAR|CONST|UNUSED|CLASS_FETCH, CO
}
value = &c->value;
if (Z_CONSTANT_P(value)) {
zval_update_constant_ex(value, c->ce);
zval_update_constant_ex(value, ce);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
+117 -216
View File
@@ -4869,13 +4869,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
@@ -4910,31 +4906,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
}
}
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(retval == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
ZEND_ASSERT(EG(exception));
if (IS_CONST != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
ZEND_ASSERT(EG(exception));
if (IS_CONST != IS_CONST) {
zend_string_release(name);
}
} else if (IS_CONST == IS_CONST) {
HANDLE_EXCEPTION();
}
if (IS_CONST == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
@@ -5808,7 +5797,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_CONS
}
value = &c->value;
if (Z_CONSTANT_P(value)) {
zval_update_constant_ex(value, c->ce);
zval_update_constant_ex(value, ce);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -6733,13 +6722,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
@@ -6774,31 +6759,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
}
}
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(retval == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
ZEND_ASSERT(EG(exception));
if (IS_CONST != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
ZEND_ASSERT(EG(exception));
if (IS_CONST != IS_CONST) {
zend_string_release(name);
}
} else if (IS_CONST == IS_CONST) {
HANDLE_EXCEPTION();
}
if (IS_CONST == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
@@ -7316,13 +7294,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
@@ -7357,31 +7331,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
}
}
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(retval == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
ZEND_ASSERT(EG(exception));
if (IS_CONST != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
ZEND_ASSERT(EG(exception));
if (IS_CONST != IS_CONST) {
zend_string_release(name);
}
} else if (IS_CONST == IS_CONST) {
HANDLE_EXCEPTION();
}
if (IS_CONST == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
@@ -20018,7 +19985,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_
}
value = &c->value;
if (Z_CONSTANT_P(value)) {
zval_update_constant_ex(value, c->ce);
zval_update_constant_ex(value, ce);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -29823,7 +29790,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUS
}
value = &c->value;
if (Z_CONSTANT_P(value)) {
zval_update_constant_ex(value, c->ce);
zval_update_constant_ex(value, ce);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -37975,13 +37942,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
@@ -38016,31 +37979,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
}
}
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(retval == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
ZEND_ASSERT(EG(exception));
if (IS_CV != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
ZEND_ASSERT(EG(exception));
if (IS_CV != IS_CONST) {
zend_string_release(name);
}
} else if (IS_CV == IS_CONST) {
HANDLE_EXCEPTION();
}
if (IS_CV == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
@@ -41049,13 +41005,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
@@ -41090,31 +41042,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
}
}
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(retval == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
ZEND_ASSERT(EG(exception));
if (IS_CV != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
ZEND_ASSERT(EG(exception));
if (IS_CV != IS_CONST) {
zend_string_release(name);
}
} else if (IS_CV == IS_CONST) {
HANDLE_EXCEPTION();
}
if (IS_CV == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
@@ -42108,13 +42053,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
@@ -42149,31 +42090,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
}
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
}
}
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(retval == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
ZEND_ASSERT(EG(exception));
if (IS_CV != IS_CONST) {
zend_string_release(name);
}
HANDLE_EXCEPTION();
ZEND_ASSERT(EG(exception));
if (IS_CV != IS_CONST) {
zend_string_release(name);
}
} else if (IS_CV == IS_CONST) {
HANDLE_EXCEPTION();
}
if (IS_CV == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
@@ -52478,13 +52412,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
@@ -52519,31 +52449,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
}
}
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(retval == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
ZEND_ASSERT(EG(exception));
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
ZEND_ASSERT(EG(exception));
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
}
} else if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
@@ -53438,13 +53361,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
@@ -53479,31 +53398,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
}
}
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(retval == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
ZEND_ASSERT(EG(exception));
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
ZEND_ASSERT(EG(exception));
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
}
} else if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
@@ -53937,13 +53849,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
@@ -53978,31 +53886,24 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
goto fetch_static_prop_return;
}
}
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
retval = zend_std_get_static_property(ce, name, 0);
if (UNEXPECTED(retval == NULL)) {
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
ZEND_ASSERT(EG(exception));
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
}
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
ZEND_ASSERT(EG(exception));
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
}
} else if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
+4 -3
View File
@@ -12,14 +12,15 @@ if %errorlevel% neq 0 exit /b 3
if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
set STABILITY=stable
) else (
set BRANCH=master
set STABILITY=staging
)
set STABILITY=staging
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%BRANCH%
rem SDK is cached, deps info is cached as well
echo Updating dependencies in %DEPS_DIR%
call phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
call phpsdk_deps --update --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
if %errorlevel% neq 0 exit /b 3
call buildconf.bat --force
+1 -1
View File
@@ -11,7 +11,7 @@ if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
set BRANCH=master
set STABILITY=staging
)
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%BRANCH%
rem setup MySQL related exts
set MYSQL_PWD=Password12!
+4 -4
View File
@@ -75,7 +75,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#ifndef zend_isnan
#if HAVE_DECL_ISNAN
#ifdef HAVE_DECL_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@@ -84,7 +84,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#endif
#if HAVE_DECL_ISINF
#ifdef HAVE_DECL_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
@@ -95,7 +95,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_isinf(a) 0
#endif
#if HAVE_DECL_ISFINITE
#if defined(HAVE_DECL_ISFINITE)
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=1
PHP_RELEASE_VERSION=5
PHP_RELEASE_VERSION=3
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+1 -1
View File
@@ -1,4 +1,4 @@
#ifdef PHP_WIN32
#if PHP_WIN32
#include "../../../../main/config.w32.h"
#else
#include <php_config.h>
+1 -1
View File
@@ -40,7 +40,7 @@ SPNEGO => Yes
SSL => Yes
SSPI => Yes
TLS-SRP => No
HTTP2 => Yes
HTTP2 => No
GSSAPI => No
KERBEROS5 => Yes
UNIX_SOCKETS => No
+3600 -3673
View File
File diff suppressed because it is too large. Load diff
+10 -19
View File
@@ -345,7 +345,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_transitions_get, 0, 0, 1)
ZEND_ARG_INFO(0, timestamp_end)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_method_transitions_get, 0, 0, 0)
ZEND_BEGIN_ARG_INFO(arginfo_timezone_method_transitions_get, 0)
ZEND_ARG_INFO(0, timestamp_begin)
ZEND_ARG_INFO(0, timestamp_end)
ZEND_END_ARG_INFO()
@@ -775,11 +775,6 @@ PHP_RSHUTDOWN_FUNCTION(date)
*/
#define DATE_FORMAT_RFC1123 "D, d M Y H:i:s O"
/*
* RFC7231, Section 7.1.1: http://tools.ietf.org/html/rfc7231
*/
#define DATE_FORMAT_RFC7231 "D, d M Y H:i:s \\G\\M\\T"
/*
* RFC2822, Section 3.3: http://www.ietf.org/rfc/rfc2822.txt
* FWS = ([*WSP CRLF] 1*WSP) / ; Folding white space
@@ -873,7 +868,6 @@ PHP_MINIT_FUNCTION(date)
REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC1036", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC1123", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC7231", DATE_FORMAT_RFC7231, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC2822", DATE_FORMAT_RFC2822, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC3339", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC3339_EXTENDED", DATE_FORMAT_RFC3339_EXTENDED, CONST_CS | CONST_PERSISTENT);
@@ -1159,12 +1153,11 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
case 'a': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break;
case 'A': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "PM" : "AM"); break;
case 'B': {
int retval = ((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10);
if (retval < 0) {
retval += 864000;
int retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864);
while (retval < 0) {
retval += 1000;
}
/* Make sure to do this on a positive int to avoid rounding errors */
retval = (retval / 864) % 1000;
retval = retval % 1000;
length = slprintf(buffer, 32, "%03d", retval);
break;
}
@@ -1355,12 +1348,11 @@ PHPAPI int php_idate(char format, time_t ts, int localtime)
/* Swatch Beat a.k.a. Internet Time */
case 'B':
retval = ((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10);
if (retval < 0) {
retval += 864000;
retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864);
while (retval < 0) {
retval += 1000;
}
/* Make sure to do this on a positive int to avoid rounding errors */
retval = (retval / 864) % 1000;
retval = retval % 1000;
break;
/* time */
@@ -2068,7 +2060,6 @@ static void date_register_classes(void) /* {{{ */
REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC850);
REGISTER_DATE_CLASS_CONST_STRING("RFC1036", DATE_FORMAT_RFC1036);
REGISTER_DATE_CLASS_CONST_STRING("RFC1123", DATE_FORMAT_RFC1123);
REGISTER_DATE_CLASS_CONST_STRING("RFC7231", DATE_FORMAT_RFC7231);
REGISTER_DATE_CLASS_CONST_STRING("RFC2822", DATE_FORMAT_RFC2822);
REGISTER_DATE_CLASS_CONST_STRING("RFC3339", DATE_FORMAT_RFC3339);
REGISTER_DATE_CLASS_CONST_STRING("RFC3339_EXTENDED", DATE_FORMAT_RFC3339_EXTENDED);
@@ -2555,7 +2546,7 @@ static void update_errors_warnings(timelib_error_container *last_errors) /* {{{
static void php_date_set_time_fraction(timelib_time *time, int microseconds)
{
time->f = (double) microseconds / 1000000;
time->f = microseconds / 1000000;
}
static void php_date_get_current_time_with_fraction(time_t *sec, suseconds_t *usec)
+1 -3
View File
@@ -156,7 +156,7 @@ array(18) {
}
}
..and get names of all its class constants
array(13) {
array(12) {
["ATOM"]=>
string(13) "Y-m-d\TH:i:sP"
["COOKIE"]=>
@@ -171,8 +171,6 @@ array(13) {
string(16) "D, d M y H:i:s O"
["RFC1123"]=>
string(16) "D, d M Y H:i:s O"
["RFC7231"]=>
string(21) "D, d M Y H:i:s \G\M\T"
["RFC2822"]=>
string(16) "D, d M Y H:i:s O"
["RFC3339"]=>
+11 -11
View File
@@ -43,20 +43,20 @@ foreach ($tests as $test) {
print "wanted = Monday 00:00:00\n\n";
}
?>
--EXPECTF--
--EXPECT--
Europe/Andorra
ts = Monday 2037-10-19 17:17:17 CEST
result = Monday 2037-10-26 00:00:00 CET
wanted = Monday 00:00:00
Asia/Dubai
ts = Thursday 1970-01-01 17:17:17 %s
result = Monday 1970-01-05 00:00:00 %s
ts = Thursday 1970-01-01 17:17:17 GST
result = Monday 1970-01-05 00:00:00 GST
wanted = Monday 00:00:00
Asia/Kabul
ts = Thursday 1970-01-01 17:17:17 %s
result = Monday 1970-01-05 00:00:00 %s
ts = Thursday 1970-01-01 17:17:17 AFT
result = Monday 1970-01-05 00:00:00 AFT
wanted = Monday 00:00:00
America/Antigua
@@ -130,8 +130,8 @@ result = Monday 1971-01-04 00:00:00 AST
wanted = Monday 00:00:00
Asia/Dacca
ts = Friday 1971-01-01 17:17:17 %s
result = Monday 1971-01-04 00:00:00 %s
ts = Friday 1971-01-01 17:17:17 DACT
result = Monday 1971-01-04 00:00:00 DACT
wanted = Monday 00:00:00
Europe/Brussels
@@ -150,13 +150,13 @@ result = Monday 1983-04-18 01:00:00 CEST
wanted = Monday 00:00:00
America/Buenos_Aires
ts = Monday 1974-09-30 17:17:17 %s
result = Monday 1974-10-07 00:00:00 %s
ts = Monday 1974-09-30 17:17:17 ART
result = Monday 1974-10-07 00:00:00 ART
wanted = Monday 00:00:00
America/Rosario
ts = Monday 1974-09-30 17:17:17 %s
result = Monday 1974-10-07 00:00:00 %s
ts = Monday 1974-09-30 17:17:17 ART
result = Monday 1974-10-07 00:00:00 ART
wanted = Monday 00:00:00
Europe/Vienna
+27 -27
View File
@@ -41,7 +41,7 @@ foreach ($timezones as $timezone) {
echo "\n";
}
?>
--EXPECTF--
--EXPECT--
America/Chicago
1076824799 [2004-02-14 23:59:59 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
1076824800 [2004-02-15 00:00:00 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
@@ -88,31 +88,31 @@ Asia/Jerusalem
1083099600 [2004-04-28 00:00:00 IDT] [2004-04-07 00:00:00 +21 days]
Asia/Singapore
1076774399 [2004-02-14 23:59:59 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
1076774400 [2004-02-15 00:00:00 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
1076774401 [2004-02-15 00:00:01 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
1079452800 [2004-03-17 00:00:00 %s] [2004-04-07 00:00:00 -21 days]
1080316800 [2004-03-27 00:00:00 %s] [2004-04-07 00:00:00 11 days ago]
1080410400 [2004-03-28 02:00:00 %s] [2004-04-07 00:00:00 -10 day +2 hours]
1081180800 [2004-04-06 00:00:00 %s] [2004-04-07 00:00:00 -1 day]
1081267200 [2004-04-07 00:00:00 %s] [2004-04-07 00:00:00]
1081270800 [2004-04-07 01:00:00 %s] [2004-04-07 00:00:00 +1 hour]
1081274400 [2004-04-07 02:00:00 %s] [2004-04-07 00:00:00 +2 hour]
1081353600 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 +1 day]
1081353600 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 1 day]
1083081600 [2004-04-28 00:00:00 %s] [2004-04-07 00:00:00 +21 days]
1076774399 [2004-02-14 23:59:59 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
1076774400 [2004-02-15 00:00:00 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
1076774401 [2004-02-15 00:00:01 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
1079452800 [2004-03-17 00:00:00 SGT] [2004-04-07 00:00:00 -21 days]
1080316800 [2004-03-27 00:00:00 SGT] [2004-04-07 00:00:00 11 days ago]
1080410400 [2004-03-28 02:00:00 SGT] [2004-04-07 00:00:00 -10 day +2 hours]
1081180800 [2004-04-06 00:00:00 SGT] [2004-04-07 00:00:00 -1 day]
1081267200 [2004-04-07 00:00:00 SGT] [2004-04-07 00:00:00]
1081270800 [2004-04-07 01:00:00 SGT] [2004-04-07 00:00:00 +1 hour]
1081274400 [2004-04-07 02:00:00 SGT] [2004-04-07 00:00:00 +2 hour]
1081353600 [2004-04-08 00:00:00 SGT] [2004-04-07 00:00:00 +1 day]
1081353600 [2004-04-08 00:00:00 SGT] [2004-04-07 00:00:00 1 day]
1083081600 [2004-04-28 00:00:00 SGT] [2004-04-07 00:00:00 +21 days]
America/Sao_Paulo
1076810399 [2004-02-14 23:59:59 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
1076814000 [2004-02-15 00:00:00 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
1076814001 [2004-02-15 00:00:01 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
1079492400 [2004-03-17 00:00:00 %s] [2004-04-07 00:00:00 -21 days]
1080356400 [2004-03-27 00:00:00 %s] [2004-04-07 00:00:00 11 days ago]
1080450000 [2004-03-28 02:00:00 %s] [2004-04-07 00:00:00 -10 day +2 hours]
1081220400 [2004-04-06 00:00:00 %s] [2004-04-07 00:00:00 -1 day]
1081306800 [2004-04-07 00:00:00 %s] [2004-04-07 00:00:00]
1081310400 [2004-04-07 01:00:00 %s] [2004-04-07 00:00:00 +1 hour]
1081314000 [2004-04-07 02:00:00 %s] [2004-04-07 00:00:00 +2 hour]
1081393200 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 +1 day]
1081393200 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 1 day]
1083121200 [2004-04-28 00:00:00 %s] [2004-04-07 00:00:00 +21 days]
1076810399 [2004-02-14 23:59:59 BRST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
1076814000 [2004-02-15 00:00:00 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
1076814001 [2004-02-15 00:00:01 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
1079492400 [2004-03-17 00:00:00 BRT] [2004-04-07 00:00:00 -21 days]
1080356400 [2004-03-27 00:00:00 BRT] [2004-04-07 00:00:00 11 days ago]
1080450000 [2004-03-28 02:00:00 BRT] [2004-04-07 00:00:00 -10 day +2 hours]
1081220400 [2004-04-06 00:00:00 BRT] [2004-04-07 00:00:00 -1 day]
1081306800 [2004-04-07 00:00:00 BRT] [2004-04-07 00:00:00]
1081310400 [2004-04-07 01:00:00 BRT] [2004-04-07 00:00:00 +1 hour]
1081314000 [2004-04-07 02:00:00 BRT] [2004-04-07 00:00:00 +2 hour]
1081393200 [2004-04-08 00:00:00 BRT] [2004-04-07 00:00:00 +1 day]
1081393200 [2004-04-08 00:00:00 BRT] [2004-04-07 00:00:00 1 day]
1083121200 [2004-04-28 00:00:00 BRT] [2004-04-07 00:00:00 +21 days]
+10 -10
View File
@@ -34,18 +34,18 @@ echo date("Y-m-d H:i:s T\n", $l);
1099364400
1099364400
1099447200
2004-11-01 00:00:00 -03
2004-11-02 01:00:00 -02
2004-11-02 01:00:00 -02
2004-11-02 01:00:00 -02
2004-11-03 00:00:00 -02
2004-11-01 00:00:00 BRT
2004-11-02 01:00:00 BRST
2004-11-02 01:00:00 BRST
2004-11-02 01:00:00 BRST
2004-11-03 00:00:00 BRST
1108778400
1108868400
1108868400
1108868400
1108954800
2005-02-19 00:00:00 -02
2005-02-20 00:00:00 -03
2005-02-20 00:00:00 -03
2005-02-20 00:00:00 -03
2005-02-21 00:00:00 -03
2005-02-19 00:00:00 BRST
2005-02-20 00:00:00 BRT
2005-02-20 00:00:00 BRT
2005-02-20 00:00:00 BRT
2005-02-21 00:00:00 BRT
+26 -26
View File
@@ -200,23 +200,23 @@ print "wanted=Thursday 00:00:00\n\n";
?>
--EXPECT--
TZ=America/Mendoza - wrong day.
tStamp=Sunday 1992-10-18 17:17:17 -02 1
result=Sunday 1992-10-25 00:00:00 -02 1
tStamp=Sunday 1992-10-18 17:17:17 ARST 1
result=Sunday 1992-10-25 00:00:00 ARST 1
wanted=Sunday 00:00:00
TZ=America/Catamarca - wrong day.
tStamp=Sunday 1990-10-21 17:17:17 -02 1
result=Sunday 1990-10-28 00:00:00 -02 1
tStamp=Sunday 1990-10-21 17:17:17 ARST 1
result=Sunday 1990-10-28 00:00:00 ARST 1
wanted=Sunday 00:00:00
TZ=America/Cordoba - wrong day.
tStamp=Sunday 1990-10-21 17:17:17 -02 1
result=Sunday 1990-10-28 00:00:00 -02 1
tStamp=Sunday 1990-10-21 17:17:17 ARST 1
result=Sunday 1990-10-28 00:00:00 ARST 1
wanted=Sunday 00:00:00
TZ=America/Rosario - wrong day.
tStamp=Tuesday 1991-10-15 17:17:17 -04 0
result=Tuesday 1991-10-22 00:00:00 -02 1
tStamp=Tuesday 1991-10-15 17:17:17 WART 0
result=Tuesday 1991-10-22 00:00:00 ARST 1
wanted=Tuesday 00:00:00
TZ=Europe/Vienna - wrong day - giving unexpected results, at
@@ -231,8 +231,8 @@ result=Monday 1992-09-28 00:00:00 +04 0
wanted=Monday 00:00:00
TZ=America/Noronha - wrong day.
tStamp=Friday 1999-10-01 17:17:17 -02 0
result=Friday 1999-10-08 00:00:00 -01 1
tStamp=Friday 1999-10-01 17:17:17 FNT 0
result=Friday 1999-10-08 00:00:00 FNST 1
wanted=Friday 00:00:00
TZ=America/Havana - wrong day.
@@ -256,13 +256,13 @@ result=Friday 2003-04-04 00:00:00 EEST 1
wanted=Friday 00:00:00
TZ=Pacific/Kwajalein - wrong day.
tStamp=Friday 1993-08-13 17:17:17 -12 0
result=Saturday 1993-08-21 00:00:00 +12 0
tStamp=Friday 1993-08-13 17:17:17 KWAT 0
result=Saturday 1993-08-21 00:00:00 MHT 0
wanted=Friday 00:00:00
TZ=Asia/Ulan_Bator - wrong day.
tStamp=Saturday 2001-09-22 17:17:17 +09 1
result=Saturday 2001-09-29 00:00:00 +09 1
tStamp=Saturday 2001-09-22 17:17:17 ULAST 1
result=Saturday 2001-09-29 00:00:00 ULAST 1
wanted=Saturday 00:00:00
TZ=America/Cancun - wrong day.
@@ -286,18 +286,18 @@ result=Thursday 2002-04-11 00:00:00 MDT 1
wanted=Thursday 00:00:00
TZ=Asia/Kuala_Lumpur - wrong day.
tStamp=Monday 1981-12-28 17:17:17 +0730 0
result=Monday 1982-01-04 00:00:00 +08 0
tStamp=Monday 1981-12-28 17:17:17 MALT 0
result=Monday 1982-01-04 00:00:00 MYT 0
wanted=Monday 00:00:00
TZ=Pacific/Chatham - wrong day.
tStamp=Monday 1974-10-28 17:17:17 +1245 0
result=Monday 1974-11-04 00:00:00 +1345 1
tStamp=Monday 1974-10-28 17:17:17 CHAST 0
result=Monday 1974-11-04 00:00:00 CHADT 1
wanted=Monday 00:00:00
TZ=America/Lima - wrong day.
tStamp=Thursday 1985-12-26 17:17:17 -05 0
result=Thursday 1986-01-02 00:00:00 -04 1
tStamp=Thursday 1985-12-26 17:17:17 PET 0
result=Thursday 1986-01-02 00:00:00 PEST 1
wanted=Thursday 00:00:00
TZ=Asia/Karachi - wrong day.
@@ -306,16 +306,16 @@ result=Friday 2002-04-12 00:00:00 PKST 1
wanted=Friday 00:00:00
TZ=America/Asuncion - wrong day.
tStamp=Wednesday 2002-02-27 17:17:17 -03 1
result=Wednesday 2002-03-06 00:00:00 -03 1
tStamp=Wednesday 2002-02-27 17:17:17 PYST 1
result=Wednesday 2002-03-06 00:00:00 PYST 1
wanted=Wednesday 00:00:00
TZ=Asia/Singapore - wrong day.
tStamp=Thursday 1981-12-31 17:17:17 +0730 0
result=Thursday 1982-01-07 00:00:00 +08 0
tStamp=Thursday 1981-12-31 17:17:17 SGT 0
result=Thursday 1982-01-07 00:00:00 SGT 0
wanted=Thursday 00:00:00
TZ=America/Montevideo - wrong day.
tStamp=Thursday 2004-09-16 17:17:17 -03 0
result=Thursday 2004-09-23 00:00:00 -02 1
tStamp=Thursday 2004-09-16 17:17:17 UYT 0
result=Thursday 2004-09-23 00:00:00 UYST 1
wanted=Thursday 00:00:00
+12 -12
View File
@@ -76,13 +76,13 @@ print "wanted=Friday 00:00:00\n\n";
?>
--EXPECT--
TZ=Pacific/Rarotonga - wrong day.
tStamp=Thursday 1970-01-01 17:17:17 -1030 0
result=Tuesday 1970-01-06 00:00:00 -1030 0
tStamp=Thursday 1970-01-01 17:17:17 CKT 0
result=Tuesday 1970-01-06 00:00:00 CKT 0
wanted=Tuesday 00:00:00
TZ=Atlantic/South_Georgia - wrong day.
tStamp=Thursday 1970-01-01 17:17:17 -02 0
result=Tuesday 1970-01-06 00:00:00 -02 0
tStamp=Thursday 1970-01-01 17:17:17 GST 0
result=Tuesday 1970-01-06 00:00:00 GST 0
wanted=Tuesday 00:00:00
TZ=America/Port-au-Prince - wrong day.
@@ -91,13 +91,13 @@ result=Monday 2005-04-04 00:00:00 EDT 1
wanted=Monday 00:00:00
TZ=Pacific/Enderbury - wrong day, off by 2 days.
tStamp=Thursday 1970-01-01 17:17:17 -12 0
result=Monday 1970-01-05 00:00:00 -12 0
tStamp=Thursday 1970-01-01 17:17:17 PHOT 0
result=Monday 1970-01-05 00:00:00 PHOT 0
wanted=Monday 00:00:00
TZ=Pacific/Kiritimati - wrong day, off by 2 days.
tStamp=Thursday 1970-01-01 17:17:17 -1040 0
result=Monday 1970-01-05 00:00:00 -1040 0
tStamp=Thursday 1970-01-01 17:17:17 LINT 0
result=Monday 1970-01-05 00:00:00 LINT 0
wanted=Monday 00:00:00
TZ=America/Managua - wrong day.
@@ -106,13 +106,13 @@ result=Tuesday 2005-04-12 00:00:00 CDT 1
wanted=Tuesday 00:00:00
TZ=Pacific/Pitcairn - wrong day.
tStamp=Thursday 1970-01-01 17:17:17 -0830 0
result=Wednesday 1970-01-07 00:00:00 -0830 0
tStamp=Thursday 1970-01-01 17:17:17 PNT 0
result=Wednesday 1970-01-07 00:00:00 PNT 0
wanted=Wednesday 00:00:00
TZ=Pacific/Fakaofo - wrong day.
tStamp=Thursday 1970-01-01 17:17:17 -11 0
result=Saturday 1970-01-03 00:00:00 -11 0
tStamp=Thursday 1970-01-01 17:17:17 TKT 0
result=Saturday 1970-01-03 00:00:00 TKT 0
wanted=Saturday 00:00:00
TZ=Pacific/Johnston - wrong day.
+2 -2
View File
@@ -23,8 +23,8 @@ print "wanted=Sunday 00:00:00\n\n";
--EXPECT--
TZ=America/Jujuy - Is it OK for this to be 2 AM, rather than 1
AM as per most DST transitions?
tStamp=Monday 1990-10-15 17:17:17 -04 0
result=Monday 1990-10-22 00:00:00 -04 0
tStamp=Monday 1990-10-15 17:17:17 WART 0
result=Monday 1990-10-22 00:00:00 WART 0
wanted=Monday 00:00:00
TZ=Asia/Tbilisi - Is it OK for this to be 2 AM?
+47 -47
View File
@@ -116,11 +116,11 @@ print "wanted=Monday 00:00:00\n\n";
print "TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes\n";
date_default_timezone_set('Africa/Monrovia');
$tStamp = mktime (17, 17, 17, 1, 730, 1970);
$tStamp = mktime (17, 17, 17, 1, 845, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Friday", $tStamp);
$strtotime_tstamp = strtotime("next Monday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Friday 00:44:30\n\n";
print "wanted=Monday 00:44:30\n\n";
print "TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes\n";
date_default_timezone_set('Asia/Katmandu');
@@ -208,7 +208,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Monday 00:30:00\n\n";
?>
--EXPECTF--
--EXPECT--
TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 CAT 0
@@ -216,14 +216,14 @@ result=Wednesday 1970-01-07 00:00:00 CAT 0
wanted=Wednesday 00:00:00
TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes
tStamp=Thursday 1987-09-24 17:17:17 +0530 0
result=Thursday 1987-10-01 00:30:00 +06 0
tStamp=Thursday 1987-09-24 17:17:17 IST 0
result=Thursday 1987-10-01 00:30:00 BTT 0
wanted=Thursday 00:30:00
TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 +0630 0
result=Thursday 1970-01-08 00:00:00 +0630 0
tStamp=Thursday 1970-01-01 17:17:17 CCT 0
result=Thursday 1970-01-08 00:00:00 CCT 0
wanted=Thursday 00:00:00
TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
@@ -233,110 +233,110 @@ result=Saturday 1970-01-03 00:00:00 CAT 0
wanted=Saturday 00:00:00
TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes
tStamp=Thursday 1980-04-24 17:17:17 +06 0
result=Thursday 1980-05-01 00:00:00 +06 0
tStamp=Thursday 1980-04-24 17:17:17 XJT 0
result=Thursday 1980-05-01 00:00:00 XJT 0
wanted=Thursday 03:00:00
TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does
not appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 +07 0
result=Sunday 1970-01-04 00:00:00 +07 0
tStamp=Thursday 1970-01-01 17:17:17 CXT 0
result=Sunday 1970-01-04 00:00:00 CXT 0
wanted=Sunday 00:00:00
TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes
tStamp=Sunday 1970-10-18 17:17:17 EST 0
result=Sunday 1970-10-25 00:30:00 -0430 1
result=Sunday 1970-10-25 00:30:00 EHDT 1
wanted=Sunday 00:30:00
TZ=Pacific/Truk - Is it OK for this to be 10 AM? Note: does not
appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 +10 0
result=Tuesday 1970-01-06 00:00:00 +10 0
tStamp=Thursday 1970-01-01 17:17:17 CHUT 0
result=Tuesday 1970-01-06 00:00:00 CHUT 0
wanted=Tuesday 00:00:00
TZ=Pacific/Ponape - Is it OK for this to be 11 AM? Note: does
not appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 +11 0
result=Monday 1970-01-05 00:00:00 +11 0
tStamp=Thursday 1970-01-01 17:17:17 PONT 0
result=Monday 1970-01-05 00:00:00 PONT 0
wanted=Monday 00:00:00
TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes
tStamp=Sunday 1981-03-22 17:17:17 -02 0
result=Sunday 1981-03-29 02:00:00 +00 1
tStamp=Sunday 1981-03-22 17:17:17 CGT 0
result=Sunday 1981-03-29 02:00:00 EGST 1
wanted=Sunday 02:00:00
TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes
tStamp=Thursday 1975-07-24 17:17:17 -0345 0
result=Thursday 1975-07-31 00:45:00 -03 0
tStamp=Thursday 1975-07-24 17:17:17 GYT 0
result=Thursday 1975-07-31 00:45:00 GYT 0
wanted=Thursday 00:45:00
TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes
tStamp=Tuesday 1977-10-25 17:17:17 +0330 0
result=Tuesday 1977-11-01 00:30:00 +04 0
tStamp=Tuesday 1977-10-25 17:17:17 IRST 0
result=Tuesday 1977-11-01 00:30:00 IRST 0
wanted=Tuesday 00:30:00
TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does
not appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 +12 0
result=Monday 1970-01-05 00:00:00 +12 0
tStamp=Thursday 1970-01-01 17:17:17 GILT 0
result=Monday 1970-01-05 00:00:00 GILT 0
wanted=Monday 00:00:00
TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes
tStamp=Friday 1971-12-31 17:17:17 MMT 0
result=Friday 1972-01-07 00:44:30 GMT 0
wanted=Friday 00:44:30
tStamp=Monday 1972-04-24 17:17:17 LRT 0
result=Monday 1972-05-01 00:44:30 GMT 0
wanted=Monday 00:44:30
TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes
tStamp=Wednesday 1985-12-25 17:17:17 +0530 0
result=Wednesday 1986-01-01 00:15:00 +0545 0
tStamp=Wednesday 1985-12-25 17:17:17 IST 0
result=Wednesday 1986-01-01 00:15:00 NPT 0
wanted=Wednesday 00:15:00
TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes
tStamp=Tuesday 1979-04-24 17:17:17 +1130 0
result=Tuesday 1979-05-01 00:30:00 +12 0
tStamp=Tuesday 1979-04-24 17:17:17 NRT 0
result=Tuesday 1979-05-01 00:30:00 NRT 0
wanted=Tuesday 00:30:00
TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes
tStamp=Sunday 1978-09-24 17:17:17 -1130 0
result=Sunday 1978-10-01 00:30:00 -11 0
tStamp=Sunday 1978-09-24 17:17:17 NUT 0
result=Sunday 1978-10-01 00:30:00 NUT 0
wanted=Sunday 00:30:00
TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST
or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 +10 0
result=Thursday 1970-01-08 00:00:00 +10 0
tStamp=Thursday 1970-01-01 17:17:17 PGT 0
result=Thursday 1970-01-08 00:00:00 PGT 0
wanted=Thursday 00:00:00
TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes
tStamp=Thursday 1980-04-24 17:17:17 AST 0
result=Thursday 1980-05-01 01:00:00 -03 0
result=Thursday 1980-05-01 01:00:00 PMST 0
wanted=Thursday 01:00:00
TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or
timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 +09 0
result=Saturday 1970-01-03 00:00:00 +09 0
tStamp=Thursday 1970-01-01 17:17:17 PWT 0
result=Saturday 1970-01-03 00:00:00 PWT 0
wanted=Saturday 00:00:00
TZ=Pacific/Funafuti - Is it OK for this to be midday? Note: does
not appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 +12 0
result=Wednesday 1970-01-07 00:00:00 +12 0
tStamp=Thursday 1970-01-01 17:17:17 TVT 0
result=Wednesday 1970-01-07 00:00:00 TVT 0
wanted=Wednesday 00:00:00
TZ=Pacific/Wake - Is it OK for this to be midday? Note: does not
appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 +12 0
result=Tuesday 1970-01-06 00:00:00 +12 0
tStamp=Thursday 1970-01-01 17:17:17 WAKT 0
result=Tuesday 1970-01-06 00:00:00 WAKT 0
wanted=Tuesday 00:00:00
TZ=Pacific/Wallis - Is it OK for this to be midday? Note: does
not appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 +12 0
result=Tuesday 1970-01-06 00:00:00 +12 0
tStamp=Thursday 1970-01-01 17:17:17 WFT 0
result=Tuesday 1970-01-06 00:00:00 WFT 0
wanted=Tuesday 00:00:00
TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes
tStamp=Monday 1984-09-24 17:17:17 -0330 0
result=Monday 1984-10-01 00:30:00 -03 0
tStamp=Monday 1984-09-24 17:17:17 SRT 0
result=Monday 1984-10-01 00:30:00 SRT 0
wanted=Monday 00:30:00
-34
View File
@@ -1,34 +0,0 @@
--TEST--
Bug #72096: Swatch time value incorrect for dates before 1970
--INI--
date.timezone=UTC
--FILE--
<?php
for ($unix = 1461283200; $unix <= 1461369600; $unix += 8000) {
echo "Time:", gmdate('Y-m-d H:i:s = B', $unix), PHP_EOL;
echo "Time:", gmdate('Y-m-d H:i:s = B', $unix - 82 * 365 * 24 * 3600), PHP_EOL;
}
?>
--EXPECT--
Time:2016-04-22 00:00:00 = 041
Time:1934-05-13 00:00:00 = 041
Time:2016-04-22 02:13:20 = 134
Time:1934-05-13 02:13:20 = 134
Time:2016-04-22 04:26:40 = 226
Time:1934-05-13 04:26:40 = 226
Time:2016-04-22 06:40:00 = 319
Time:1934-05-13 06:40:00 = 319
Time:2016-04-22 08:53:20 = 412
Time:1934-05-13 08:53:20 = 412
Time:2016-04-22 11:06:40 = 504
Time:1934-05-13 11:06:40 = 504
Time:2016-04-22 13:20:00 = 597
Time:1934-05-13 13:20:00 = 597
Time:2016-04-22 15:33:20 = 689
Time:1934-05-13 15:33:20 = 689
Time:2016-04-22 17:46:40 = 782
Time:1934-05-13 17:46:40 = 782
Time:2016-04-22 20:00:00 = 875
Time:1934-05-13 20:00:00 = 875
Time:2016-04-22 22:13:20 = 967
Time:1934-05-13 22:13:20 = 967
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #73837: Milliseconds in DateTime()
--FILE--
<?php
$collect = [];
for ( $i = 0; $i < 1000; $i++ )
{
$a = new DateTime();
$key = "s" . $a->format( "u" );
$collect[$key] = true;
}
var_dump($n = count( $collect ));
echo ( $n > 800 ) ? "microseconds differ\n" : "microseconds do not differ enough ($n)\n";
?>
--EXPECTF--
int(%d)
microseconds differ
-11
View File
@@ -1,11 +0,0 @@
--TEST--
Bug #74080 Provide an RFC7231 date time format
--FILE--
<?php
$date = mktime(17, 52, 13, 4, 30, 2016);
var_dump(date(\DateTime::RFC7231, $date));
?>
--EXPECTF--
string(29) "Sat, 30 Apr 2016 17:52:13 GMT"
+2 -2
View File
@@ -22,8 +22,8 @@ $ts->modify("+ 1 hour 1 second");
echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
?>
--EXPECT--
Thu, 19 Aug 1993 23:59:59 -12
Sat, 21 Aug 1993 00:00:00 +12
Thu, 19 Aug 1993 23:59:59 KWAT
Sat, 21 Aug 1993 00:00:00 MHT
Sun, 27 Mar 2005 01:59:59 CET
Sun, 27 Mar 2005 03:00:00 CEST
Sun, 30 Oct 2005 01:59:59 CEST
+2 -2
View File
@@ -10,12 +10,12 @@ date.timezone=UTC
$location = timezone_location_get(new DateTimeZone("Europe/Oslo"));
var_dump($location);
?>
--EXPECTF--
--EXPECT--
array(4) {
["country_code"]=>
string(2) "NO"
["latitude"]=>
float(59.9166%d)
float(59.91666)
["longitude"]=>
float(10.75)
["comments"]=>
+4 -4
View File
@@ -2038,16 +2038,16 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
RETURN_FALSE;
}
if (options) {
htmlCtxtUseOptions(ctxt, (int)options);
}
ctxt->vctxt.error = php_libxml_ctx_error;
ctxt->vctxt.warning = php_libxml_ctx_warning;
if (ctxt->sax != NULL) {
ctxt->sax->error = php_libxml_ctx_error;
ctxt->sax->warning = php_libxml_ctx_warning;
}
if (options) {
htmlCtxtUseOptions(ctxt, (int)options);
}
htmlParseDocument(ctxt);
newdoc = ctxt->myDoc;
htmlFreeParserCtxt(ctxt);
+1 -1
View File
@@ -49,7 +49,7 @@ ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_has_child_nodes, 0, 0, 0)
ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 1)
ZEND_ARG_INFO(0, deep)
ZEND_END_ARG_INFO();
-14
View File
@@ -1,14 +0,0 @@
--TEST--
Bug #74004 (DOMDocument->loadHTML and ->loadHTMLFile do not heed LIBXML_NOWARNING and LIBXML_NOERROR options)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$doc=new DOMDocument();
$doc->loadHTML("<tag-throw></tag-throw>",LIBXML_NOERROR);
?>
===DONE===
--EXPECT--
===DONE===
-21
View File
@@ -1,21 +0,0 @@
--TEST--
Bug #74416 Wrong reflection on DOMNode::cloneNode
--SKIPIF--
<?php
require_once('skipif.inc');
if (!extension_loaded('reflection')) die('skip reflection extension not available');
?>
--FILE--
<?php
$rm = new ReflectionMethod(DOMNode::class, "cloneNode");
printf("%d\n%d\n", $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters());
foreach ($rm->getParameters() as $param) {
printf("Parameter #%d %s OPTIONAL\n", $param->getPosition(), $param->isOptional() ? "IS" : "IS NOT");
}
?>
===DONE===
--EXPECT--
1
0
Parameter #0 IS OPTIONAL
===DONE===
+81 -93
View File
@@ -1,6 +1,6 @@
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/apprentice.c 2017-04-10 11:43:17.272811417 +0800
--- libmagic.orig/apprentice.c 2016-01-25 11:31:21.473017702 +0800
+++ libmagic/apprentice.c 2016-01-25 11:41:58.210723599 +0800
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -49,18 +49,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
#ifndef SSIZE_MAX
#define MAXMAGIC_SIZE ((ssize_t)0x7fffffff)
@@ -75,6 +80,10 @@
#endif
#endif
+#ifndef offsetof
+#define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
+#endif
+
#ifndef MAP_FAILED
#define MAP_FAILED (void *) -1
#endif
@@ -168,38 +177,7 @@
@@ -168,38 +173,7 @@
{ NULL, 0, NULL }
};
@@ -100,7 +89,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
struct type_tbl_s {
const char name[16];
@@ -281,6 +259,10 @@
@@ -281,6 +255,10 @@
# undef XX
# undef XX_NULL
@@ -111,7 +100,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
private int
get_type(const struct type_tbl_s *tbl, const char *l, const char **t)
{
@@ -405,7 +387,7 @@
@@ -405,7 +383,7 @@
struct mlist *ml;
mlp->map = idx == 0 ? map : NULL;
@@ -120,7 +109,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return -1;
ml->map = NULL;
@@ -426,10 +408,8 @@
@@ -426,10 +404,8 @@
apprentice_1(struct magic_set *ms, const char *fn, int action)
{
struct magic_map *map;
@@ -131,7 +120,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (magicsize != FILE_MAGICSIZE) {
file_error(ms, 0, "magic element size %lu != %lu",
@@ -445,12 +425,13 @@
@@ -445,12 +421,13 @@
return apprentice_compile(ms, map, fn);
}
@@ -149,7 +138,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (map == NULL)
return -1;
}
@@ -458,7 +439,8 @@
@@ -458,7 +435,8 @@
for (i = 0; i < MAGIC_SETS; i++) {
if (add_mlist(ms->mlist[i], map, i) == -1) {
file_oomem(ms, sizeof(*ml));
@@ -159,7 +148,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
}
@@ -472,15 +454,6 @@
@@ -472,15 +450,6 @@
}
}
return 0;
@@ -175,7 +164,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
protected void
@@ -491,10 +464,16 @@
@@ -491,10 +460,16 @@
return;
for (i = 0; i < MAGIC_SETS; i++)
mlist_free(ms->mlist[i]);
@@ -196,7 +185,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
protected struct magic_set *
@@ -503,7 +482,7 @@
@@ -503,7 +478,7 @@
struct magic_set *ms;
size_t i, len;
@@ -205,7 +194,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
sizeof(struct magic_set)))) == NULL)
return NULL;
@@ -515,7 +494,7 @@
@@ -515,7 +490,7 @@
ms->o.buf = ms->o.pbuf = NULL;
len = (ms->c.len = 10) * sizeof(*ms->c.li);
@@ -214,7 +203,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
goto free;
ms->event_flags = 0;
@@ -531,7 +510,7 @@
@@ -531,7 +506,7 @@
ms->elf_notes_max = FILE_ELF_NOTES_MAX;
return ms;
free:
@@ -223,7 +212,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return NULL;
}
@@ -540,30 +519,26 @@
@@ -540,30 +515,26 @@
{
if (map == NULL)
return;
@@ -267,7 +256,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return NULL;
}
mlist->next = mlist->prev = mlist;
@@ -582,61 +557,12 @@
@@ -582,61 +553,12 @@
for (ml = mlist->next; (next = ml->next) != NULL; ml = next) {
if (ml->map)
apprentice_unmap(ml->map);
@@ -330,7 +319,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
/* const char *fn: list of magic files and directories */
protected int
file_apprentice(struct magic_set *ms, const char *fn, int action)
@@ -648,12 +574,28 @@
@@ -648,12 +570,28 @@
if (ms->mlist[0] != NULL)
file_reset(ms);
@@ -360,7 +349,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_oomem(ms, strlen(fn));
return -1;
}
@@ -666,7 +608,7 @@
@@ -666,7 +604,7 @@
mlist_free(ms->mlist[i]);
ms->mlist[i] = NULL;
}
@@ -369,7 +358,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return -1;
}
}
@@ -683,7 +625,7 @@
@@ -683,7 +621,7 @@
fn = p;
}
@@ -378,7 +367,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (errs == -1) {
for (i = 0; i < MAGIC_SETS; i++) {
@@ -1062,7 +1004,7 @@
@@ -1062,7 +1000,7 @@
mset[i].max += ALLOC_INCR;
if ((mp = CAST(struct magic_entry *,
@@ -387,7 +376,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
NULL) {
file_oomem(ms, sizeof(*mp) * mset[i].max);
return -1;
@@ -1083,13 +1025,19 @@
@@ -1083,13 +1021,19 @@
load_1(struct magic_set *ms, int action, const char *fn, int *errs,
struct magic_entry_set *mset)
{
@@ -411,7 +400,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (errno != ENOENT)
file_error(ms, errno, "cannot read magic file `%s'",
fn);
@@ -1099,8 +1047,7 @@
@@ -1099,8 +1043,7 @@
memset(&me, 0, sizeof(me));
/* read and parse this file */
@@ -421,7 +410,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (len == 0) /* null line, garbage, etc */
continue;
if (line[len - 1] == '\n') {
@@ -1158,8 +1105,8 @@
@@ -1158,8 +1101,8 @@
}
if (me.mp)
(void)addentry(ms, &me, mset);
@@ -432,7 +421,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
/*
@@ -1238,7 +1185,7 @@
@@ -1238,7 +1181,7 @@
mentrycount += me[i].cont_count;
slen = sizeof(**ma) * mentrycount;
@@ -441,7 +430,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_oomem(ms, slen);
return -1;
}
@@ -1260,8 +1207,8 @@
@@ -1260,8 +1203,8 @@
if (me == NULL)
return;
for (i = 0; i < nme; i++)
@@ -452,7 +441,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
private struct magic_map *
@@ -1270,18 +1217,19 @@
@@ -1270,18 +1213,19 @@
int errs = 0;
uint32_t i, j;
size_t files = 0, maxfiles = 0;
@@ -477,7 +466,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
{
file_oomem(ms, sizeof(*map));
return NULL;
@@ -1292,22 +1240,26 @@
@@ -1292,22 +1236,26 @@
(void)fprintf(stderr, "%s\n", usg_hdr);
/* load directory or file */
@@ -512,7 +501,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
continue;
}
if (files >= maxfiles) {
@@ -1315,23 +1267,22 @@
@@ -1315,23 +1263,22 @@
maxfiles = (maxfiles + 1) * 2;
mlen = maxfiles * sizeof(*filearr);
if ((filearr = CAST(char **,
@@ -542,7 +531,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
} else
load_1(ms, action, fn, &errs, mset);
if (errs)
@@ -1796,7 +1747,7 @@
@@ -1796,7 +1743,7 @@
if (me->cont_count == me->max_count) {
struct magic *nm;
size_t cnt = me->max_count + ALLOC_CHUNK;
@@ -551,7 +540,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
sizeof(*nm) * cnt))) == NULL) {
file_oomem(ms, sizeof(*nm) * cnt);
return -1;
@@ -1811,7 +1762,7 @@
@@ -1811,7 +1758,7 @@
static const size_t len = sizeof(*m) * ALLOC_CHUNK;
if (me->mp != NULL)
return 1;
@@ -560,7 +549,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_oomem(ms, len);
return -1;
}
@@ -1984,7 +1935,7 @@
@@ -1984,7 +1931,7 @@
m->type = get_standard_integer_type(l, &l);
else if (*l == 's' && !isalpha((unsigned char)l[1])) {
m->type = FILE_STRING;
@@ -569,7 +558,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
}
}
@@ -2005,7 +1956,7 @@
@@ -2005,7 +1952,7 @@
m->mask_op = 0;
if (*l == '~') {
@@ -578,7 +567,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->mask_op |= FILE_OPINVERSE;
else if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "'~' invalid for string types");
@@ -2014,7 +1965,7 @@
@@ -2014,7 +1961,7 @@
m->str_range = 0;
m->str_flags = m->type == FILE_PSTRING ? PSTRING_1_LE : 0;
if ((op = get_op(*l)) != -1) {
@@ -587,7 +576,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
int r;
if (op != FILE_OPDIVIDE) {
@@ -2119,11 +2070,6 @@
@@ -2119,11 +2066,6 @@
if (check_format(ms, m) == -1)
return -1;
}
@@ -599,7 +588,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->mimetype[0] = '\0'; /* initialise MIME type to none */
return 0;
}
@@ -2195,7 +2141,7 @@
@@ -2195,7 +2137,7 @@
private int
parse_extra(struct magic_set *ms, struct magic_entry *me, const char *line,
@@ -608,7 +597,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
{
size_t i;
const char *l = line;
@@ -2264,7 +2210,7 @@
@@ -2264,7 +2206,7 @@
struct magic *m = &me->mp[0];
return parse_extra(ms, me, line,
@@ -617,7 +606,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
sizeof(m->mimetype), "MIME", "+-/.", 1);
}
@@ -2517,14 +2463,18 @@
@@ -2517,14 +2459,18 @@
return -1;
}
if (m->type == FILE_REGEX) {
@@ -643,7 +632,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
return 0;
case FILE_FLOAT:
@@ -2854,68 +2804,144 @@
@@ -2854,68 +2800,144 @@
private struct magic_map *
apprentice_map(struct magic_set *ms, const char *fn)
{
@@ -756,10 +745,9 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
+ file_error(ms, 0, "File %d.%d supports only version %d magic "
+ "files. `%s' is version %d", FILE_VERSION_MAJOR, patchlevel,
+ VERSIONNO, dbname, version);
goto error;
+ goto error;
+ }
- free(dbname);
+
+ /* php_magic_database is a const, performing writes will segfault. This is for big-endian
+ machines only, PPC and Sparc specifically. Consider static variable or MINIT in
+ future. */
@@ -792,12 +780,13 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
+ if (NULL != fn && entries != nentries + 1) {
+ file_error(ms, 0, "Inconsistent entries in `%s' %u != %u",
+ dbname, entries, nentries + 1);
+ goto error;
goto error;
+ }
+ if (needsbyteswap)
+ for (i = 0; i < MAGIC_SETS; i++)
+ byteswap(map->magic[i], map->nmagic[i]);
+
- free(dbname);
+ if (dbname) {
+ efree(dbname);
+ }
@@ -817,7 +806,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return NULL;
}
@@ -2942,7 +2968,7 @@
@@ -2942,7 +2964,7 @@
version = ptr[1];
if (version != VERSIONNO) {
file_error(ms, 0, "File %s supports only version %d magic "
@@ -826,7 +815,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
VERSIONNO, dbname, version);
return -1;
}
@@ -2983,7 +3009,6 @@
@@ -2983,7 +3005,6 @@
{
static const size_t nm = sizeof(*map->nmagic) * MAGIC_SETS;
static const size_t m = sizeof(**map->magic);
@@ -834,7 +823,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
size_t len;
char *dbname;
int rv = -1;
@@ -2992,14 +3017,18 @@
@@ -2992,14 +3013,18 @@
struct magic m;
uint32_t h[2 + MAGIC_SETS];
} hdr;
@@ -857,7 +846,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_error(ms, errno, "cannot open `%s'", dbname);
goto out;
}
@@ -3008,24 +3037,25 @@
@@ -3008,24 +3033,25 @@
hdr.h[1] = VERSIONNO;
memcpy(hdr.h + 2, map->nmagic, nm);
@@ -888,7 +877,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return rv;
}
@@ -3059,16 +3089,18 @@
@@ -3059,16 +3085,18 @@
q++;
/* Compatibility with old code that looked in .mime */
if (ms->flags & MAGIC_MIME) {
@@ -913,7 +902,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
/* Compatibility with old code that looked in .mime */
if (strstr(p, ".mime") != NULL)
@@ -3158,7 +3190,7 @@
@@ -3158,7 +3186,7 @@
m->offset = swap4((uint32_t)m->offset);
m->in_offset = swap4((uint32_t)m->in_offset);
m->lineno = swap4((uint32_t)m->lineno);
@@ -923,8 +912,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->str_flags = swap4(m->str_flags);
}
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
--- libmagic.orig/ascmagic.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/ascmagic.c 2017-04-10 11:41:14.411268021 +0800
--- libmagic.orig/ascmagic.c 2016-01-25 11:31:21.495017704 +0800
+++ libmagic/ascmagic.c 2016-01-25 11:31:32.676017695 +0800
@@ -139,7 +139,7 @@
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
@@ -945,8 +934,8 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
return rv;
}
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/cdf.c 2017-04-10 11:41:14.411268021 +0800
--- libmagic.orig/cdf.c 2016-01-25 11:31:21.472017703 +0800
+++ libmagic/cdf.c 2016-01-25 11:31:32.676017695 +0800
@@ -35,7 +35,7 @@
#include "file.h"
@@ -1112,8 +1101,8 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
#ifdef CDF_DEBUG
else
diff -u libmagic.orig/cdf.h libmagic/cdf.h
--- libmagic.orig/cdf.h 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/cdf.h 2017-04-10 11:41:14.412268021 +0800
--- libmagic.orig/cdf.h 2016-01-25 11:31:21.493017704 +0800
+++ libmagic/cdf.h 2016-01-25 11:31:32.676017695 +0800
@@ -35,10 +35,12 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -1142,8 +1131,8 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
void cdf_swap_header(cdf_header_t *);
void cdf_unpack_header(cdf_header_t *, char *);
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/cdf_time.c 2017-04-10 11:41:14.412268021 +0800
--- libmagic.orig/cdf_time.c 2016-01-25 11:31:21.494017704 +0800
+++ libmagic/cdf_time.c 2016-01-25 11:31:32.676017695 +0800
@@ -96,7 +96,7 @@
}
@@ -1193,8 +1182,8 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
static const cdf_timestamp_t tst = 0x01A5E403C2D59C00ULL;
static const char *ref = "Sat Apr 23 01:30:00 1977";
diff -u libmagic.orig/compress.c libmagic/compress.c
--- libmagic.orig/compress.c 2017-04-10 11:41:09.732268025 +0800
+++ libmagic/compress.c 2017-04-10 11:41:14.412268021 +0800
--- libmagic.orig/compress.c 2016-01-25 11:31:21.483017704 +0800
+++ libmagic/compress.c 2016-01-25 11:31:32.676017695 +0800
@@ -32,10 +32,11 @@
* uncompress(method, old, n, newch) - uncompress old into new,
* using method, return sizeof new
@@ -1393,8 +1382,8 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
-#endif
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
--- libmagic.orig/elfclass.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/elfclass.h 2017-04-10 11:41:14.412268021 +0800
--- libmagic.orig/elfclass.h 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/elfclass.h 2016-01-25 11:31:32.677017695 +0800
@@ -41,7 +41,7 @@
return toomany(ms, "program headers", phnum);
flags |= FLAGS_IS_CORE;
@@ -1423,8 +1412,8 @@ diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
fsize, elf_getu16(swap, elfhdr.e_machine),
(int)elf_getu16(swap, elfhdr.e_shstrndx),
diff -u libmagic.orig/file.h libmagic/file.h
--- libmagic.orig/file.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/file.h 2017-04-10 11:41:14.412268021 +0800
--- libmagic.orig/file.h 2016-01-25 11:31:21.472017703 +0800
+++ libmagic/file.h 2016-01-25 11:31:32.677017695 +0800
@@ -33,11 +33,9 @@
#ifndef __file_h__
#define __file_h__
@@ -1644,8 +1633,8 @@ diff -u libmagic.orig/file.h libmagic/file.h
#define __RCSID(a)
#endif
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
--- libmagic.orig/fsmagic.c 2017-04-10 11:41:09.730268025 +0800
+++ libmagic/fsmagic.c 2017-04-10 11:41:14.413268021 +0800
--- libmagic.orig/fsmagic.c 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/fsmagic.c 2016-01-25 11:31:32.677017695 +0800
@@ -63,27 +63,21 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -1996,8 +1985,8 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
return ret;
}
diff -u libmagic.orig/funcs.c libmagic/funcs.c
--- libmagic.orig/funcs.c 2017-04-10 11:41:09.732268025 +0800
+++ libmagic/funcs.c 2017-04-10 11:41:14.413268021 +0800
--- libmagic.orig/funcs.c 2016-01-25 11:31:21.483017704 +0800
+++ libmagic/funcs.c 2016-01-25 11:41:34.164723619 +0800
@@ -31,7 +31,6 @@
#endif /* lint */
@@ -2228,7 +2217,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
{
@@ -403,8 +405,8 @@
if (level >= ms->c.len) {
len = (ms->c.len = 20 + level) * sizeof(*ms->c.li);
len = (ms->c.len += 20) * sizeof(*ms->c.li);
ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
- malloc(len) :
- realloc(ms->c.li, len));
@@ -2381,10 +2370,9 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
return buf;
}
+
Common subdirectories: libmagic.orig/.libs and libmagic/.libs
diff -u libmagic.orig/magic.c libmagic/magic.c
--- libmagic.orig/magic.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/magic.c 2017-04-10 11:41:14.413268021 +0800
--- libmagic.orig/magic.c 2016-01-25 11:31:21.495017704 +0800
+++ libmagic/magic.c 2016-01-25 11:31:32.677017695 +0800
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -2773,8 +2761,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
public const char *
magic_error(struct magic_set *ms)
diff -u libmagic.orig/magic.h libmagic/magic.h
--- libmagic.orig/magic.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/magic.h 2017-04-10 11:41:14.413268021 +0800
--- libmagic.orig/magic.h 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/magic.h 2016-01-25 11:31:32.677017695 +0800
@@ -88,6 +88,7 @@
const char *magic_getpath(const char *, int);
@@ -2792,8 +2780,8 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
int magic_errno(magic_t);
diff -u libmagic.orig/patchlevel.h libmagic/patchlevel.h
--- libmagic.orig/patchlevel.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/patchlevel.h 2017-04-10 11:41:14.414268021 +0800
--- libmagic.orig/patchlevel.h 2016-01-25 11:31:21.473017702 +0800
+++ libmagic/patchlevel.h 2016-01-25 11:31:32.678017695 +0800
@@ -1,34 +1,43 @@
#define FILE_VERSION_MAJOR 5
-#define patchlevel 6
@@ -2858,8 +2846,8 @@ diff -u libmagic.orig/patchlevel.h libmagic/patchlevel.h
* Revision 1.69 2008/07/02 15:27:05 christos
* welcome to 4.25
diff -u libmagic.orig/print.c libmagic/print.c
--- libmagic.orig/print.c 2017-04-10 11:41:09.738268025 +0800
+++ libmagic/print.c 2017-04-10 11:41:14.414268021 +0800
--- libmagic.orig/print.c 2016-01-25 11:31:21.495017704 +0800
+++ libmagic/print.c 2016-01-25 11:31:32.678017695 +0800
@@ -28,13 +28,17 @@
/*
* print.c - debugging printout routines
@@ -3131,8 +3119,8 @@ diff -u libmagic.orig/print.c libmagic/print.c
if (tm == NULL)
goto out;
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/readcdf.c 2017-04-10 11:41:14.414268021 +0800
--- libmagic.orig/readcdf.c 2016-01-25 11:31:21.493017704 +0800
+++ libmagic/readcdf.c 2016-01-25 11:31:32.678017695 +0800
@@ -26,15 +26,21 @@
#include "file.h"
@@ -3257,8 +3245,8 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
#ifdef CDF_DEBUG
cdf_dump_catalog(&h, &scn);
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c 2017-04-10 11:41:09.730268025 +0800
+++ libmagic/softmagic.c 2017-04-10 11:41:14.414268021 +0800
--- libmagic.orig/softmagic.c 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/softmagic.c 2016-01-25 11:44:35.541684679 +0800
@@ -36,11 +36,19 @@
#endif /* lint */
@@ -3681,8 +3669,8 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
case FILE_INDIRECT:
diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
--- libmagic.orig/strcasestr.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/strcasestr.c 2017-04-10 11:41:14.415268021 +0800
--- libmagic.orig/strcasestr.c 2016-01-25 11:31:21.494017704 +0800
+++ libmagic/strcasestr.c 2016-01-25 11:31:32.678017695 +0800
@@ -39,6 +39,8 @@
#include "file.h"
-4
View File
@@ -80,10 +80,6 @@ FILE_RCSID("@(#)$File: apprentice.c,v 1.230 2015/01/02 21:29:39 christos Exp $")
#endif
#endif
#ifndef offsetof
#define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
#endif
#ifndef MAP_FAILED
#define MAP_FAILED (void *) -1
#endif
+1 -1
View File
@@ -325,7 +325,7 @@ dnl Various checks for GD features
PHP_GD_FREETYPE2
dnl Header path
for i in include/gd include/gd2 include gd ""; do
for i in include/gd include gd ""; do
test -f "$PHP_GD/$i/gd.h" && GD_INCLUDE="$PHP_GD/$i"
done
+1 -1
View File
@@ -39,7 +39,7 @@
#include "php.h"
/* This just seems unessacary */
#ifdef PHP_WIN32
#if PHP_WIN32
#define ENABLE_GD_TTF
#else
#include <php_config.h>
+1 -1
View File
@@ -30,6 +30,7 @@ if test "$PHP_GETTEXT" != "no"; then
AC_MSG_ERROR(Unable to find required gettext library)
])
)
LDFLAGS=$O_LDFLAGS
AC_DEFINE(HAVE_LIBINTL,1,[ ])
PHP_NEW_EXTENSION(gettext, gettext.c, $ext_shared)
@@ -45,6 +46,5 @@ if test "$PHP_GETTEXT" != "no"; then
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dngettext, [AC_DEFINE(HAVE_DNGETTEXT, 1, [ ])])
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dcngettext, [AC_DEFINE(HAVE_DCNGETTEXT, 1, [ ])])
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, bind_textdomain_codeset, [AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [ ])])
LDFLAGS=$O_LDFLAGS
fi
+5 -8
View File
@@ -125,8 +125,6 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
}
if (millis) {
php_date_obj *datetime;
ZVAL_STRING(&zfuncname, "getTimestamp");
if (call_user_function(NULL, z, &zfuncname, &retval, 0, NULL)
!= SUCCESS || Z_TYPE(retval) != IS_LONG) {
@@ -139,8 +137,7 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
return FAILURE;
}
datetime = Z_PHPDATE_P(z);
*millis = U_MILLIS_PER_SECOND * ((double)Z_LVAL(retval) + datetime->time->f);
*millis = U_MILLIS_PER_SECOND * (double)Z_LVAL(retval);
zval_ptr_dtor(&zfuncname);
}
@@ -148,8 +145,8 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
php_date_obj *datetime;
datetime = Z_PHPDATE_P(z);
if (!datetime->time) {
spprintf(&message, 0, "%s: the %s object is not properly "
"initialized", func, ZSTR_VAL(Z_OBJCE_P(z)->name));
spprintf(&message, 0, "%s: the DateTime object is not properly "
"initialized", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
message, 1);
efree(message);
@@ -208,7 +205,7 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func)
rv = U_MILLIS_PER_SECOND * Z_DVAL_P(z);
break;
case IS_OBJECT:
if (instanceof_function(Z_OBJCE_P(z), php_date_get_interface_ce())) {
if (instanceof_function(Z_OBJCE_P(z), php_date_get_date_ce())) {
intl_datetime_decompose(z, &rv, NULL, err, func);
} else if (instanceof_function(Z_OBJCE_P(z), Calendar_ce_ptr)) {
Calendar_object *co = Z_INTL_CALENDAR_P(z);
@@ -231,7 +228,7 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func)
} else {
/* TODO: try with cast(), get() to obtain a number */
spprintf(&message, 0, "%s: invalid object type for date/time "
"(only IntlCalendar and DateTimeInterface permitted)", func);
"(only IntlCalendar and DateTime permitted)", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
message, 1);
efree(message);
+26 -34
View File
@@ -38,34 +38,26 @@ zend_class_entry *Locale_ce_ptr = NULL;
ZEND_BEGIN_ARG_INFO_EX( locale_0_args, 0, 0, 0 )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_arg_locale, 0, 0, 1 )
ZEND_ARG_INFO( 0, locale )
ZEND_BEGIN_ARG_INFO_EX( locale_1_arg, 0, 0, 1 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_accept_from_http_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, header )
ZEND_BEGIN_ARG_INFO_EX( locale_2_args, 0, 0, 2 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_compose_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, subtags )
ZEND_BEGIN_ARG_INFO_EX( locale_3_args, 0, 0, 3 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_ARG_INFO( 0, arg3 )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_2_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, locale )
ZEND_ARG_INFO( 0, in_locale )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_filter_matches_args, 0, 0, 2 )
ZEND_ARG_INFO( 0, langtag )
ZEND_ARG_INFO( 0, locale )
ZEND_ARG_INFO( 0, canonicalize )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_lookup_args, 0, 0, 2 )
ZEND_ARG_INFO( 0, langtag )
ZEND_ARG_INFO( 0, locale )
ZEND_ARG_INFO( 0, canonicalize )
ZEND_ARG_INFO( 0, default )
ZEND_BEGIN_ARG_INFO_EX( locale_4_args, 0, 0, 4 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_ARG_INFO( 0, arg3 )
ZEND_ARG_INFO( 0, arg4 )
ZEND_END_ARG_INFO()
/* }}} */
@@ -76,23 +68,23 @@ ZEND_END_ARG_INFO()
zend_function_entry Locale_class_functions[] = {
ZEND_FENTRY( getDefault, zif_locale_get_default , locale_0_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( setDefault, zif_locale_set_default , locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getPrimaryLanguage, ZEND_FN( locale_get_primary_language ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getScript, ZEND_FN( locale_get_script ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getRegion, ZEND_FN( locale_get_region ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getKeywords, ZEND_FN( locale_get_keywords ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( setDefault, zif_locale_set_default , locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getPrimaryLanguage, ZEND_FN( locale_get_primary_language ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getScript, ZEND_FN( locale_get_script ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getRegion, ZEND_FN( locale_get_region ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getKeywords, ZEND_FN( locale_get_keywords ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayScript, ZEND_FN( locale_get_display_script ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayRegion, ZEND_FN( locale_get_display_region ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayName, ZEND_FN( locale_get_display_name ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayLanguage, ZEND_FN( locale_get_display_language ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayVariant, ZEND_FN( locale_get_display_variant ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( composeLocale, ZEND_FN( locale_compose ), locale_compose_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( parseLocale, ZEND_FN( locale_parse ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getAllVariants, ZEND_FN( locale_get_all_variants ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( filterMatches, ZEND_FN( locale_filter_matches ), locale_filter_matches_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( lookup, ZEND_FN( locale_lookup ), locale_lookup_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( canonicalize, ZEND_FN( locale_canonicalize ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( acceptFromHttp, ZEND_FN( locale_accept_from_http ), locale_accept_from_http_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( composeLocale, ZEND_FN( locale_compose ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( parseLocale, ZEND_FN( locale_parse ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getAllVariants, ZEND_FN( locale_get_all_variants ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( filterMatches, ZEND_FN( locale_filter_matches ), locale_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( lookup, ZEND_FN( locale_lookup ), locale_4_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( canonicalize, ZEND_FN( locale_canonicalize ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( acceptFromHttp, ZEND_FN( locale_accept_from_http ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
PHP_FE_END
};
/* }}} */
+6 -5
View File
@@ -29,9 +29,10 @@ zend_class_entry *Normalizer_ce_ptr = NULL;
/* {{{ Normalizer methods arguments info */
ZEND_BEGIN_ARG_INFO_EX( normalizer_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, input )
ZEND_ARG_INFO( 0, form )
ZEND_BEGIN_ARG_INFO_EX( normalizer_3_args, 0, 0, 3 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_ARG_INFO( 0, arg3 )
ZEND_END_ARG_INFO()
/* }}} */
@@ -41,8 +42,8 @@ ZEND_END_ARG_INFO()
*/
zend_function_entry Normalizer_class_functions[] = {
ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
PHP_FE_END
};
/* }}} */
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #74230 iconv fails to fail on surrogates
--SKIPIF--
<?php if(!extension_loaded('iconv')) print 'skip'; ?>
--FILE--
<?php
$high = "\xED\xa1\x92"; // codepoint D852
$low = "\xED\xBD\xA2"; // codepoint DF62
$pair = $high.$low;
var_dump(
@\iconv('UTF-8', 'UTF-8', $high) === false,
@\iconv('UTF-8', 'UTF-8', $low) === false,
@\iconv('UTF-8', 'UTF-8', $pair) === false
);
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
-30
View File
@@ -1,30 +0,0 @@
--TEST--
Bug #74298 (IntlDateFormatter->format() doesn't return microseconds/fractions)
--SKIPIF--
<?php if (!extension_loaded('intl')) print 'skip'; ?>
--FILE--
<?php
var_dump((new \DateTime('2017-01-01 01:02:03.123456'))->format('Y-m-d\TH:i:s.u'));
var_dump((new \IntlDateFormatter(
'en-US',
\IntlDateFormatter::FULL,
\IntlDateFormatter::FULL,
'UTC',
\IntlDateFormatter::GREGORIAN,
'yyyy-MM-dd HH:mm:ss.SSSSSS'
))->format(new \DateTime('2017-01-01 01:02:03.123456')));
var_dump(datefmt_create(
'en-US',
\IntlDateFormatter::FULL,
\IntlDateFormatter::FULL,
'UTC',
\IntlDateFormatter::GREGORIAN,
'yyyy-MM-dd HH:mm:ss.SSSSSS'
)->format(new \DateTime('2017-01-01 01:02:03.123456')));
?>
--EXPECTF--
string(26) "2017-01-01T01:02:03.123456"
string(26) "2017-01-01 01:02:03.123000"
string(26) "2017-01-01 01:02:03.123000"
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #74433 Wrong reflection on the Normalizer methods
--SKIPIF--
<?php if (!extension_loaded('intl')) die('skip intl extension not available'); ?>
--FILE--
<?php
$rm = new ReflectionMethod(Normalizer::class, 'isNormalized');
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());
$rm = new ReflectionMethod(Normalizer::class, 'normalize');
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(2)
int(1)
int(2)
int(1)
===DONE===
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Bug #65683 IntlDateFormatter accepts DateTimeImmutable
--SKIPIF--
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
--FILE--
<?php
$formatter = new IntlDateFormatter('en-US', IntlDateFormatter::FULL, IntlDateFormatter::NONE, new DateTimeZone("UTC"));
var_dump($formatter->format(new DateTimeImmutable('2017-03-27 00:00:00 UTC'))) . "\n";
?>
==DONE==
--EXPECTF--
string(%s) "Monday, March %d, 2017"
==DONE==
+5 -5
View File
@@ -400,24 +400,24 @@ Formatted DateTime is : 20001230 05:04 PM
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
@@ -400,24 +400,24 @@ Formatted DateTime is : 20001230 05:04 PM
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
@@ -400,24 +400,24 @@ Formatted DateTime is : 20001230 05:04 PM
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
------------
Date is: stdClass::__set_state(array(
))
------------
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR'
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
-54
View File
@@ -1,54 +0,0 @@
--TEST--
Bug #74439 Wrong reflection on the Locale methods
--SKIPIF--
<?php if (!extension_loaded('intl')) die('skip intl extension not available'); ?>
--FILE--
<?php
$methods = [
'getDefault',
'acceptFromHttp',
'canonicalize',
'composeLocale',
'getAllVariants',
'getKeywords',
'getPrimaryLanguage',
'getRegion',
'getScript',
'parseLocale',
'setDefault',
'getDisplayLanguage',
'getDisplayName',
'getDisplayRegion',
'getDisplayScript',
'getDisplayVariant',
'filterMatches',
'lookup',
];
foreach ($methods as $method) {
$rm = new ReflectionMethod(Locale::class, $method);
printf("%s: %d, %d\n", $method, $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters());
}
?>
===DONE===
--EXPECT--
getDefault: 0, 0
acceptFromHttp: 1, 1
canonicalize: 1, 1
composeLocale: 1, 1
getAllVariants: 1, 1
getKeywords: 1, 1
getPrimaryLanguage: 1, 1
getRegion: 1, 1
getScript: 1, 1
parseLocale: 1, 1
setDefault: 1, 1
getDisplayLanguage: 2, 1
getDisplayName: 2, 1
getDisplayRegion: 2, 1
getDisplayScript: 2, 1
getDisplayVariant: 2, 1
filterMatches: 3, 2
lookup: 4, 2
===DONE===
@@ -16,16 +16,13 @@ $fmt = <<<EOD
EOD;
$dt = new DateTime("2012-05-06 18:00:42", new DateTimeZone("Europe/Lisbon"));
$dti = new DateTimeImmutable("2012-05-06 18:00:42", new DateTimeZone("Europe/Lisbon"));
$mf = new MessageFormatter('en_US', $fmt);
var_dump($mf->format(array($dt)));
var_dump($mf->format(array($dti)));
?>
==DONE==
--EXPECTF--
string(%s) "May %d, 2012 %d:%d:42 %s"
string(%s) "May %d, 2012 %d:%d:42 %s"
==DONE==
+1 -1
View File
@@ -20,7 +20,7 @@ $mf = new MessageFormatter('en_US', $fmt);
var_dump($mf->format(array("foo" => new stdclass())));
--EXPECTF--
Warning: MessageFormatter::format(): msgfmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted) in %s on line %d
Warning: MessageFormatter::format(): msgfmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted) in %s on line %d
Warning: MessageFormatter::format(): The argument for key 'foo' cannot be used as a date or time in %s on line %d
bool(false)
+2 -2
View File
@@ -26,7 +26,7 @@
#if HAVE_LIBMCRYPT
#ifdef PHP_WIN32
#if PHP_WIN32
# include "win32/winutil.h"
#endif
@@ -1376,7 +1376,7 @@ PHP_FUNCTION(mcrypt_create_iv)
iv = ecalloc(size + 1, 1);
if (source == RANDOM || source == URANDOM) {
#ifdef PHP_WIN32
#if PHP_WIN32
/* random/urandom equivalent on Windows */
BYTE *iv_b = (BYTE *) iv;
if (php_win32_get_random_bytes(iv_b, (size_t) size) == FAILURE){
-47
View File
@@ -687,53 +687,6 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 249, "gb18030", "gb18030_bin", 1, 4, "", mysqlnd_mbcharlen_gb18030, my_ismbchar_gb18030},
{ 254, UTF8_MB3, UTF8_MB3"_general_cs", 1, 3, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 255, UTF8_MB4, UTF8_MB4"_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 256, UTF8_MB4, UTF8_MB4"_de_pb_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 257, UTF8_MB4, UTF8_MB4"_is_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 258, UTF8_MB4, UTF8_MB4"_lv_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 259, UTF8_MB4, UTF8_MB4"_ro_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 260, UTF8_MB4, UTF8_MB4"_sl_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 261, UTF8_MB4, UTF8_MB4"_pl_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 262, UTF8_MB4, UTF8_MB4"_et_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 263, UTF8_MB4, UTF8_MB4"_es_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 264, UTF8_MB4, UTF8_MB4"_sv_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 265, UTF8_MB4, UTF8_MB4"_tr_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 266, UTF8_MB4, UTF8_MB4"_cs_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 267, UTF8_MB4, UTF8_MB4"_da_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 268, UTF8_MB4, UTF8_MB4"_lt_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 269, UTF8_MB4, UTF8_MB4"_sk_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 270, UTF8_MB4, UTF8_MB4"_es_trad_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 271, UTF8_MB4, UTF8_MB4"_la_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 272, UTF8_MB4, UTF8_MB4"_fa_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 273, UTF8_MB4, UTF8_MB4"_eo_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 274, UTF8_MB4, UTF8_MB4"_hu_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 275, UTF8_MB4, UTF8_MB4"_hr_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 276, UTF8_MB4, UTF8_MB4"_si_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 277, UTF8_MB4, UTF8_MB4"_vi_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 278, UTF8_MB4, UTF8_MB4"_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 279, UTF8_MB4, UTF8_MB4"_de_pb_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 280, UTF8_MB4, UTF8_MB4"_is_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 281, UTF8_MB4, UTF8_MB4"_lv_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 282, UTF8_MB4, UTF8_MB4"_ro_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 283, UTF8_MB4, UTF8_MB4"_sl_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 284, UTF8_MB4, UTF8_MB4"_pl_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 285, UTF8_MB4, UTF8_MB4"_et_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 286, UTF8_MB4, UTF8_MB4"_es_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 287, UTF8_MB4, UTF8_MB4"_sv_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 288, UTF8_MB4, UTF8_MB4"_tr_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 289, UTF8_MB4, UTF8_MB4"_cs_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 290, UTF8_MB4, UTF8_MB4"_da_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 291, UTF8_MB4, UTF8_MB4"_lt_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 292, UTF8_MB4, UTF8_MB4"_sk_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 293, UTF8_MB4, UTF8_MB4"_es_trad_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 294, UTF8_MB4, UTF8_MB4"_la_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 295, UTF8_MB4, UTF8_MB4"_fa_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 296, UTF8_MB4, UTF8_MB4"_eo_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 297, UTF8_MB4, UTF8_MB4"_hu_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 298, UTF8_MB4, UTF8_MB4"_hr_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 299, UTF8_MB4, UTF8_MB4"_si_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 300, UTF8_MB4, UTF8_MB4"_vi_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 303, UTF8_MB4, UTF8_MB4"_ja_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 0, NULL, NULL, 0, 0, NULL, NULL, NULL}
};
/* }}} */
+2 -2
View File
@@ -122,7 +122,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s)
} else {
COPY_CLIENT_ERROR(conn->error_info, result->stored_data->error_info);
stmt->result->m.free_result_contents(stmt->result);
mnd_pefree(stmt->result, stmt->result->persistent);
mnd_efree(stmt->result);
stmt->result = NULL;
stmt->state = MYSQLND_STMT_PREPARED;
}
@@ -347,7 +347,7 @@ mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s)
if (FAIL == (ret = PACKET_READ(fields_eof))) {
if (stmt->result) {
stmt->result->m.free_result_contents(stmt->result);
mnd_pefree(stmt->result, stmt->result->persistent);
mnd_efree(stmt->result);
/* XXX: This will crash, because we will null also the methods.
But seems it happens in extreme cases or doesn't. Should be fixed by exporting a function
(from mysqlnd_driver.c?) to do the reset.
-4
View File
@@ -1722,7 +1722,6 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
}
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (text *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(text), 0);
memset(bind->array.elements, 0, max_table_length * (maxlength + 1) * sizeof(text));
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
@@ -1782,7 +1781,6 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (ub4 *)safe_emalloc(max_table_length, sizeof(ub4), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
@@ -1822,7 +1820,6 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (double *)safe_emalloc(max_table_length, sizeof(double), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
@@ -1863,7 +1860,6 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (OCIDate *)safe_emalloc(max_table_length, sizeof(OCIDate), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
+4 -20
View File
@@ -46,12 +46,12 @@ Interoperability Support" (ID 207303.1) for details.
<active>no</active>
</lead>
<date>2017-04-12</date>
<date>2016-10-17</date>
<time>12:00:00</time>
<version>
<release>2.1.4</release>
<api>2.1.4</api>
<release>2.1.3</release>
<api>2.1.3</api>
</version>
<stability>
<release>stable</release>
@@ -60,7 +60,7 @@ Interoperability Support" (ID 207303.1) for details.
<license uri="http://www.php.net/license">PHP</license>
<notes>
This version is for PHP 7 only.
Fixed uninitialized data causing random crash
Fixed bug #71148 (Bind reference overwritten on PHP 7)
</notes>
<contents>
<dir name="/">
@@ -468,22 +468,6 @@ Fixed uninitialized data causing random crash
</extsrcrelease>
<changelog>
<release>
<version>
<release>2.1.3</release>
<api>2.1.3</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
This version is for PHP 7 only.
Fixed bug #71148 (Bind reference overwritten on PHP 7)
</notes>
</release>
<release>
<version>
<release>2.1.2</release>
+1 -1
View File
@@ -43,7 +43,7 @@
*/
#undef PHP_OCI8_VERSION
#endif
#define PHP_OCI8_VERSION "2.1.4"
#define PHP_OCI8_VERSION "2.1.3"
extern zend_module_entry oci8_module_entry;
#define phpext_oci8_ptr &oci8_module_entry
+2 -10
View File
@@ -165,7 +165,7 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
COPY_NODE(opline->op1, src->op1);
VAR_SOURCE(op1) = NULL;
MAKE_NOP(src);
} else if (opline->opcode != ZEND_FETCH_LIST && opline->opcode != ZEND_CASE) {
} else {
zval c = ZEND_OP1_LITERAL(src);
zval_copy_ctor(&c);
if (zend_optimizer_update_op1_const(op_array, opline, &c)) {
@@ -1176,10 +1176,7 @@ static void zend_jmp_optimization(zend_basic_block *block, zend_op_array *op_arr
if (block->successors[0] == block->successors[1]) {
/* L: JMP[N]Z(X, L+1) -> NOP or FREE(X) */
if (last_op->op1_type == IS_CV) {
last_op->opcode = ZEND_CHECK_VAR;
last_op->op2.num = 0;
} else if (last_op->op1_type & (IS_VAR|IS_TMP_VAR)) {
if (last_op->op1_type & (IS_VAR|IS_TMP_VAR)) {
last_op->opcode = ZEND_FREE;
last_op->op2.num = 0;
} else {
@@ -1797,11 +1794,6 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
return;
}
if (cfg.blocks_count * (op_array->last_var + op_array->T) > 64 * 1024 * 1024) {
zend_arena_release(&ctx->arena, checkpoint);
return;
}
if (ctx->debug_level & ZEND_DUMP_BEFORE_BLOCK_PASS) {
zend_dump_op_array(op_array, ZEND_DUMP_CFG, "before block pass", &cfg);
}
-3
View File
@@ -146,9 +146,6 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
LITERAL_INFO(opline->op2.constant, LITERAL_FUNC, 1, 1, 3);
break;
case ZEND_INIT_METHOD_CALL:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
LITERAL_INFO(opline->op1.constant, LITERAL_VALUE, 1, 0, 1);
}
if (ZEND_OP2_TYPE(opline) == IS_CONST) {
optimizer_literal_obj_info(
info,
+1 -12
View File
@@ -162,12 +162,8 @@ static void zend_ssa_remove_nops(zend_op_array *op_array, zend_ssa *ssa)
zend_op *opline;
zend_op *new_opline;
b->len = target - b->start;
opline = op_array->opcodes + end - 1;
if (opline->opcode == ZEND_NOP) {
continue;
}
b->len = target - b->start;
new_opline = op_array->opcodes + target - 1;
switch (new_opline->opcode) {
case ZEND_JMP:
@@ -366,13 +362,6 @@ static zend_bool opline_supports_assign_contraction(
&& (opline->op2_type != IS_CV || opline->op2.var != cv_var);
}
if (opline->opcode == ZEND_CAST
&& (opline->extended_value == IS_ARRAY || opline->extended_value == IS_OBJECT)) {
/* CAST to array/object may initialize the result to an empty array/object before
* reading the expression. */
return opline->op1_type != IS_CV || opline->op1.var != cv_var;
}
return 1;
}
+1 -9
View File
@@ -176,15 +176,7 @@ void zend_optimizer_pass2(zend_op_array *op_array)
/* JMPNZ(X, L1), JMP(L2) => JMPZNZ(X, L2, L1) */
if (ZEND_OP2_JMP_ADDR(opline) == ZEND_OP1_JMP_ADDR(opline + 1)) {
/* JMPZ(X, L1), JMP(L1) => NOP, JMP(L1) */
if (opline->op1_type == IS_CV) {
opline->opcode = ZEND_CHECK_VAR;
opline->op2.num = 0;
} else if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) {
opline->opcode = ZEND_FREE;
opline->op2.num = 0;
} else {
MAKE_NOP(opline);
}
MAKE_NOP(opline);
} else {
if (opline->opcode == ZEND_JMPZ) {
opline->extended_value = ZEND_OPLINE_TO_OFFSET(opline, ZEND_OP1_JMP_ADDR(opline + 1));
-23
View File
@@ -266,29 +266,6 @@ int zend_build_call_graph(zend_arena **arena, zend_script *script, uint32_t buil
}
/* }}} */
zend_call_info **zend_build_call_map(zend_arena **arena, zend_func_info *info, zend_op_array *op_array) /* {{{ */
{
zend_call_info **map, *call;
if (!info->callee_info) {
/* Don't build call map if function contains no calls */
return NULL;
}
map = zend_arena_calloc(arena, sizeof(zend_call_info *), op_array->last);
for (call = info->callee_info; call; call = call->next_callee) {
int i;
map[call->caller_init_opline - op_array->opcodes] = call;
map[call->caller_call_opline - op_array->opcodes] = call;
for (i = 0; i < call->num_args; i++) {
if (call->arg_info[i].opline) {
map[call->arg_info[i].opline - op_array->opcodes] = call;
}
}
}
return map;
}
/* }}} */
/*
* Local variables:
* tab-width: 4
-2
View File
@@ -51,7 +51,6 @@ struct _zend_func_info {
zend_ssa ssa; /* Static Single Assignmnt Form */
zend_call_info *caller_info; /* where this function is called from */
zend_call_info *callee_info; /* which functions are called from this one */
zend_call_info **call_map; /* Call info associated with init/call/send opnum */
int num_args; /* (-1 - unknown) */
zend_recv_arg_info *arg_info;
zend_ssa_var_info return_info;
@@ -70,7 +69,6 @@ typedef struct _zend_call_graph {
BEGIN_EXTERN_C()
int zend_build_call_graph(zend_arena **arena, zend_script *script, uint32_t build_flags, zend_call_graph *call_graph);
zend_call_info **zend_build_call_map(zend_arena **arena, zend_func_info *info, zend_op_array *op_array);
int zend_analyze_calls(zend_arena **arena, zend_script *script, uint32_t build_flags, zend_op_array *op_array, zend_func_info *func_info);
END_EXTERN_C()
+54 -72
View File
@@ -749,51 +749,31 @@ static int dominates(zend_basic_block *blocks, int a, int b) /* {{{ */
}
/* }}} */
typedef struct {
int id;
int level;
} block_info;
static int compare_block_level(const block_info *a, const block_info *b) {
return b->level - a->level;
}
static void swap_blocks(block_info *a, block_info *b) {
block_info tmp = *a;
*a = *b;
*b = tmp;
}
int zend_cfg_identify_loops(const zend_op_array *op_array, zend_cfg *cfg, uint32_t *flags) /* {{{ */
{
int i, j, k, n;
int time;
int i, j, k;
int depth;
zend_basic_block *blocks = cfg->blocks;
int *entry_times, *exit_times;
int *dj_spanning_tree;
zend_worklist work;
int flag = ZEND_FUNC_NO_LOOPS;
block_info *sorted_blocks;
ALLOCA_FLAG(list_use_heap)
ALLOCA_FLAG(tree_use_heap)
ALLOCA_FLAG(sorted_blocks_use_heap)
ZEND_WORKLIST_ALLOCA(&work, cfg->blocks_count, list_use_heap);
dj_spanning_tree = do_alloca(sizeof(int) * cfg->blocks_count, tree_use_heap);
/* We don't materialize the DJ spanning tree explicitly, as we are only interested in ancestor
* queries. These are implemented by checking entry/exit times of the DFS search. */
entry_times = do_alloca(2 * sizeof(int) * cfg->blocks_count, tree_use_heap);
exit_times = entry_times + cfg->blocks_count;
memset(entry_times, -1, 2 * sizeof(int) * cfg->blocks_count);
for (i = 0; i < cfg->blocks_count; i++) {
dj_spanning_tree[i] = -1;
}
zend_worklist_push(&work, 0);
time = 0;
while (zend_worklist_len(&work)) {
next:
i = zend_worklist_peek(&work);
if (entry_times[i] == -1) {
entry_times[i] = time++;
}
/* Visit blocks immediately dominated by i. */
for (j = blocks[i].children; j >= 0; j = blocks[j].next_child) {
if (zend_worklist_push(&work, j)) {
dj_spanning_tree[j] = i;
goto next;
}
}
@@ -805,70 +785,72 @@ int zend_cfg_identify_loops(const zend_op_array *op_array, zend_cfg *cfg, uint32
} else if (blocks[succ].idom == i) {
continue;
} else if (zend_worklist_push(&work, succ)) {
dj_spanning_tree[succ] = i;
goto next;
}
}
exit_times[i] = time++;
zend_worklist_pop(&work);
}
/* Sort blocks by decreasing level, which is the order in which we want to process them */
sorted_blocks = do_alloca(sizeof(block_info) * cfg->blocks_count, sorted_blocks_use_heap);
for (i = 0; i < cfg->blocks_count; i++) {
sorted_blocks[i].id = i;
sorted_blocks[i].level = blocks[i].level;
}
zend_sort(sorted_blocks, cfg->blocks_count, sizeof(block_info),
(compare_func_t) compare_block_level, (swap_func_t) swap_blocks);
/* Identify loops. See Sreedhar et al, "Identifying Loops Using DJ
Graphs". */
for (n = 0; n < cfg->blocks_count; n++) {
i = sorted_blocks[n].id;
zend_bitset_clear(work.visited, zend_bitset_len(cfg->blocks_count));
for (j = 0; j < blocks[i].predecessors_count; j++) {
int pred = cfg->predecessors[blocks[i].predecessor_offset + j];
/* A join edge is one for which the predecessor does not
immediately dominate the successor. */
if (blocks[i].idom == pred) {
for (i = 0, depth = 0; i < cfg->blocks_count; i++) {
if (blocks[i].level > depth) {
depth = blocks[i].level;
}
}
for (; depth >= 0; depth--) {
for (i = 0; i < cfg->blocks_count; i++) {
if (blocks[i].level != depth) {
continue;
}
zend_bitset_clear(work.visited, zend_bitset_len(cfg->blocks_count));
for (j = 0; j < blocks[i].predecessors_count; j++) {
int pred = cfg->predecessors[blocks[i].predecessor_offset + j];
/* In a loop back-edge (back-join edge), the successor dominates
the predecessor. */
if (dominates(blocks, i, pred)) {
blocks[i].flags |= ZEND_BB_LOOP_HEADER;
flag &= ~ZEND_FUNC_NO_LOOPS;
zend_worklist_push(&work, pred);
} else {
/* Otherwise it's a cross-join edge. See if it's a branch
to an ancestor on the DJ spanning tree. */
if (entry_times[pred] > entry_times[i] && exit_times[pred] < exit_times[i]) {
blocks[i].flags |= ZEND_BB_IRREDUCIBLE_LOOP;
flag |= ZEND_FUNC_IRREDUCIBLE;
/* A join edge is one for which the predecessor does not
immediately dominate the successor. */
if (blocks[i].idom == pred) {
continue;
}
/* In a loop back-edge (back-join edge), the successor dominates
the predecessor. */
if (dominates(blocks, i, pred)) {
blocks[i].flags |= ZEND_BB_LOOP_HEADER;
flag &= ~ZEND_FUNC_NO_LOOPS;
zend_worklist_push(&work, pred);
} else {
/* Otherwise it's a cross-join edge. See if it's a branch
to an ancestor on the dominator spanning tree. */
int dj_parent = pred;
while (dj_parent >= 0) {
if (dj_parent == i) {
/* An sp-back edge: mark as irreducible. */
blocks[i].flags |= ZEND_BB_IRREDUCIBLE_LOOP;
flag |= ZEND_FUNC_IRREDUCIBLE;
flag &= ~ZEND_FUNC_NO_LOOPS;
break;
} else {
dj_parent = dj_spanning_tree[dj_parent];
}
}
}
}
}
while (zend_worklist_len(&work)) {
j = zend_worklist_pop(&work);
while (blocks[j].loop_header >= 0) {
j = blocks[j].loop_header;
}
if (j != i) {
blocks[j].loop_header = i;
for (k = 0; k < blocks[j].predecessors_count; k++) {
zend_worklist_push(&work, cfg->predecessors[blocks[j].predecessor_offset + k]);
while (zend_worklist_len(&work)) {
j = zend_worklist_pop(&work);
if (blocks[j].loop_header < 0 && j != i) {
blocks[j].loop_header = i;
for (k = 0; k < blocks[j].predecessors_count; k++) {
zend_worklist_push(&work, cfg->predecessors[blocks[j].predecessor_offset + k]);
}
}
}
}
}
free_alloca(sorted_blocks, sorted_blocks_use_heap);
free_alloca(entry_times, tree_use_heap);
free_alloca(dj_spanning_tree, tree_use_heap);
ZEND_WORKLIST_FREE_ALLOCA(&work, list_use_heap);
*flags |= flag;
+52 -49
View File
@@ -58,20 +58,6 @@
#define LOG_NEG_RANGE(...)
#endif
/* Pop elements in unspecified order from worklist until it is empty */
#define WHILE_WORKLIST(worklist, len, i) do { \
zend_bool _done = 0; \
while (!_done) { \
_done = 1; \
ZEND_BITSET_FOREACH(worklist, len, i) { \
zend_bitset_excl(worklist, i); \
_done = 0;
#define WHILE_WORKLIST_END() \
} ZEND_BITSET_FOREACH_END(); \
} \
} while (0)
#define CHECK_SCC_VAR(var2) \
do { \
if (!ssa->vars[var2].no_val) { \
@@ -283,7 +269,9 @@ int zend_ssa_find_false_dependencies(const zend_op_array *op_array, zend_ssa *ss
}
}
WHILE_WORKLIST(worklist, zend_bitset_len(ssa_vars_count), i) {
while (!zend_bitset_empty(worklist, zend_bitset_len(ssa_vars_count))) {
i = zend_bitset_first(worklist, zend_bitset_len(ssa_vars_count));
zend_bitset_excl(worklist, i);
if (ssa_vars[i].definition_phi) {
/* mark all possible sources as used */
p = ssa_vars[i].definition_phi;
@@ -301,7 +289,7 @@ int zend_ssa_find_false_dependencies(const zend_op_array *op_array, zend_ssa *ss
}
}
}
} WHILE_WORKLIST_END();
}
free_alloca(worklist, use_heap);
@@ -1369,24 +1357,21 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
case ZEND_DO_ICALL:
case ZEND_DO_UCALL:
case ZEND_DO_FCALL_BY_NAME:
if (ssa->ops[line].result_def == var) {
if (ssa->ops[line].result_def == var && ZEND_FUNC_INFO(op_array)) {
zend_func_info *func_info = ZEND_FUNC_INFO(op_array);
zend_call_info *call_info;
if (!func_info || !func_info->call_map) {
break;
}
zend_call_info *call_info = func_info->callee_info;
call_info = func_info->call_map[opline - op_array->opcodes];
if (!call_info) {
break;
while (call_info && call_info->caller_call_opline != opline) {
call_info = call_info->next_callee;
}
if (call_info->callee_func->type == ZEND_USER_FUNCTION) {
func_info = ZEND_FUNC_INFO(&call_info->callee_func->op_array);
if (func_info && func_info->return_info.has_range) {
*tmp = func_info->return_info.range;
return 1;
if (call_info) {
if (call_info->callee_func->type == ZEND_USER_FUNCTION) {
func_info = ZEND_FUNC_INFO(&call_info->callee_func->op_array);
if (func_info && func_info->return_info.has_range) {
*tmp = func_info->return_info.range;
return 1;
}
}
}
//TODO: we can't use type inference for internal functions at this point ???
#if 0
uint32_t type;
@@ -1409,6 +1394,7 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
return 1;
}
#endif
}
}
break;
// FIXME: support for more opcodes
@@ -1580,7 +1566,9 @@ static void zend_infer_ranges_warmup(const zend_op_array *op_array, zend_ssa *ss
memset(visited, 0, sizeof(zend_ulong) * worklist_len);
WHILE_WORKLIST(worklist, worklist_len, j) {
while (!zend_bitset_empty(worklist, worklist_len)) {
j = zend_bitset_first(worklist, worklist_len);
zend_bitset_excl(worklist, j);
if (zend_inference_calc_range(op_array, ssa, j, 0, 0, &tmp)) {
#ifdef NEG_RANGE
if (!has_inner_cycles &&
@@ -1635,7 +1623,7 @@ static void zend_infer_ranges_warmup(const zend_op_array *op_array, zend_ssa *ss
FOR_EACH_VAR_USAGE(j, ADD_SCC_VAR_1);
}
}
} WHILE_WORKLIST_END();
}
}
free_alloca(worklist, use_heap);
}
@@ -1652,11 +1640,11 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
ALLOCA_FLAG(use_heap);
worklist = do_alloca(
ZEND_MM_ALIGNED_SIZE(sizeof(zend_ulong) * worklist_len) +
ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->vars_count) +
sizeof(zend_ulong) * worklist_len +
sizeof(int) * ssa->vars_count +
sizeof(int) * ssa->sccs, use_heap);
next_scc_var = (int*)((char*)worklist + ZEND_MM_ALIGNED_SIZE(sizeof(zend_ulong) * worklist_len));
scc_var = (int*)((char*)next_scc_var + ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->vars_count));
next_scc_var = (int*)(worklist + worklist_len);
scc_var = next_scc_var + ssa->vars_count;
LOG_SSA_RANGE("Range Inference\n");
@@ -1698,11 +1686,13 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
#endif
/* widening */
WHILE_WORKLIST(worklist, worklist_len, j) {
while (!zend_bitset_empty(worklist, worklist_len)) {
j = zend_bitset_first(worklist, worklist_len);
zend_bitset_excl(worklist, j);
if (zend_ssa_range_widening(op_array, ssa, j, scc)) {
FOR_EACH_VAR_USAGE(j, ADD_SCC_VAR);
}
} WHILE_WORKLIST_END();
}
/* Add all SCC entry variables into worklist for narrowing */
for (j = scc_var[scc]; j >= 0; j = next_scc_var[j]) {
@@ -1713,7 +1703,9 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
}
/* narrowing */
WHILE_WORKLIST(worklist, worklist_len, j) {
while (!zend_bitset_empty(worklist, worklist_len)) {
j = zend_bitset_first(worklist, worklist_len);
zend_bitset_excl(worklist, j);
if (zend_ssa_range_narrowing(op_array, ssa, j, scc)) {
FOR_EACH_VAR_USAGE(j, ADD_SCC_VAR);
#ifdef SYM_RANGE
@@ -1725,7 +1717,7 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
}
#endif
}
} WHILE_WORKLIST_END();
}
}
}
@@ -3134,10 +3126,13 @@ static void zend_update_type_info(const zend_op_array *op_array,
zend_func_info *func_info = ZEND_FUNC_INFO(op_array);
zend_call_info *call_info;
if (!func_info || !func_info->call_map) {
if (!func_info) {
goto unknown_opcode;
}
call_info = func_info->call_map[opline - op_array->opcodes];
call_info = func_info->callee_info;
while (call_info && call_info->caller_call_opline != opline) {
call_info = call_info->next_callee;
}
if (!call_info) {
goto unknown_opcode;
}
@@ -3274,7 +3269,9 @@ int zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script
int i, j;
uint32_t tmp;
WHILE_WORKLIST(worklist, zend_bitset_len(ssa_vars_count), j) {
while (!zend_bitset_empty(worklist, zend_bitset_len(ssa_vars_count))) {
j = zend_bitset_first(worklist, zend_bitset_len(ssa_vars_count));
zend_bitset_excl(worklist, j);
if (ssa_vars[j].definition_phi) {
zend_ssa_phi *p = ssa_vars[j].definition_phi;
if (p->pi >= 0) {
@@ -3331,7 +3328,7 @@ int zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script
i = ssa_vars[j].definition;
zend_update_type_info(op_array, ssa, script, worklist, i);
}
} WHILE_WORKLIST_END();
}
return SUCCESS;
}
@@ -3557,14 +3554,18 @@ static int is_recursive_tail_call(const zend_op_array *op_array,
{
zend_func_info *info = ZEND_FUNC_INFO(op_array);
if (info->ssa.ops && info->ssa.vars && info->call_map &&
if (info->ssa.ops && info->ssa.vars &&
info->ssa.ops[opline - op_array->opcodes].op1_use >= 0 &&
info->ssa.vars[info->ssa.ops[opline - op_array->opcodes].op1_use].definition >= 0) {
zend_op *op = op_array->opcodes + info->ssa.vars[info->ssa.ops[opline - op_array->opcodes].op1_use].definition;
if (op->opcode == ZEND_DO_UCALL) {
zend_call_info *call_info = info->call_map[op - op_array->opcodes];
zend_call_info *call_info = info->callee_info;
while (call_info && call_info->caller_call_opline != op) {
call_info = call_info->next_callee;
}
if (call_info && op_array == &call_info->callee_func->op_array) {
return 1;
}
@@ -3886,7 +3887,7 @@ void zend_inference_check_recursive_dependencies(zend_op_array *op_array)
zend_func_info *info = ZEND_FUNC_INFO(op_array);
zend_call_info *call_info;
zend_bitset worklist;
int worklist_len, i;
int worklist_len;
ALLOCA_FLAG(use_heap);
if (!info->ssa.var_info || !(info->flags & ZEND_FUNC_RECURSIVE)) {
@@ -3903,12 +3904,14 @@ void zend_inference_check_recursive_dependencies(zend_op_array *op_array)
}
call_info = call_info->next_callee;
}
WHILE_WORKLIST(worklist, worklist_len, i) {
while (!zend_bitset_empty(worklist, worklist_len)) {
int i = zend_bitset_first(worklist, worklist_len);
zend_bitset_excl(worklist, i);
if (!info->ssa.var_info[i].recursive) {
info->ssa.var_info[i].recursive = 1;
add_usages(op_array, &info->ssa, worklist, i);
}
} WHILE_WORKLIST_END();
}
free_alloca(worklist, use_heap);
}
+3 -4
View File
@@ -978,10 +978,9 @@ int zend_optimize_script(zend_script *script, zend_long optimization_level, zend
}
for (i = 0; i < call_graph.op_arrays_count; i++) {
func_info = ZEND_FUNC_INFO(call_graph.op_arrays[i]);
if (func_info) {
func_info->call_map = zend_build_call_map(&ctx.arena, func_info, call_graph.op_arrays[i]);
if (call_graph.op_arrays[i]->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
if (call_graph.op_arrays[i]->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
func_info = ZEND_FUNC_INFO(call_graph.op_arrays[i]);
if (func_info) {
zend_init_func_return_info(call_graph.op_arrays[i], script, &func_info->return_info);
}
}
+8 -8
View File
@@ -77,12 +77,12 @@ static zend_ssa_phi *add_pi(
}
phi = zend_arena_calloc(arena, 1,
ZEND_MM_ALIGNED_SIZE(sizeof(zend_ssa_phi)) +
ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->cfg.blocks[to].predecessors_count) +
sizeof(zend_ssa_phi) +
sizeof(int) * ssa->cfg.blocks[to].predecessors_count +
sizeof(void*) * ssa->cfg.blocks[to].predecessors_count);
phi->sources = (int*)(((char*)phi) + ZEND_MM_ALIGNED_SIZE(sizeof(zend_ssa_phi)));
phi->sources = (int*)(((char*)phi) + sizeof(zend_ssa_phi));
memset(phi->sources, 0xff, sizeof(int) * ssa->cfg.blocks[to].predecessors_count);
phi->use_chains = (zend_ssa_phi**)(((char*)phi->sources) + ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->cfg.blocks[to].predecessors_count));
phi->use_chains = (zend_ssa_phi**)(((char*)phi->sources) + sizeof(int) * ssa->cfg.blocks[to].predecessors_count);
phi->pi = from;
phi->var = var;
@@ -947,13 +947,13 @@ int zend_build_ssa(zend_arena **arena, const zend_script *script, const zend_op_
if (!zend_bitset_empty(phi + j * set_size, set_size)) {
ZEND_BITSET_REVERSE_FOREACH(phi + j * set_size, set_size, i) {
zend_ssa_phi *phi = zend_arena_calloc(arena, 1,
ZEND_MM_ALIGNED_SIZE(sizeof(zend_ssa_phi)) +
ZEND_MM_ALIGNED_SIZE(sizeof(int) * blocks[j].predecessors_count) +
sizeof(zend_ssa_phi) +
sizeof(int) * blocks[j].predecessors_count +
sizeof(void*) * blocks[j].predecessors_count);
phi->sources = (int*)(((char*)phi) + ZEND_MM_ALIGNED_SIZE(sizeof(zend_ssa_phi)));
phi->sources = (int*)(((char*)phi) + sizeof(zend_ssa_phi));
memset(phi->sources, 0xff, sizeof(int) * blocks[j].predecessors_count);
phi->use_chains = (zend_ssa_phi**)(((char*)phi->sources) + ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->cfg.blocks[j].predecessors_count));
phi->use_chains = (zend_ssa_phi**)(((char*)phi->sources) + sizeof(int) * ssa->cfg.blocks[j].predecessors_count);
phi->pi = -1;
phi->var = i;
+2 -2
View File
@@ -77,10 +77,10 @@ typedef struct _zend_worklist {
} zend_worklist;
#define ZEND_WORKLIST_ALLOCA(w, _len, use_heap) do { \
(w)->stack.buf = (int*)do_alloca(ZEND_MM_ALIGNED_SIZE(sizeof(int) * _len) + sizeof(zend_ulong) * zend_bitset_len(_len), use_heap); \
(w)->stack.buf = (int*)do_alloca(sizeof(int) * _len + sizeof(zend_ulong) * zend_bitset_len(_len), use_heap); \
(w)->stack.len = 0; \
(w)->stack.capacity = _len; \
(w)->visited = (zend_bitset)((char*)(w)->stack.buf + ZEND_MM_ALIGNED_SIZE(sizeof(int) * _len)); \
(w)->visited = (zend_bitset)((w)->stack.buf + _len); \
memset((w)->visited, 0, sizeof(zend_ulong) * zend_bitset_len(_len)); \
} while (0)
+9 -10
View File
@@ -144,8 +144,8 @@ static int zend_shared_alloc_reattach(size_t requested_size, char **error_in)
FILE *fp = fopen(mmap_base_file, "r");
MEMORY_BASIC_INFORMATION info;
err = GetLastError();
if (!fp) {
err = GetLastError();
zend_win_error_message(ACCEL_LOG_WARNING, mmap_base_file, err);
zend_win_error_message(ACCEL_LOG_FATAL, "Unable to open base address file", err);
*error_in="fopen";
@@ -194,9 +194,9 @@ static int zend_shared_alloc_reattach(size_t requested_size, char **error_in)
}
mapping_base = MapViewOfFileEx(memfile, FILE_MAP_ALL_ACCESS, 0, 0, 0, wanted_mapping_base);
err = GetLastError();
if (mapping_base == NULL) {
err = GetLastError();
if (err == ERROR_INVALID_ADDRESS) {
zend_win_error_message(ACCEL_LOG_FATAL, "Unable to reattach to base address", err);
return ALLOC_FAILURE;
@@ -210,7 +210,7 @@ static int zend_shared_alloc_reattach(size_t requested_size, char **error_in)
static int create_segments(size_t requested_size, zend_shared_segment ***shared_segments_p, int *shared_segments_count, char **error_in)
{
int err = 0, ret;
int err, ret;
zend_shared_segment *shared_segment;
int map_retries = 0;
void *default_mapping_base_set[] = { 0, 0 };
@@ -232,14 +232,14 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
and we have to sleep some time (until the child releases the mapping object) and retry.*/
do {
memfile = OpenFileMapping(FILE_MAP_WRITE, 0, create_name_with_username(ACCEL_FILEMAP_NAME));
err = GetLastError();
if (memfile == NULL) {
err = GetLastError();
break;
}
ret = zend_shared_alloc_reattach(requested_size, error_in);
err = GetLastError();
if (ret == ALLOC_FAIL_MAPPING) {
err = GetLastError();
/* Mapping failed, wait for mapping object to get freed and retry */
CloseHandle(memfile);
memfile = NULL;
@@ -266,9 +266,8 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
*shared_segments_count = 1;
*shared_segments_p = (zend_shared_segment **) calloc(1, sizeof(zend_shared_segment)+sizeof(void *));
if (!*shared_segments_p) {
err = GetLastError();
zend_shared_alloc_unlock_win32();
zend_win_error_message(ACCEL_LOG_FATAL, "calloc() failed", err);
zend_win_error_message(ACCEL_LOG_FATAL, "calloc() failed", GetLastError());
*error_in = "calloc";
return ALLOC_FAILURE;
}
@@ -277,8 +276,8 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
memfile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, requested_size,
create_name_with_username(ACCEL_FILEMAP_NAME));
err = GetLastError();
if (memfile == NULL) {
err = GetLastError();
zend_shared_alloc_unlock_win32();
zend_win_error_message(ACCEL_LOG_FATAL, "Unable to create file mapping", err);
*error_in = "CreateFileMapping";
@@ -312,8 +311,8 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
wanted_mapping_base++;
} while (!mapping_base);
err = GetLastError();
if (mapping_base == NULL) {
err = GetLastError();
zend_shared_alloc_unlock_win32();
zend_win_error_message(ACCEL_LOG_FATAL, "Unable to create view for file mapping", err);
*error_in = "MapViewOfFile";
@@ -321,8 +320,8 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
} else {
char *mmap_base_file = get_mmap_base_file();
FILE *fp = fopen(mmap_base_file, "w");
err = GetLastError();
if (!fp) {
err = GetLastError();
zend_shared_alloc_unlock_win32();
zend_win_error_message(ACCEL_LOG_WARNING, mmap_base_file, err);
zend_win_error_message(ACCEL_LOG_FATAL, "Unable to write base address", err);
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Bug #74431 - foreach infinite loop
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=0xffffffff
--FILE--
<?php
function test(){
$arr = [1,2];
$j = 0;
$cond = true;
foreach ($arr as $i => $v){
while(1){
if($cond){
break;
}
}
$j++;
echo $j."\n";
if ($j>10) break;
}
}
test();
?>
--EXPECT--
1
2
-39
View File
@@ -1,39 +0,0 @@
--TEST--
Bug #74442: Opcached version produces a nested array
--CREDITS--
Eric Norris <erictnorris@gmail.com>
--FILE--
<?php
class Schema_Base {
public function addField($typeclass, array $params = null) {
$field = new $typeclass($params);
return $field;
}
}
class Field_Base {
public function __construct(array $params = null) {
if (! is_array($params)) {
$params = (array) $params;
}
call_user_func_array(array($this, 'acceptParams'), $params);
}
}
class Field_Integer extends Field_Base {
protected function acceptParams($bytes = 4) {
echo print_r($bytes, true);
}
}
try {
$schema = new Schema_Base;
$schema->addField('Field_Integer');
} catch (Throwable $ex) {
echo "CAUGHT EXCEPTION";
echo (string)$ex;
}
?>
--EXPECT--
4
-24
View File
@@ -1,24 +0,0 @@
--TEST--
Bug #74456 (Segmentation error while running a script in CLI mode)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
function small_numbers() {
return [0,1,2];
}
list ($zero, $one, $two) = small_numbers();
var_dump($zero, $one, $two);
?>
--EXPECT--
int(0)
int(1)
int(2)
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Edge-cases in elimination of JMPZ JMP with same target
--FILE--
<?php
$foo = "foo";
if ($foo . "bar") { goto label; }
label:
if ($undef) { goto label2; }
label2:
echo "done\n";
?>
--EXPECTF--
Notice: Undefined variable: undef in %s on line %d
done
@@ -1,14 +0,0 @@
--TEST--
Literal compaction should take method calls on literals into account
--FILE--
<?php
try {
(42)->foo();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Call to a member function foo() on integer
-35
View File
@@ -359,25 +359,6 @@ static void zend_file_cache_serialize_op_array(zend_op_array *op_arra
zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_zval);
}
if (op_array->scope && !IS_SERIALIZED(op_array->opcodes)) {
if (UNEXPECTED(zend_shared_alloc_get_xlat_entry(op_array->opcodes))) {
op_array->refcount = (uint32_t*)(intptr_t)-1;
SERIALIZE_PTR(op_array->literals);
SERIALIZE_PTR(op_array->opcodes);
SERIALIZE_PTR(op_array->arg_info);
SERIALIZE_PTR(op_array->vars);
SERIALIZE_STR(op_array->function_name);
SERIALIZE_STR(op_array->filename);
SERIALIZE_PTR(op_array->live_range);
SERIALIZE_PTR(op_array->scope);
SERIALIZE_STR(op_array->doc_comment);
SERIALIZE_PTR(op_array->try_catch_array);
SERIALIZE_PTR(op_array->prototype);
return;
}
zend_shared_alloc_register_xlat_entry(op_array->opcodes, op_array->opcodes);
}
if (op_array->literals && !IS_SERIALIZED(op_array->literals)) {
zval *p, *end;
@@ -956,22 +937,6 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR);
}
if (op_array->refcount) {
op_array->refcount = NULL;
UNSERIALIZE_PTR(op_array->literals);
UNSERIALIZE_PTR(op_array->opcodes);
UNSERIALIZE_PTR(op_array->arg_info);
UNSERIALIZE_PTR(op_array->vars);
UNSERIALIZE_STR(op_array->function_name);
UNSERIALIZE_STR(op_array->filename);
UNSERIALIZE_PTR(op_array->live_range);
UNSERIALIZE_PTR(op_array->scope);
UNSERIALIZE_STR(op_array->doc_comment);
UNSERIALIZE_PTR(op_array->try_catch_array);
UNSERIALIZE_PTR(op_array->prototype);
return;
}
if (op_array->literals && !IS_UNSERIALIZED(op_array->literals)) {
zval *p, *end;
+1 -1
View File
@@ -1,7 +1,7 @@
// $Id$
// vim:ft=javascript
ARG_WITH("openssl", "OpenSSL support", "no,shared");
ARG_WITH("openssl", "OpenSSL support", "no");
if (PHP_OPENSSL != "no") {
var ret = SETUP_OPENSSL("openssl", PHP_OPENSSL);
+48 -79
View File
@@ -811,9 +811,7 @@ struct php_x509_request { /* {{{ */
/* }}} */
static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_resource **resourceval);
static EVP_PKEY * php_openssl_evp_from_zval(
zval * val, int public_key, char *passphrase, size_t passphrase_len,
int makeresource, zend_resource **resourceval);
static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * passphrase, int makeresource, zend_resource **resourceval);
static int php_openssl_is_private_key(EVP_PKEY* pkey);
static X509_STORE * setup_verify(zval * calist);
static STACK_OF(X509) * load_all_certs_from_file(char *certfile);
@@ -912,26 +910,23 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
char * strbuf;
char * thestr;
long gmadjust = 0;
size_t timestr_len;
if (ASN1_STRING_type(timestr) != V_ASN1_UTCTIME && ASN1_STRING_type(timestr) != V_ASN1_GENERALIZEDTIME) {
php_error_docref(NULL, E_WARNING, "illegal ASN1 data type for timestamp");
return (time_t)-1;
}
timestr_len = (size_t)ASN1_STRING_length(timestr);
if (timestr_len != strlen((const char*)ASN1_STRING_data(timestr))) {
if ((size_t)ASN1_STRING_length(timestr) != strlen((const char*)ASN1_STRING_data(timestr))) {
php_error_docref(NULL, E_WARNING, "illegal length in timestamp");
return (time_t)-1;
}
if (timestr_len < 13 && timestr_len != 11) {
if (ASN1_STRING_length(timestr) < 13) {
php_error_docref(NULL, E_WARNING, "unable to parse time string %s correctly", timestr->data);
return (time_t)-1;
}
if (ASN1_STRING_type(timestr) == V_ASN1_GENERALIZEDTIME && timestr_len < 15) {
if (ASN1_STRING_type(timestr) == V_ASN1_GENERALIZEDTIME && ASN1_STRING_length(timestr) < 15) {
php_error_docref(NULL, E_WARNING, "unable to parse time string %s correctly", timestr->data);
return (time_t)-1;
}
@@ -942,15 +937,11 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
/* we work backwards so that we can use atoi more easily */
thestr = strbuf + timestr_len - 3;
thestr = strbuf + ASN1_STRING_length(timestr) - 3;
if (timestr_len == 11) {
thetime.tm_sec = 0;
} else {
thetime.tm_sec = atoi(thestr);
*thestr = '\0';
thestr -= 2;
}
thetime.tm_sec = atoi(thestr);
*thestr = '\0';
thestr -= 2;
thetime.tm_min = atoi(thestr);
*thestr = '\0';
thestr -= 2;
@@ -987,7 +978,7 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
** the value of timezone - 3600 seconds. Otherwise, we need to overcorrect and
** set the adjustment to the main timezone + 3600 seconds.
*/
gmadjust = -(thetime.tm_isdst ? (long)timezone - 3600 : (long)timezone);
gmadjust = -(thetime.tm_isdst ? (long)timezone - 3600 : (long)timezone + 3600);
#endif
ret += gmadjust;
@@ -1786,8 +1777,7 @@ PHP_FUNCTION(openssl_spki_new)
}
RETVAL_FALSE;
PHP_OPENSSL_CHECK_SIZE_T_TO_INT(challenge_len, challenge);
pkey = php_openssl_evp_from_zval(zpkey, 0, challenge, challenge_len, 1, &keyresource);
pkey = php_openssl_evp_from_zval(zpkey, 0, challenge, 1, &keyresource);
if (pkey == NULL) {
php_error_docref(NULL, E_WARNING, "Unable to use supplied private key");
@@ -2183,7 +2173,7 @@ PHP_FUNCTION(openssl_x509_check_private_key)
if (cert == NULL) {
RETURN_FALSE;
}
key = php_openssl_evp_from_zval(zkey, 0, "", 0, 1, &keyresource);
key = php_openssl_evp_from_zval(zkey, 0, "", 1, &keyresource);
if (key) {
RETVAL_BOOL(X509_check_private_key(cert, key));
}
@@ -2772,7 +2762,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
}
priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 0, 1, &keyresource);
priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource);
if (priv_key == NULL) {
php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3");
goto cleanup;
@@ -2859,7 +2849,7 @@ PHP_FUNCTION(openssl_pkcs12_export)
php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
}
priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 0, 1, &keyresource);
priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource);
if (priv_key == NULL) {
php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3");
goto cleanup;
@@ -3364,7 +3354,7 @@ PHP_FUNCTION(openssl_csr_sign)
goto cleanup;
}
}
priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 0, 1, &keyresource);
priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource);
if (priv_key == NULL) {
php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3");
goto cleanup;
@@ -3497,7 +3487,7 @@ PHP_FUNCTION(openssl_csr_new)
if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS) {
/* Generate or use a private key */
if (Z_TYPE_P(out_pkey) != IS_NULL) {
req.priv_key = php_openssl_evp_from_zval(out_pkey, 0, NULL, 0, 0, &key_resource);
req.priv_key = php_openssl_evp_from_zval(out_pkey, 0, NULL, 0, &key_resource);
if (req.priv_key != NULL) {
we_made_the_key = 0;
}
@@ -3640,27 +3630,6 @@ PHP_FUNCTION(openssl_csr_get_public_key)
/* {{{ EVP Public/Private key functions */
struct php_openssl_pem_password {
char *key;
int len;
};
/* {{{ php_openssl_pem_password_cb */
static int php_openssl_pem_password_cb(char *buf, int size, int rwflag, void *userdata)
{
struct php_openssl_pem_password *password = userdata;
if (password == NULL || password->key == NULL) {
return -1;
}
size = (password->len > size) ? size : password->len;
memcpy(buf, password->key, size);
return size;
}
/* }}} */
/* {{{ php_openssl_evp_from_zval
Given a zval, coerce it into a EVP_PKEY object.
It can be:
@@ -3674,9 +3643,7 @@ static int php_openssl_pem_password_cb(char *buf, int size, int rwflag, void *us
empty string rather than NULL for the passphrase - NULL causes a passphrase prompt to be emitted in
the Apache error log!
*/
static EVP_PKEY * php_openssl_evp_from_zval(
zval * val, int public_key, char *passphrase, size_t passphrase_len,
int makeresource, zend_resource **resourceval)
static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * passphrase, int makeresource, zend_resource **resourceval)
{
EVP_PKEY * key = NULL;
X509 * cert = NULL;
@@ -3708,12 +3675,10 @@ static EVP_PKEY * php_openssl_evp_from_zval(
if (Z_TYPE_P(zphrase) == IS_STRING) {
passphrase = Z_STRVAL_P(zphrase);
passphrase_len = Z_STRLEN_P(zphrase);
} else {
ZVAL_COPY(&tmp, zphrase);
convert_to_string(&tmp);
passphrase = Z_STRVAL(tmp);
passphrase_len = Z_STRLEN(tmp);
}
/* now set val to be the key param and continue */
@@ -3813,14 +3778,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(
if (in == NULL) {
TMP_CLEAN;
}
if (passphrase == NULL) {
key = PEM_read_bio_PrivateKey(in, NULL, NULL, NULL);
} else {
struct php_openssl_pem_password password;
password.key = passphrase;
password.len = passphrase_len;
key = PEM_read_bio_PrivateKey(in, NULL, php_openssl_pem_password_cb, &password);
}
key = PEM_read_bio_PrivateKey(in, NULL,NULL, passphrase);
BIO_free(in);
}
}
@@ -3905,8 +3863,13 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req
case OPENSSL_KEYTYPE_DSA:
PHP_OPENSSL_RAND_ADD_TIME();
{
DSA *dsaparam = DSA_new();
if (dsaparam && DSA_generate_parameters_ex(dsaparam, req->priv_key_bits, NULL, 0, NULL, NULL, NULL)) {
DSA *dsaparam = NULL;
#if OPENSSL_VERSION_NUMBER < 0x10002000L
dsaparam = DSA_generate_parameters(req->priv_key_bits, NULL, 0, NULL, NULL, NULL, NULL);
#else
DSA_generate_parameters_ex(dsaparam, req->priv_key_bits, NULL, 0, NULL, NULL, NULL);
#endif
if (dsaparam) {
DSA_set_method(dsaparam, DSA_get_default_method());
if (DSA_generate_key(dsaparam)) {
if (EVP_PKEY_assign_DSA(req->priv_key, dsaparam)) {
@@ -3929,8 +3892,13 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req
PHP_OPENSSL_RAND_ADD_TIME();
{
int codes = 0;
DH *dhparam = DH_new();
if (dhparam && DH_generate_parameters_ex(dhparam, req->priv_key_bits, 2, NULL)) {
DH *dhparam = NULL;
#if OPENSSL_VERSION_NUMBER < 0x10002000L
dhparam = DH_generate_parameters(req->priv_key_bits, 2, NULL, NULL);
#else
DH_generate_parameters_ex(dhparam, req->priv_key_bits, 2, NULL);
#endif
if (dhparam) {
DH_set_method(dhparam, DH_get_default_method());
if (DH_check(dhparam, &codes) && codes == 0 && DH_generate_key(dhparam)) {
if (EVP_PKEY_assign_DH(req->priv_key, dhparam)) {
@@ -4468,7 +4436,8 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
RETVAL_FALSE;
PHP_OPENSSL_CHECK_SIZE_T_TO_INT(passphrase_len, passphrase);
key = php_openssl_evp_from_zval(zpkey, 0, passphrase, passphrase_len, 0, &key_resource);
key = php_openssl_evp_from_zval(zpkey, 0, passphrase, 0, &key_resource);
if (key == NULL) {
php_error_docref(NULL, E_WARNING, "cannot get key from parameter 1");
@@ -4549,7 +4518,8 @@ PHP_FUNCTION(openssl_pkey_export)
RETVAL_FALSE;
PHP_OPENSSL_CHECK_SIZE_T_TO_INT(passphrase_len, passphrase);
key = php_openssl_evp_from_zval(zpkey, 0, passphrase, passphrase_len, 0, &key_resource);
key = php_openssl_evp_from_zval(zpkey, 0, passphrase, 0, &key_resource);
if (key == NULL) {
php_error_docref(NULL, E_WARNING, "cannot get key from parameter 1");
@@ -4619,7 +4589,7 @@ PHP_FUNCTION(openssl_pkey_get_public)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) {
return;
}
pkey = php_openssl_evp_from_zval(cert, 1, NULL, 0, 1, &res);
pkey = php_openssl_evp_from_zval(cert, 1, NULL, 1, &res);
if (pkey == NULL) {
RETURN_FALSE;
}
@@ -4658,9 +4628,7 @@ PHP_FUNCTION(openssl_pkey_get_private)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s", &cert, &passphrase, &passphrase_len) == FAILURE) {
return;
}
PHP_OPENSSL_CHECK_SIZE_T_TO_INT(passphrase_len, passphrase);
pkey = php_openssl_evp_from_zval(cert, 0, passphrase, passphrase_len, 1, &res);
pkey = php_openssl_evp_from_zval(cert, 0, passphrase, 1, &res);
if (pkey == NULL) {
RETURN_FALSE;
@@ -5252,7 +5220,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
}
}
privkey = php_openssl_evp_from_zval(zprivkey, 0, "", 0, 0, &keyresource);
privkey = php_openssl_evp_from_zval(zprivkey, 0, "", 0, &keyresource);
if (privkey == NULL) {
php_error_docref(NULL, E_WARNING, "error getting private key");
goto clean_exit;
@@ -5361,7 +5329,7 @@ PHP_FUNCTION(openssl_pkcs7_decrypt)
goto clean_exit;
}
key = php_openssl_evp_from_zval(recipkey ? recipkey : recipcert, 0, "", 0, 0, &keyresval);
key = php_openssl_evp_from_zval(recipkey ? recipkey : recipcert, 0, "", 0, &keyresval);
if (key == NULL) {
php_error_docref(NULL, E_WARNING, "unable to get private key");
goto clean_exit;
@@ -5428,7 +5396,7 @@ PHP_FUNCTION(openssl_private_encrypt)
}
RETVAL_FALSE;
pkey = php_openssl_evp_from_zval(key, 0, "", 0, 0, &keyresource);
pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource);
if (pkey == NULL) {
php_error_docref(NULL, E_WARNING, "key param is not a valid private key");
@@ -5491,7 +5459,7 @@ PHP_FUNCTION(openssl_private_decrypt)
}
RETVAL_FALSE;
pkey = php_openssl_evp_from_zval(key, 0, "", 0, 0, &keyresource);
pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource);
if (pkey == NULL) {
php_error_docref(NULL, E_WARNING, "key parameter is not a valid private key");
RETURN_FALSE;
@@ -5559,7 +5527,7 @@ PHP_FUNCTION(openssl_public_encrypt)
return;
RETVAL_FALSE;
pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, 0, &keyresource);
pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource);
if (pkey == NULL) {
php_error_docref(NULL, E_WARNING, "key parameter is not a valid public key");
RETURN_FALSE;
@@ -5622,7 +5590,7 @@ PHP_FUNCTION(openssl_public_decrypt)
}
RETVAL_FALSE;
pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, 0, &keyresource);
pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource);
if (pkey == NULL) {
php_error_docref(NULL, E_WARNING, "key parameter is not a valid public key");
RETURN_FALSE;
@@ -5722,7 +5690,7 @@ PHP_FUNCTION(openssl_sign)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z|z", &data, &data_len, &signature, &key, &method) == FAILURE) {
return;
}
pkey = php_openssl_evp_from_zval(key, 0, "", 0, 0, &keyresource);
pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource);
if (pkey == NULL) {
php_error_docref(NULL, E_WARNING, "supplied key param cannot be coerced into a private key");
RETURN_FALSE;
@@ -5808,7 +5776,7 @@ PHP_FUNCTION(openssl_verify)
RETURN_FALSE;
}
pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, 0, &keyresource);
pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource);
if (pkey == NULL) {
php_error_docref(NULL, E_WARNING, "supplied key param cannot be coerced into a public key");
RETURN_FALSE;
@@ -5888,7 +5856,7 @@ PHP_FUNCTION(openssl_seal)
/* get the public keys we are using to seal this data */
i = 0;
ZEND_HASH_FOREACH_VAL(pubkeysht, pubkey) {
pkeys[i] = php_openssl_evp_from_zval(pubkey, 1, NULL, 0, 0, &key_resources[i]);
pkeys[i] = php_openssl_evp_from_zval(pubkey, 1, NULL, 0, &key_resources[i]);
if (pkeys[i] == NULL) {
php_error_docref(NULL, E_WARNING, "not a public key (%dth member of pubkeys)", i+1);
RETVAL_FALSE;
@@ -5922,6 +5890,7 @@ PHP_FUNCTION(openssl_seal)
if (len1 + len2 > 0) {
zval_dtor(sealdata);
buf[len1 + len2] = '\0';
ZVAL_NEW_STR(sealdata, zend_string_init((char*)buf, len1 + len2, 0));
efree(buf);
@@ -5984,7 +5953,7 @@ PHP_FUNCTION(openssl_open)
return;
}
pkey = php_openssl_evp_from_zval(privkey, 0, "", 0, 0, &keyresource);
pkey = php_openssl_evp_from_zval(privkey, 0, "", 0, &keyresource);
if (pkey == NULL) {
php_error_docref(NULL, E_WARNING, "unable to coerce parameter 4 into a private key");
RETURN_FALSE;
Loaded 100 of 179 files, more files were not shown because too many files have changed in this diff. Show more