mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-15 21:16:38 +00:00
Compare commits
63
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f535ab2c62 | ||
|
|
e95f0a0058 | ||
|
|
7db52b84b7 | ||
|
|
c5903bd6ab | ||
|
|
6788dcf3bc | ||
|
|
da3fad6285 | ||
|
|
ba9cdc0ad1 | ||
|
|
b764a1a782 | ||
|
|
98d0c1fade | ||
|
|
80e1950121 | ||
|
|
eb829c6bbc | ||
|
|
e808403250 | ||
|
|
013c7f1f92 | ||
|
|
cc96a72170 | ||
|
|
df22f1e09a | ||
|
|
56fcbaa848 | ||
|
|
0d4da18bdd | ||
|
|
7d8db13f39 | ||
|
|
ccd4958088 | ||
|
|
a44816ed09 | ||
|
|
63a6a6ee56 | ||
|
|
f456fffe04 | ||
|
|
d87c493722 | ||
|
|
69084a71a6 | ||
|
|
c243cd8610 | ||
|
|
9ca087df12 | ||
|
|
488cd17ff5 | ||
|
|
ef65c8ca60 | ||
|
|
c2724d08fb | ||
|
|
af6d9528ce | ||
|
|
59596a527c | ||
|
|
fb8c6db95a | ||
|
|
1557e35034 | ||
|
|
17eb9361e1 | ||
|
|
c2d0db2a3a | ||
|
|
87a91cb7b6 | ||
|
|
2dc6d844ef | ||
|
|
46a6126e34 | ||
|
|
afeef64609 | ||
|
|
d719c020e6 | ||
|
|
d9e457bbad | ||
|
|
921ea6a428 | ||
|
|
519e4c1158 | ||
|
|
2a9bb86383 | ||
|
|
a19fb50fd6 | ||
|
|
120b469bb4 | ||
|
|
49cf106aa4 | ||
|
|
5ee54f12af | ||
|
|
c752e95c36 | ||
|
|
3b4540f926 | ||
|
|
0cb1a19851 | ||
|
|
54f742e30d | ||
|
|
6d3be89192 | ||
|
|
8d06c2cf2a | ||
|
|
99afacffcd | ||
|
|
09f6582694 | ||
|
|
300f28b58e | ||
|
|
fcc80dcb86 | ||
|
|
0136b5cec6 | ||
|
|
79f0466eff | ||
|
|
ac2a97209b | ||
|
|
c940701612 | ||
|
|
f492ccfec6 |
No files matched your search
@@ -1,6 +1,6 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
02 Feb 2009, PHP 5.2.9RC1
|
||||
26 Feb 2009, PHP 5.2.9
|
||||
- Changed __call() to be invoked on private/protected method access, similar to
|
||||
properties and __get(). (Andrei)
|
||||
|
||||
@@ -19,11 +19,17 @@ PHP NEWS
|
||||
- Fixed bug in xml_error_string() which resulted in messages being
|
||||
off by one. (Scott)
|
||||
|
||||
- Fixed bug #47422 (modulus operator returns incorrect results on 64 bit
|
||||
linux). (Matt)
|
||||
- Fixed bug #47399 (mb_check_encoding() returns true for some illegal SJIS
|
||||
characters). (for-bugs at hnw dot jp, Moriyoshi)
|
||||
- Fixed bug #47353 (crash when creating a lot of objects in object
|
||||
destructor). (Tony)
|
||||
- Fixed bug #47322 (sscanf %d doesn't work). (Felipe)
|
||||
- Fixed bug #47282 (FILTER_VALIDATE_EMAIL is marking valid email addresses
|
||||
as invalid). (Ilia)
|
||||
- Fixed bug #47220 (segfault in dom_document_parser in recovery mode). (Rob)
|
||||
- Fixed bug #47217 (content-type is not set properly for file uploads).
|
||||
(Ilia)
|
||||
- Fixed bug #47217 (content-type is not set properly for file uploads). (Ilia)
|
||||
- Fixed bug #47174 (base64_decode() interprets pad char in mid string as
|
||||
terminator). (Ilia)
|
||||
- Fixed bug #47165 (Possible memory corruption when passing return value by
|
||||
@@ -31,52 +37,66 @@ PHP NEWS
|
||||
- Fixed bug #47152 (gzseek/fseek using SEEK_END produces strange results).
|
||||
(Felipe)
|
||||
- Fixed bug #47131 (SOAP Extension ignores "user_agent" ini setting). (Ilia)
|
||||
- Fixed bug #47104 (Linking shared extensions fails with icc). (Jani)
|
||||
- Fixed bug #47109 (Memory leak on $a->{"a"."b"} when $a is not an object).
|
||||
(Etienne, Dmitry)
|
||||
- Fixed bug #47104 (Linking shared extensions fails with icc). (Jani)
|
||||
- Fixed bug #47049 (SoapClient::__soapCall causes a segmentation fault).
|
||||
(Dmitry)
|
||||
- Fixed bug #47048 (Segfault with new pg_meta_data). (Felipe)
|
||||
- Fixed bug #47042 (PHP cgi sapi is removing SCRIPT_FILENAME for non apache).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #47037 (No error when using fopen with empty string).
|
||||
(Cristian Rodriguez R., Felipe)
|
||||
- Fixed bug #47035 (dns_get_record returns a garbage byte at the end of a TXT
|
||||
record). (Felipe)
|
||||
- Fixed bug #47042 (PHP cgi sapi is removing SCRIPT_FILENAME for non
|
||||
apache). (Sriram Natarajan)
|
||||
- Fixed bug #47037 (No error when using fopen with empty string). (Cristian
|
||||
Rodriguez R., Felipe)
|
||||
- Fixed bug #47035 (dns_get_record returns a garbage byte at the end of a
|
||||
TXT record). (Felipe)
|
||||
- Fixed bug #47027 (var_export doesn't show numeric indices on ArrayObject).
|
||||
(Derick)
|
||||
- Fixed bug #46985 (OVERWRITE and binary mode does not work, regression introduced in
|
||||
5.2.8). (Pierre)
|
||||
- Fixed bug #46985 (OVERWRITE and binary mode does not work, regression
|
||||
introduced in 5.2.8). (Pierre)
|
||||
- Fixed bug #46973 (IPv6 address filter rejects valid address). (Felipe)
|
||||
- Fixed bug #46964 (Fixed pdo_mysql build with older version of MySQL). (Ilia)
|
||||
- Fixed bug #46959 (Unable to disable PCRE). (Scott)
|
||||
- Fixed bug #46918 (imap_rfc822_parse_adrlist host part not filled in correctly).
|
||||
(Felipe)
|
||||
- Fixed bug #46918 (imap_rfc822_parse_adrlist host part not filled in
|
||||
correctly). (Felipe)
|
||||
- Fixed bug #46889 (Memory leak in strtotime()). (Derick)
|
||||
- Fixed bug #46887 (Invalid calls to php_error_docref()).
|
||||
(oeriksson at mandriva dot com, Ilia)
|
||||
- Fixed bug #46887 (Invalid calls to php_error_docref()). (oeriksson at
|
||||
mandriva dot com, Ilia)
|
||||
- Fixed bug #46873 (extract($foo) crashes if $foo['foo'] exists). (Arnaud)
|
||||
- Fixed bug #46843 (CP936 euro symbol is not converted properly). (Moriyoshi)
|
||||
- Fixed bug #46843 (CP936 euro symbol is not converted properly). (ty_c at
|
||||
cybozuy dot co dot jp, Moriyoshi)
|
||||
- Fixed bug #46798 (Crash in mssql extension when retrieving a NULL value
|
||||
inside a binary or image column type). (Ilia)
|
||||
- Fixed bug #46782 (fastcgi.c parse error). (Matt)
|
||||
- Fixed bug #46760 (SoapClient doRequest fails when proxy is used). (Felipe)
|
||||
- Fixed bug #46748 (Segfault when an SSL error has more than one error). (Scott)
|
||||
- Fixed bug #46739 (array returned by curl_getinfo should contain content_type key).
|
||||
(Mikko)
|
||||
- Fixed bug #46701 (Creating associative array with long values in the key fails
|
||||
on 32bit linux). (Shire)
|
||||
- Fixed bug #46748 (Segfault when an SSL error has more than one error).
|
||||
(Scott)
|
||||
- Fixed bug #46739 (array returned by curl_getinfo should contain
|
||||
content_type key). (Mikko)
|
||||
- Fixed bug #46699 (xml_parse crash when parser is namespace aware). (Rob)
|
||||
- Fixed bug #46419 (Elements of associative arrays with NULL value are lost).
|
||||
(Dmitry)
|
||||
- Fixed bug #46419 (Elements of associative arrays with NULL value are
|
||||
lost). (Dmitry)
|
||||
- Fixed bug #46282 (Corrupt DBF When Using DATE). (arne at bukkie dot nl)
|
||||
- Fixed bug #46005 (User not consistently logged under Apache2).
|
||||
(admorten at umich dot edu, Stas)
|
||||
- Fixed bug #45996 (libxml2 2.7 causes breakage with character data
|
||||
in xml_parse()). (Rob)
|
||||
- Fixed bug #46026 (bz2.decompress/zlib.inflate filter tries to decompress
|
||||
after end of stream). (Greg)
|
||||
- Fixed bug #46005 (User not consistently logged under Apache2). (admorten
|
||||
at umich dot edu, Stas)
|
||||
- Fixed bug #45996 (libxml2 2.7 causes breakage with character data in
|
||||
xml_parse()). (Rob)
|
||||
- Fixed bug #45940 (MySQLI OO does not populate connect_error property on
|
||||
failed connect). (Johannes)
|
||||
- Fixed bug #45923 (mb_st[r]ripos() offset not handled correctly). (Moriyoshi)
|
||||
- Fixed bug #45327 (memory leak if offsetGet throws exception). (Greg)
|
||||
- Fixed bug #45239 (Encoding detector hangs with mbstring.strict_detection
|
||||
enabled). (Moriyoshi)
|
||||
- Fixed bug #45161 (Reusing a curl handle leaks memory). (Mark Karpeles, Jani)
|
||||
- Fixed bug #44336 (Improve pcre UTF-8 string matching performance).
|
||||
(frode at coretrek dot com, Nuno)
|
||||
- Fixed bug #35975 (Session cookie expires date format isn't the most compatible.
|
||||
Now matches that of setcookie()). (Scott)
|
||||
- Fixed bug #44336 (Improve pcre UTF-8 string matching performance). (frode
|
||||
at coretrek dot com, Nuno)
|
||||
- Fixed bug #43841 (mb_strrpos() offset is byte count for negative values).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #37209 (mssql_execute with non fatal errors). (Kalle)
|
||||
- Fixed bug #35975 (Session cookie expires date format isn't the most
|
||||
compatible. Now matches that of setcookie()). (Scott)
|
||||
|
||||
|
||||
08 Dec 2008, PHP 5.2.8
|
||||
- Reverted bug fix #42718 that broke magic_quotes_gpc (Scott)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4"
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Bug #45805 (Crash on throwing exception from error handler)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
<?php if (!extension_loaded('reflection') || !extension_loaded('spl')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class PHPUnit_Util_ErrorHandler
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Bug #46701 (Creating associative array with long values in the key fails on 32bit linux)
|
||||
--SKIPIF--
|
||||
<?php if (PHP_INT_MAX != 4) die('skip this test is for 32bit platforms only'); ?>
|
||||
<?php if (PHP_INT_SIZE != 4) die('skip this test is for 32bit platforms only'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -27,16 +27,12 @@ new foo;
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[-866368000]=>
|
||||
int(1)
|
||||
[-835511808]=>
|
||||
int(2)
|
||||
[-835350528]=>
|
||||
int(3)
|
||||
}
|
||||
int(2)
|
||||
array(1) {
|
||||
[-835350528]=>
|
||||
[-2147483648]=>
|
||||
int(3)
|
||||
}
|
||||
int(3)
|
||||
array(1) {
|
||||
[-2147483648]=>
|
||||
int(3)
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #47353 (crash when creating a lot of objects in object destructor)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A
|
||||
{
|
||||
function __destruct()
|
||||
{
|
||||
$myArray = array();
|
||||
|
||||
for($i = 1; $i <= 3000; $i++) {
|
||||
if(!isset($myArray[$i]))
|
||||
$myArray[$i] = array();
|
||||
$ref = & $myArray[$i];
|
||||
$ref[] = new stdClass();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Done
|
||||
+1
-1
@@ -979,7 +979,7 @@ fetch_string_dim:
|
||||
long index;
|
||||
|
||||
if (Z_TYPE_P(dim) == IS_DOUBLE) {
|
||||
DVAL_TO_LVAL(Z_DVAL_P(dim), index);
|
||||
index = (long)Z_DVAL_P(dim);
|
||||
} else {
|
||||
index = Z_LVAL_P(dim);
|
||||
}
|
||||
|
||||
@@ -472,6 +472,10 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (EG(exception)) {
|
||||
zval_ptr_dtor(&retval);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Undo PZVAL_LOCK() */
|
||||
retval->refcount--;
|
||||
|
||||
@@ -55,6 +55,7 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
|
||||
if (obj->dtor && obj->object) {
|
||||
obj->refcount++;
|
||||
obj->dtor(obj->object, i TSRMLS_CC);
|
||||
obj = &objects->object_buckets[i].bucket.obj;
|
||||
obj->refcount--;
|
||||
}
|
||||
}
|
||||
@@ -200,6 +201,10 @@ ZEND_API void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSR
|
||||
} zend_end_try();
|
||||
}
|
||||
}
|
||||
|
||||
/* re-read the object from the object store as the store might have been reallocated in the dtor */
|
||||
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
|
||||
|
||||
if (obj->refcount == 1) {
|
||||
if (obj->free_storage) {
|
||||
zend_try {
|
||||
@@ -241,6 +246,7 @@ ZEND_API zend_object_value zend_objects_store_clone_obj(zval *zobject TSRMLS_DC)
|
||||
}
|
||||
|
||||
obj->clone(obj->object, &new_object TSRMLS_CC);
|
||||
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
|
||||
|
||||
retval.handle = zend_objects_store_put(new_object, obj->dtor, obj->free_storage, obj->clone TSRMLS_CC);
|
||||
retval.handlers = Z_OBJ_HT_P(zobject);
|
||||
|
||||
+18
-1
@@ -186,6 +186,22 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
|
||||
} \
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
# define DVAL_TO_LVAL(d, l) \
|
||||
if ((d) > LONG_MAX) { \
|
||||
(l) = (long)(unsigned long)(__int64) (d); \
|
||||
} else { \
|
||||
(l) = (long) (d); \
|
||||
}
|
||||
#else
|
||||
# define DVAL_TO_LVAL(d, l) \
|
||||
if ((d) > LONG_MAX) { \
|
||||
(l) = (unsigned long) (d); \
|
||||
} else { \
|
||||
(l) = (long) (d); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define zendi_convert_to_long(op, holder, result) \
|
||||
if (op == result) { \
|
||||
convert_to_long(op); \
|
||||
@@ -920,7 +936,8 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
return FAILURE; /* modulus by zero */
|
||||
}
|
||||
|
||||
if (abs(op2->value.lval) == 1) {
|
||||
if (op2->value.lval == -1) {
|
||||
/* Prevent overflow error/crash if op1==LONG_MIN */
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -75,22 +75,6 @@ ZEND_API zend_bool instanceof_function_ex(zend_class_entry *instance_ce, zend_cl
|
||||
ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC);
|
||||
END_EXTERN_C()
|
||||
|
||||
#ifdef _WIN64
|
||||
# define DVAL_TO_LVAL(d, l) \
|
||||
if ((d) > LONG_MAX) { \
|
||||
(l) = (long)(unsigned long)(__int64) (d); \
|
||||
} else { \
|
||||
(l) = (long) (d); \
|
||||
}
|
||||
#else
|
||||
# define DVAL_TO_LVAL(d, l) \
|
||||
if ((d) > LONG_MAX) { \
|
||||
(l) = (unsigned long) (d); \
|
||||
} else { \
|
||||
(l) = (long) (d); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define ZEND_IS_DIGIT(c) ((c) >= '0' && (c) <= '9')
|
||||
#define ZEND_IS_XDIGIT(c) (((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f'))
|
||||
|
||||
|
||||
+1
-3
@@ -2726,11 +2726,9 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUS
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
|
||||
+20
-60
@@ -2810,11 +2810,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -3171,11 +3169,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -3532,11 +3528,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -3627,11 +3621,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -3987,11 +3979,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -5450,11 +5440,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -5897,11 +5885,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -6344,11 +6330,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -6439,11 +6423,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_AR
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -6883,11 +6865,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -9535,11 +9515,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -11058,11 +11036,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -12629,11 +12605,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -13340,11 +13314,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_AR
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -14643,11 +14615,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -21699,11 +21669,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -23214,11 +23182,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -24776,11 +24742,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -25482,11 +25446,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
@@ -26780,11 +26742,9 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
long l;
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
DVAL_TO_LVAL(Z_DVAL_P(offset), l);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
|
||||
+4
-4
@@ -42,7 +42,7 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=9
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
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`
|
||||
|
||||
@@ -1284,9 +1284,9 @@ if test "$PHP_THREAD_SAFETY" = "yes" && test "$PHP_MYSQL" = "yes"; then
|
||||
CPPFLAGS="$CPPFLAGS -DTHREAD=1"
|
||||
fi
|
||||
|
||||
if test "$PHP_DEBUG" = "yes" && test "$PHP_THREAD_SAFETY" = "yes"; then
|
||||
if test "$PHP_DEBUG" = "1" && test "$PHP_THREAD_SAFETY" = "yes"; then
|
||||
ZEND_EXT_TYPE="zend_extension_debug_ts"
|
||||
elif test "$PHP_DEBUG" = "yes"; then
|
||||
elif test "$PHP_DEBUG" = "1"; then
|
||||
ZEND_EXT_TYPE="zend_extension_debug"
|
||||
elif test "$PHP_THREAD_SAFETY" = "yes"; then
|
||||
ZEND_EXT_TYPE="zend_extension_ts"
|
||||
@@ -1329,7 +1329,7 @@ CC=$old_CC
|
||||
|
||||
dnl Finish the Darwin hack
|
||||
if test "$php_did_darwin9_cheat" -eq 1; then
|
||||
if test "$PHP_DEBUG" = "yes"; then
|
||||
if test "$PHP_DEBUG" = "1"; then
|
||||
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-gstabs/-g/g'`
|
||||
else
|
||||
CFLAGS=`echo "-O2 $CFLAGS" | $SED -e 's/-gstabs//g'`
|
||||
|
||||
+23
-15
@@ -332,10 +332,13 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
|
||||
}
|
||||
|
||||
if (tmpzval) {
|
||||
SEPARATE_ZVAL(tmpzval);
|
||||
convert_to_boolean_ex(tmpzval);
|
||||
smallFootprint = Z_LVAL_PP(tmpzval);
|
||||
zval_ptr_dtor(tmpzval);
|
||||
zval tmp, *tmp2;
|
||||
|
||||
tmp = **tmpzval;
|
||||
zval_copy_ctor(&tmp);
|
||||
tmp2 = &tmp;
|
||||
convert_to_boolean_ex(&tmp2);
|
||||
smallFootprint = Z_LVAL(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,26 +355,31 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
|
||||
if (Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) {
|
||||
if (zend_hash_find(HASH_OF(filterparams), "blocks", sizeof("blocks"), (void**) &tmpzval) == SUCCESS) {
|
||||
/* How much memory to allocate (1 - 9) x 100kb */
|
||||
SEPARATE_ZVAL(tmpzval);
|
||||
convert_to_long_ex(tmpzval);
|
||||
if (Z_LVAL_PP(tmpzval) < 1 || Z_LVAL_PP(tmpzval) > 9) {
|
||||
zval tmp;
|
||||
|
||||
tmp = **tmpzval;
|
||||
zval_copy_ctor(&tmp);
|
||||
convert_to_long(&tmp);
|
||||
if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > 9) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%ld)", Z_LVAL_PP(tmpzval));
|
||||
} else {
|
||||
blockSize100k = Z_LVAL_PP(tmpzval);
|
||||
blockSize100k = Z_LVAL(tmp);
|
||||
}
|
||||
zval_ptr_dtor(tmpzval);
|
||||
}
|
||||
|
||||
if (zend_hash_find(HASH_OF(filterparams), "work", sizeof("work"), (void**) &tmpzval) == SUCCESS) {
|
||||
/* Work Factor (0 - 250) */
|
||||
SEPARATE_ZVAL(tmpzval);
|
||||
convert_to_long_ex(tmpzval);
|
||||
if (Z_LVAL_PP(tmpzval) < 0 || Z_LVAL_PP(tmpzval) > 250) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%ld)", Z_LVAL_PP(tmpzval));
|
||||
zval tmp;
|
||||
|
||||
tmp = **tmpzval;
|
||||
zval_copy_ctor(&tmp);
|
||||
convert_to_long(&tmp);
|
||||
|
||||
if (Z_LVAL(tmp) < 0 || Z_LVAL(tmp) > 250) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%ld)", Z_LVAL(tmp));
|
||||
} else {
|
||||
workFactor = Z_LVAL_PP(tmpzval);
|
||||
workFactor = Z_LVAL(tmp);
|
||||
}
|
||||
zval_ptr_dtor(tmpzval);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ $password = 'p4ssw0rd';
|
||||
$options = OP_HALFOPEN; // this should be enough to verify server present
|
||||
$retries = 0; // dont retry connect on failure
|
||||
|
||||
$mbox = imap_open($mailbox, $username, $password, $options, $retries);
|
||||
$mbox = @imap_open($mailbox, $username, $password, $options, $retries);
|
||||
if (!$mbox) {
|
||||
die("skip could not connect to mailbox $mailbox");
|
||||
}
|
||||
|
||||
@@ -28,5 +28,5 @@ var_dump(ibase_affected_rows($x));
|
||||
int(3)
|
||||
int(0)
|
||||
|
||||
Warning: ibase_query(): Dynamic SQL Error SQL error code = -104 Unexpected end of command %s on line %d
|
||||
Warning: ibase_query(): Dynamic SQL Error SQL error code = -104 %s on line %d
|
||||
int(0)
|
||||
@@ -17,6 +17,6 @@ var_dump(ibase_errmsg());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ibase_query(): Dynamic SQL Error SQL error code = -104 Unexpected end of command %s on line %d
|
||||
string(%d) "Dynamic SQL Error SQL error code = -104 Unexpected end of command%s"
|
||||
Warning: ibase_query(): Dynamic SQL Error SQL error code = -104 %s on line %d
|
||||
string(%d) "Dynamic SQL Error SQL error code = -104 %s"
|
||||
bool(false)
|
||||
@@ -26,7 +26,7 @@ int(2)
|
||||
Warning: Wrong parameter count for ibase_num_params() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ibase_prepare(): Dynamic SQL Error SQL error code = -206 Column unknown X At line 1, column 52%s in %s on line %d
|
||||
Warning: ibase_prepare(): Dynamic SQL Error SQL error code = -206 %s in %s on line %d
|
||||
|
||||
Warning: ibase_num_params(): supplied argument is not a valid Firebird/InterBase query resource in %s on line %d
|
||||
bool(false)
|
||||
@@ -479,13 +479,7 @@ static PHP_FUNCTION(json_decode)
|
||||
RETURN_DOUBLE(d);
|
||||
}
|
||||
}
|
||||
if (parameter_len > 1 && *parameter == '"' && parameter[parameter_len-1] == '"') {
|
||||
RETURN_STRINGL(parameter+1, parameter_len-2, 1);
|
||||
} else if (*parameter == '{' || *parameter == '[') { /* invalid JSON string */
|
||||
RETURN_NULL();
|
||||
} else {
|
||||
RETURN_STRINGL(parameter, parameter_len, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -16,7 +16,6 @@ var_dump(json_decode(";"));
|
||||
var_dump(json_decode("руссиш"));
|
||||
var_dump(json_decode("blah"));
|
||||
var_dump(json_decode(NULL));
|
||||
var_dump(json_decode('[1}'));
|
||||
var_dump(json_decode('{ "test": { "foo": "bar" } }'));
|
||||
var_dump(json_decode('{ "test": { "foo": "" } }'));
|
||||
var_dump(json_decode('{ "": { "foo": "" } }'));
|
||||
@@ -32,12 +31,11 @@ NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
string(1) "."
|
||||
string(1) "."
|
||||
string(3) "<?>"
|
||||
string(1) ";"
|
||||
string(12) "руссиш"
|
||||
string(4) "blah"
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
object(stdClass)#%d (1) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug#42090 (json_decode causes segmentation fault)
|
||||
Bug #42090 (json_decode causes segmentation fault)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("json")) print "skip"; ?>
|
||||
--FILE--
|
||||
@@ -16,10 +16,9 @@ var_dump(
|
||||
?>
|
||||
--EXPECT--
|
||||
string(0) ""
|
||||
string(5) "".."."
|
||||
string(1) """
|
||||
string(2) """"
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
string(4) ""\"""
|
||||
string(1) """
|
||||
string(2) """"
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
Bug #46944 (json_encode() doesn't handle 3 byte utf8 correctly)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('json')) print 'skip'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
for ($i = 1; $i <= 16; $i++) {
|
||||
$first = 0xf0|($i >> 2);
|
||||
$second = 0x8f|($i & 3) << 4;
|
||||
$string = sprintf("aa%c%c\xbf\xbdzz", $first, $second);
|
||||
echo json_encode($string) . "\n";
|
||||
}
|
||||
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
"aa\ud83f\udffdzz"
|
||||
"aa\ud87f\udffdzz"
|
||||
"aa\ud8bf\udffdzz"
|
||||
"aa\ud8ff\udffdzz"
|
||||
"aa\ud93f\udffdzz"
|
||||
"aa\ud97f\udffdzz"
|
||||
"aa\ud9bf\udffdzz"
|
||||
"aa\ud9ff\udffdzz"
|
||||
"aa\uda3f\udffdzz"
|
||||
"aa\uda7f\udffdzz"
|
||||
"aa\udabf\udffdzz"
|
||||
"aa\udaff\udffdzz"
|
||||
"aa\udb3f\udffdzz"
|
||||
"aa\udb7f\udffdzz"
|
||||
"aa\udbbf\udffdzz"
|
||||
"aa\udbff\udffdzz"
|
||||
Done
|
||||
@@ -165,7 +165,7 @@ utf8_decode_next(json_utf8_decode *utf8)
|
||||
/*
|
||||
Three continuation (65536 to 1114111)
|
||||
*/
|
||||
if ((c & 0xF1) == 0xF0) {
|
||||
if ((c & 0xF8) == 0xF0) {
|
||||
int c1 = cont(utf8);
|
||||
int c2 = cont(utf8);
|
||||
int c3 = cont(utf8);
|
||||
|
||||
@@ -46,7 +46,7 @@ utf8_to_utf16(unsigned short w[], char p[], int length)
|
||||
w[the_index] = (unsigned short)c;
|
||||
the_index += 1;
|
||||
} else {
|
||||
c &= 0xFFFF;
|
||||
c -= 0x10000;
|
||||
w[the_index] = (unsigned short)(0xD800 | (c >> 10));
|
||||
the_index += 1;
|
||||
w[the_index] = (unsigned short)(0xDC00 | (c & 0x3FF));
|
||||
|
||||
@@ -167,7 +167,7 @@ mbfl_filt_conv_sjiswin_wchar(int c, mbfl_convert_filter *filter)
|
||||
case 1: /* kanji second char */
|
||||
filter->status = 0;
|
||||
c1 = filter->cache;
|
||||
if (c > 0x39 && c < 0xfd && c != 0x7f) {
|
||||
if (c >= 0x40 && c <= 0xfc && c != 0x7f) {
|
||||
w = 0;
|
||||
SJIS_DECODE(c1, c, s1, s2);
|
||||
s = (s1 - 0x21)*94 + s2 - 0x21;
|
||||
|
||||
@@ -167,7 +167,7 @@ mbfl_filt_conv_sjis_wchar(int c, mbfl_convert_filter *filter)
|
||||
case 1: /* kanji second char */
|
||||
filter->status = 0;
|
||||
c1 = filter->cache;
|
||||
if (c > 0x39 && c < 0xfd && c != 0x7f) {
|
||||
if (c >= 0x40 && c <= 0xfc && c != 0x7f) {
|
||||
SJIS_DECODE(c1, c, s1, s2);
|
||||
w = (s1 - 0x21)*94 + s2 - 0x21;
|
||||
if (w >= 0 && w < jisx0208_ucs_table_size) {
|
||||
|
||||
@@ -462,10 +462,9 @@ enum mbfl_no_encoding mbfl_encoding_detector_judge(mbfl_encoding_detector *ident
|
||||
while (n >= 0) {
|
||||
filter = identd->filter_list[n];
|
||||
if (!filter->flag) {
|
||||
if (identd->strict && filter->status) {
|
||||
continue;
|
||||
if (!identd->strict || !filter->status) {
|
||||
encoding = filter->encoding->no_encoding;
|
||||
}
|
||||
encoding = filter->encoding->no_encoding;
|
||||
}
|
||||
n--;
|
||||
}
|
||||
@@ -779,7 +778,7 @@ retry:
|
||||
for (;;) {
|
||||
pc->found_pos++;
|
||||
p = h;
|
||||
m = pc->needle.buffer;
|
||||
m = (int *)pc->needle.buffer;
|
||||
n = pc->needle_pos - 1;
|
||||
while (n > 0 && *p == *m) {
|
||||
n--;
|
||||
@@ -858,84 +857,203 @@ mbfl_strpos(
|
||||
int offset,
|
||||
int reverse)
|
||||
{
|
||||
int n, result, negative_offset = 0;
|
||||
unsigned char *p;
|
||||
mbfl_convert_filter *filter;
|
||||
struct collector_strpos_data pc;
|
||||
int result;
|
||||
mbfl_string _haystack_u8, _needle_u8;
|
||||
const mbfl_string *haystack_u8, *needle_u8;
|
||||
const unsigned char *u8_tbl;
|
||||
|
||||
if (haystack == NULL || needle == NULL) {
|
||||
if (haystack == NULL || haystack->val == NULL || needle == NULL || needle->val == NULL) {
|
||||
return -8;
|
||||
}
|
||||
/* needle is converted into wchar */
|
||||
mbfl_wchar_device_init(&pc.needle);
|
||||
filter = mbfl_convert_filter_new(
|
||||
needle->no_encoding,
|
||||
mbfl_no_encoding_wchar,
|
||||
mbfl_wchar_device_output, 0, &pc.needle);
|
||||
if (filter == NULL) {
|
||||
return -4;
|
||||
|
||||
{
|
||||
const mbfl_encoding *u8_enc;
|
||||
u8_enc = mbfl_no2encoding(mbfl_no_encoding_utf8);
|
||||
if (u8_enc == NULL || u8_enc->mblen_table == NULL) {
|
||||
return -8;
|
||||
}
|
||||
u8_tbl = u8_enc->mblen_table;
|
||||
}
|
||||
p = needle->val;
|
||||
n = needle->len;
|
||||
if (p != NULL) {
|
||||
while (n > 0) {
|
||||
if ((*filter->filter_function)(*p++, filter) < 0) {
|
||||
break;
|
||||
|
||||
if (haystack->no_encoding != mbfl_no_encoding_utf8) {
|
||||
mbfl_string_init(&_haystack_u8);
|
||||
haystack_u8 = mbfl_convert_encoding(haystack, &_haystack_u8, mbfl_no_encoding_utf8);
|
||||
if (haystack_u8 == NULL) {
|
||||
result = -4;
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
haystack_u8 = haystack;
|
||||
}
|
||||
|
||||
if (needle->no_encoding != mbfl_no_encoding_utf8) {
|
||||
mbfl_string_init(&_needle_u8);
|
||||
needle_u8 = mbfl_convert_encoding(needle, &_needle_u8, mbfl_no_encoding_utf8);
|
||||
if (needle_u8 == NULL) {
|
||||
result = -4;
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
needle_u8 = needle;
|
||||
}
|
||||
|
||||
if (needle_u8->len < 1) {
|
||||
result = -8;
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = -1;
|
||||
if (haystack_u8->len < needle_u8->len) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!reverse) {
|
||||
unsigned int jtbl[1 << (sizeof(unsigned char) * 8)];
|
||||
unsigned int needle_u8_len = needle_u8->len;
|
||||
unsigned int i;
|
||||
const unsigned char *p, *q, *e;
|
||||
const unsigned char *haystack_u8_val = haystack_u8->val,
|
||||
*needle_u8_val = needle_u8->val;
|
||||
for (i = 0; i < sizeof(jtbl) / sizeof(*jtbl); ++i) {
|
||||
jtbl[i] = needle_u8_len + 1;
|
||||
}
|
||||
for (i = 0; i < needle_u8_len - 1; ++i) {
|
||||
jtbl[needle_u8_val[i]] = needle_u8_len - i;
|
||||
}
|
||||
e = haystack_u8_val + haystack_u8->len;
|
||||
p = haystack_u8_val;
|
||||
while (--offset >= 0) {
|
||||
if (p >= e) {
|
||||
result = -16;
|
||||
goto out;
|
||||
}
|
||||
p += u8_tbl[*p];
|
||||
}
|
||||
p += needle_u8_len;
|
||||
if (p > e) {
|
||||
goto out;
|
||||
}
|
||||
while (p <= e) {
|
||||
const unsigned char *pv = p;
|
||||
q = needle_u8_val + needle_u8_len;
|
||||
for (;;) {
|
||||
if (q == needle_u8_val) {
|
||||
result = 0;
|
||||
while (p > haystack_u8_val) {
|
||||
unsigned char c = *--p;
|
||||
if (c < 0x80) {
|
||||
++result;
|
||||
} else if ((c & 0xc0) != 0x80) {
|
||||
++result;
|
||||
}
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
if (*--q != *--p) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
p += jtbl[*p];
|
||||
if (p <= pv) {
|
||||
p = pv + 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
unsigned int jtbl[1 << (sizeof(unsigned char) * 8)];
|
||||
unsigned int needle_u8_len = needle_u8->len, needle_len = 0;
|
||||
unsigned int i;
|
||||
const unsigned char *p, *e, *q, *qe;
|
||||
const unsigned char *haystack_u8_val = haystack_u8->val,
|
||||
*needle_u8_val = needle_u8->val;
|
||||
for (i = 0; i < sizeof(jtbl) / sizeof(*jtbl); ++i) {
|
||||
jtbl[i] = needle_u8_len;
|
||||
}
|
||||
for (i = needle_u8_len - 1; i > 0; --i) {
|
||||
unsigned char c = needle_u8_val[i];
|
||||
jtbl[c] = i;
|
||||
if (c < 0x80) {
|
||||
++needle_len;
|
||||
} else if ((c & 0xc0) != 0x80) {
|
||||
++needle_len;
|
||||
}
|
||||
}
|
||||
{
|
||||
unsigned char c = needle_u8_val[0];
|
||||
if (c < 0x80) {
|
||||
++needle_len;
|
||||
} else if ((c & 0xc0) != 0x80) {
|
||||
++needle_len;
|
||||
}
|
||||
}
|
||||
e = haystack_u8_val;
|
||||
p = e + haystack_u8->len;
|
||||
qe = needle_u8_val + needle_u8_len;
|
||||
if (offset < 0) {
|
||||
if (-offset > needle_len) {
|
||||
offset += needle_len;
|
||||
while (offset < 0) {
|
||||
unsigned char c;
|
||||
if (p <= e) {
|
||||
result = -16;
|
||||
goto out;
|
||||
}
|
||||
c = *(--p);
|
||||
if (c < 0x80) {
|
||||
++offset;
|
||||
} else if ((c & 0xc0) != 0x80) {
|
||||
++offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const unsigned char *ee = haystack_u8_val + haystack_u8->len;
|
||||
while (--offset >= 0) {
|
||||
if (e >= ee) {
|
||||
result = -16;
|
||||
goto out;
|
||||
}
|
||||
e += u8_tbl[*e];
|
||||
}
|
||||
}
|
||||
if (p < e + needle_u8_len) {
|
||||
goto out;
|
||||
}
|
||||
p -= needle_u8_len;
|
||||
while (p >= e) {
|
||||
const unsigned char *pv = p;
|
||||
q = needle_u8_val;
|
||||
for (;;) {
|
||||
if (q == qe) {
|
||||
result = 0;
|
||||
p -= needle_u8_len;
|
||||
while (p > haystack_u8_val) {
|
||||
unsigned char c = *--p;
|
||||
if (c < 0x80) {
|
||||
++result;
|
||||
} else if ((c & 0xc0) != 0x80) {
|
||||
++result;
|
||||
}
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
if (*q != *p) {
|
||||
break;
|
||||
}
|
||||
++p, ++q;
|
||||
}
|
||||
p -= jtbl[*p];
|
||||
if (p >= pv) {
|
||||
p = pv - 1;
|
||||
}
|
||||
n--;
|
||||
}
|
||||
}
|
||||
mbfl_convert_filter_flush(filter);
|
||||
mbfl_convert_filter_delete(filter);
|
||||
pc.needle_len = pc.needle.pos;
|
||||
if (pc.needle.buffer == NULL) {
|
||||
return -4;
|
||||
out:
|
||||
if (haystack_u8 == &_haystack_u8) {
|
||||
mbfl_string_clear(&_haystack_u8);
|
||||
}
|
||||
if (pc.needle_len <= 0) {
|
||||
mbfl_wchar_device_clear(&pc.needle);
|
||||
return -2;
|
||||
if (needle_u8 == &_needle_u8) {
|
||||
mbfl_string_clear(&_needle_u8);
|
||||
}
|
||||
/* initialize filter and collector data */
|
||||
filter = mbfl_convert_filter_new(
|
||||
haystack->no_encoding,
|
||||
mbfl_no_encoding_wchar,
|
||||
collector_strpos, 0, &pc);
|
||||
if (filter == NULL) {
|
||||
mbfl_wchar_device_clear(&pc.needle);
|
||||
return -4;
|
||||
}
|
||||
|
||||
if (offset < 0) {
|
||||
negative_offset = -offset-1;
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
pc.start = offset;
|
||||
pc.output = 0;
|
||||
pc.needle_pos = 0;
|
||||
pc.found_pos = 0;
|
||||
pc.matched_pos = -1;
|
||||
|
||||
/* feed data */
|
||||
p = haystack->val;
|
||||
n = haystack->len - negative_offset;
|
||||
if (p != NULL) {
|
||||
while (n > 0) {
|
||||
if ((*filter->filter_function)(*p++, filter) < 0) {
|
||||
pc.matched_pos = -4;
|
||||
break;
|
||||
}
|
||||
if (pc.matched_pos >= 0 && !reverse) {
|
||||
break;
|
||||
}
|
||||
n--;
|
||||
}
|
||||
}
|
||||
mbfl_convert_filter_flush(filter);
|
||||
result = pc.matched_pos;
|
||||
mbfl_convert_filter_delete(filter);
|
||||
mbfl_wchar_device_clear(&pc.needle);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+36
-25
@@ -1452,7 +1452,7 @@ PHP_FUNCTION(mb_preferred_mime_name)
|
||||
Parses GET/POST/COOKIE data and sets global variables */
|
||||
PHP_FUNCTION(mb_parse_str)
|
||||
{
|
||||
zval *track_vars_array;
|
||||
zval *track_vars_array = NULL;
|
||||
char *encstr = NULL;
|
||||
int encstr_len;
|
||||
php_mb_encoding_handler_info_t info;
|
||||
@@ -1653,12 +1653,12 @@ PHP_FUNCTION(mb_strpos)
|
||||
}
|
||||
}
|
||||
|
||||
if (offset < 0 || (unsigned long)offset > (unsigned long)mbfl_strlen(&haystack)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string.");
|
||||
if (offset < 0 || offset > mbfl_strlen(&haystack)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (needle.len == 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1670,17 +1670,17 @@ PHP_FUNCTION(mb_strpos)
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Needle has not positive length.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Needle has not positive length");
|
||||
break;
|
||||
case 4:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding or conversion error.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding or conversion error");
|
||||
break;
|
||||
case 8:
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Argument is empty.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Argument is empty");
|
||||
break;
|
||||
default:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error in mb_strpos.");
|
||||
break;
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error in mb_strpos");
|
||||
break;
|
||||
}
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
@@ -1767,10 +1767,13 @@ PHP_FUNCTION(mb_strrpos)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if ((offset > 0 && offset > mbfl_strlen(&haystack)) ||
|
||||
(offset < 0 && -offset > mbfl_strlen(&haystack))) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
{
|
||||
int haystack_char_len = mbfl_strlen(&haystack);
|
||||
if ((offset > 0 && offset > haystack_char_len) ||
|
||||
(offset < 0 && -offset > haystack_char_len)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
n = mbfl_strpos(&haystack, &needle, offset, 1);
|
||||
@@ -1824,10 +1827,6 @@ PHP_FUNCTION(mb_strripos)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if(offset > old_haystack_len){
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
n = php_mb_stripos(1, old_haystack, old_haystack_len, old_needle, old_needle_len, offset, from_encoding TSRMLS_CC);
|
||||
|
||||
if (n >= 0) {
|
||||
@@ -1868,7 +1867,7 @@ PHP_FUNCTION(mb_strstr)
|
||||
}
|
||||
|
||||
if (needle.len <= 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Empty delimiter.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
n = mbfl_strpos(&haystack, &needle, 0, 0);
|
||||
@@ -1977,7 +1976,7 @@ PHP_FUNCTION(mb_stristr)
|
||||
}
|
||||
|
||||
if(!needle.len){
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Empty delimiter.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1987,7 +1986,7 @@ PHP_FUNCTION(mb_stristr)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
n = php_mb_stripos(0, haystack.val, haystack.len, needle.val, needle.len, 0, from_encoding TSRMLS_CC);
|
||||
n = php_mb_stripos(0, haystack.val, haystack.len, needle.val, needle.len, 0, from_encoding TSRMLS_CC);
|
||||
|
||||
if (n <0) {
|
||||
RETURN_FALSE;
|
||||
@@ -2096,7 +2095,7 @@ PHP_FUNCTION(mb_substr_count)
|
||||
}
|
||||
|
||||
if (needle.len <= 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Empty substring.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty substring");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -4310,9 +4309,21 @@ MBSTRING_API int php_mb_stripos(int mode, char *old_haystack, int old_haystack_l
|
||||
break;
|
||||
}
|
||||
|
||||
if (offset < 0 || (unsigned long)offset > haystack.len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string.");
|
||||
break;
|
||||
{
|
||||
int haystack_char_len = mbfl_strlen(&haystack);
|
||||
|
||||
if (mode) {
|
||||
if ((offset > 0 && offset > haystack_char_len) ||
|
||||
(offset < 0 && -offset > haystack_char_len)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (offset < 0 || offset > haystack_char_len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
n = mbfl_strpos(&haystack, &needle, offset, mode);
|
||||
@@ -4326,7 +4337,7 @@ MBSTRING_API int php_mb_stripos(int mode, char *old_haystack, int old_haystack_l
|
||||
efree(needle.val);
|
||||
}
|
||||
|
||||
return n;
|
||||
return n;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -47,29 +47,29 @@ bool(false)
|
||||
-- Offset is 22 --
|
||||
--Multibyte String:--
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--ASCII String:--
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Offset is 53 --
|
||||
--Multibyte String:--
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--ASCII String:--
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Offset is 54 --
|
||||
--Multibyte String:--
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--ASCII String:--
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
bool(false)
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,6 +1,5 @@
|
||||
--TEST--
|
||||
Test mb_strrpos() function : mb_strrpos offset is byte count for negative values
|
||||
--XFAIL--
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('mbstring') or die('skip');
|
||||
@@ -40,31 +39,31 @@ foreach ($offsets as $i) {
|
||||
-- Offset is -25 --
|
||||
Multibyte String:
|
||||
|
||||
Notice: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
ASCII String:
|
||||
mb_strrpos:
|
||||
|
||||
Notice: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
strrpos:
|
||||
|
||||
Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Offset is -24 --
|
||||
Multibyte String:
|
||||
|
||||
Notice: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
ASCII String:
|
||||
mb_strrpos:
|
||||
|
||||
Notice: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
strrpos:
|
||||
|
||||
Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Offset is -13 --
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #45239 (encoding detector hangs with mbstring.strict_detection enabled)
|
||||
--INI--
|
||||
mbstring.strict_detection=1
|
||||
mbstring.http_input=UTF-8
|
||||
mbstring.internal_encoding=UTF-8
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('mbstring') or die('skip');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
mb_internal_encoding("utf-8");
|
||||
mb_parse_str("a=%fc", $dummy);
|
||||
var_dump(mb_http_input());
|
||||
?>
|
||||
--EXPECT--
|
||||
string(5) "UTF-8"
|
||||
@@ -0,0 +1,202 @@
|
||||
--TEST--
|
||||
Bug #45923 (mb_st[r]ripos() offset not handled correctly)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
|
||||
--INI--
|
||||
mbstring.internal_encoding=UTF-8
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(strpos("abc abc abc", "abc", 0));
|
||||
var_dump(strpos("abc abc abc", "abc", 3));
|
||||
var_dump(strpos("abc abc abc", "abc", 6));
|
||||
var_dump(strpos("abc abc abc", "abc", 9));
|
||||
var_dump(strpos("abc abc abc", "abc", 11));
|
||||
var_dump(strpos("abc abc abc", "abc", 12));
|
||||
var_dump(strpos("abc abc abc", "abc", -1));
|
||||
var_dump(strpos("abc abc abc", "abc", -3));
|
||||
var_dump(strpos("abc abc abc", "abc", -6));
|
||||
|
||||
var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 0));
|
||||
var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 3));
|
||||
var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 6));
|
||||
var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 9));
|
||||
var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 11));
|
||||
var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 12));
|
||||
var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", -1));
|
||||
var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", -3));
|
||||
var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", -6));
|
||||
|
||||
var_dump(stripos("abc abc abc", "abc", 0));
|
||||
var_dump(stripos("abc abc abc", "abc", 3));
|
||||
var_dump(stripos("abc abc abc", "abc", 6));
|
||||
var_dump(stripos("abc abc abc", "abc", 9));
|
||||
var_dump(stripos("abc abc abc", "abc", 11));
|
||||
var_dump(stripos("abc abc abc", "abc", 12));
|
||||
var_dump(stripos("abc abc abc", "abc", -1));
|
||||
var_dump(stripos("abc abc abc", "abc", -3));
|
||||
var_dump(stripos("abc abc abc", "abc", -6));
|
||||
|
||||
var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 0));
|
||||
var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 3));
|
||||
var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 6));
|
||||
var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 9));
|
||||
var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 11));
|
||||
var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 12));
|
||||
var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", -1));
|
||||
var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", -3));
|
||||
var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", -6));
|
||||
|
||||
var_dump(strrpos("abc abc abc", "abc", 0));
|
||||
var_dump(strrpos("abc abc abc", "abc", 3));
|
||||
var_dump(strrpos("abc abc abc", "abc", 6));
|
||||
var_dump(strrpos("abc abc abc", "abc", 9));
|
||||
var_dump(strrpos("abc abc abc", "abc", 11));
|
||||
var_dump(strrpos("abc abc abc", "abc", 12));
|
||||
var_dump(strrpos("abc abc abc", "abc", -1));
|
||||
var_dump(strrpos("abc abc abc", "abc", -3));
|
||||
var_dump(strrpos("abc abc abc", "abc", -6));
|
||||
|
||||
var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 0));
|
||||
var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 3));
|
||||
var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 6));
|
||||
var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 9));
|
||||
var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 11));
|
||||
var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 12));
|
||||
var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", -1));
|
||||
var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", -3));
|
||||
var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", -6));
|
||||
|
||||
var_dump(strripos("abc abc abc", "abc", 0));
|
||||
var_dump(strripos("abc abc abc", "abc", 3));
|
||||
var_dump(strripos("abc abc abc", "abc", 6));
|
||||
var_dump(strripos("abc abc abc", "abc", 9));
|
||||
var_dump(strripos("abc abc abc", "abc", 11));
|
||||
var_dump(strripos("abc abc abc", "abc", 12));
|
||||
var_dump(strripos("abc abc abc", "abc", -1));
|
||||
var_dump(strripos("abc abc abc", "abc", -3));
|
||||
var_dump(strripos("abc abc abc", "abc", -6));
|
||||
|
||||
var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 0));
|
||||
var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 3));
|
||||
var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 6));
|
||||
var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 9));
|
||||
var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 11));
|
||||
var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 12));
|
||||
var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", -1));
|
||||
var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", -3));
|
||||
var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", -6));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(0)
|
||||
int(4)
|
||||
int(8)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
int(0)
|
||||
int(4)
|
||||
int(8)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
int(0)
|
||||
int(4)
|
||||
int(8)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
int(0)
|
||||
int(4)
|
||||
int(8)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
int(8)
|
||||
int(8)
|
||||
int(8)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
int(8)
|
||||
int(8)
|
||||
int(4)
|
||||
int(8)
|
||||
int(8)
|
||||
int(8)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
int(8)
|
||||
int(8)
|
||||
int(4)
|
||||
int(8)
|
||||
int(8)
|
||||
int(8)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
int(8)
|
||||
int(8)
|
||||
int(4)
|
||||
int(8)
|
||||
int(8)
|
||||
int(8)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
int(8)
|
||||
int(8)
|
||||
int(4)
|
||||
@@ -0,0 +1,523 @@
|
||||
--TEST--
|
||||
Bug #47399 (mb_check_encoding() returns true for some illegal SJIS characters)
|
||||
--FILE--
|
||||
<?php
|
||||
foreach (array("Shift_JIS", "CP932") as $enc) {
|
||||
for ($a = 0; $a < 256; $a++) {
|
||||
var_dump(mb_check_encoding("\x81".pack("c", $a), $enc));
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -115,12 +115,12 @@ int(8)
|
||||
|
||||
-- Iteration 3 --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 4 --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 5 --
|
||||
@@ -128,12 +128,12 @@ bool(false)
|
||||
|
||||
-- Iteration 6 --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 7 --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 8 --
|
||||
@@ -200,4 +200,4 @@ int(8)
|
||||
|
||||
Warning: mb_stripos() expects parameter 3 to be long, resource given in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
@@ -52,11 +52,11 @@ echo "Done";
|
||||
**-- Offset is: -10 --**
|
||||
-- ASCII String --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
**-- Offset is: 0 --**
|
||||
@@ -80,40 +80,40 @@ int(20)
|
||||
**-- Offset is: 30 --**
|
||||
-- ASCII String --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
**-- Offset is: 40 --**
|
||||
-- ASCII String --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
**-- Offset is: 50 --**
|
||||
-- ASCII String --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
**-- Offset is: 60 --**
|
||||
-- ASCII String --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Warning: mb_stripos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
@@ -165,33 +165,33 @@ Error: 2 - mb_stristr() expects parameter 2 to be string, array given, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--uppercase NULL--
|
||||
Error: 2 - mb_stristr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_stristr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--lowercase null--
|
||||
Error: 2 - mb_stristr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_stristr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--lowercase true--
|
||||
bool(false)
|
||||
|
||||
--lowercase false--
|
||||
Error: 2 - mb_stristr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_stristr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--uppercase TRUE--
|
||||
bool(false)
|
||||
|
||||
--uppercase FALSE--
|
||||
Error: 2 - mb_stristr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_stristr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--empty string DQ--
|
||||
Error: 2 - mb_stristr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_stristr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--empty string SQ--
|
||||
Error: 2 - mb_stristr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_stristr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--instance of classWithToString--
|
||||
@@ -202,11 +202,11 @@ Error: 2 - mb_stristr() expects parameter 2 to be string, object given, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--undefined var--
|
||||
Error: 2 - mb_stristr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_stristr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--unset var--
|
||||
Error: 2 - mb_stristr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_stristr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--resource--
|
||||
|
||||
@@ -135,12 +135,12 @@ bool(false)
|
||||
|
||||
-- Iteration 10 --
|
||||
|
||||
Warning: mb_strpos(): Empty delimiter. in %s on line %d
|
||||
Warning: mb_strpos(): Empty delimiter in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 11 --
|
||||
|
||||
Warning: mb_strpos(): Empty delimiter. in %s on line %d
|
||||
Warning: mb_strpos(): Empty delimiter in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 12 --
|
||||
@@ -148,7 +148,7 @@ bool(false)
|
||||
|
||||
-- Iteration 13 --
|
||||
|
||||
Warning: mb_strpos(): Empty delimiter. in %s on line %d
|
||||
Warning: mb_strpos(): Empty delimiter in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 14 --
|
||||
@@ -156,17 +156,17 @@ bool(false)
|
||||
|
||||
-- Iteration 15 --
|
||||
|
||||
Warning: mb_strpos(): Empty delimiter. in %s on line %d
|
||||
Warning: mb_strpos(): Empty delimiter in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 16 --
|
||||
|
||||
Warning: mb_strpos(): Empty delimiter. in %s on line %d
|
||||
Warning: mb_strpos(): Empty delimiter in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 17 --
|
||||
|
||||
Warning: mb_strpos(): Empty delimiter. in %s on line %d
|
||||
Warning: mb_strpos(): Empty delimiter in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 18 --
|
||||
@@ -183,16 +183,16 @@ bool(false)
|
||||
|
||||
-- Iteration 22 --
|
||||
|
||||
Warning: mb_strpos(): Empty delimiter. in %s on line %d
|
||||
Warning: mb_strpos(): Empty delimiter in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 23 --
|
||||
|
||||
Warning: mb_strpos(): Empty delimiter. in %s on line %d
|
||||
Warning: mb_strpos(): Empty delimiter in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 24 --
|
||||
|
||||
Warning: mb_strpos() expects parameter 2 to be string, resource given in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
@@ -114,12 +114,12 @@ int(8)
|
||||
|
||||
-- Iteration 3 --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 4 --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 5 --
|
||||
@@ -127,12 +127,12 @@ bool(false)
|
||||
|
||||
-- Iteration 6 --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 7 --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 8 --
|
||||
@@ -199,4 +199,4 @@ int(8)
|
||||
|
||||
Warning: mb_strpos() expects parameter 3 to be long, resource given in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
@@ -50,11 +50,11 @@ echo "Done";
|
||||
**-- Offset is: -10 --**
|
||||
-- ASCII String --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
**-- Offset is: 0 --**
|
||||
@@ -78,40 +78,40 @@ int(20)
|
||||
**-- Offset is: 30 --**
|
||||
-- ASCII String --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
**-- Offset is: 40 --**
|
||||
-- ASCII String --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
**-- Offset is: 50 --**
|
||||
-- ASCII String --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
**-- Offset is: 60 --**
|
||||
-- ASCII String --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Warning: mb_strpos(): Offset not contained in string. in %s on line %d
|
||||
Warning: mb_strpos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
@@ -116,27 +116,27 @@ int(8)
|
||||
|
||||
-- Iteration 3 --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 4 --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 5 --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 6 --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 7 --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 8 --
|
||||
@@ -203,4 +203,4 @@ int(8)
|
||||
|
||||
Warning: mb_strripos() expects parameter 3 to be long, resource given in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
@@ -76,40 +76,40 @@ int(20)
|
||||
**-- Offset is: 30 --**
|
||||
-- ASCII String --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
**-- Offset is: 40 --**
|
||||
-- ASCII String --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
**-- Offset is: 50 --**
|
||||
-- ASCII String --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
**-- Offset is: 60 --**
|
||||
-- ASCII String --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
--Multibyte String --
|
||||
|
||||
Notice: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
@@ -97,12 +97,12 @@ int(8)
|
||||
|
||||
-- Iteration 3 --
|
||||
|
||||
Notice: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 4 --
|
||||
|
||||
Notice: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 5 --
|
||||
@@ -113,7 +113,7 @@ bool(false)
|
||||
|
||||
-- Iteration 7 --
|
||||
|
||||
Notice: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 8 --
|
||||
@@ -150,4 +150,4 @@ int(8)
|
||||
|
||||
-- Iteration 18 --
|
||||
int(8)
|
||||
Done
|
||||
Done
|
||||
@@ -165,33 +165,33 @@ Error: 2 - mb_strstr() expects parameter 2 to be string, array given, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--uppercase NULL--
|
||||
Error: 2 - mb_strstr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_strstr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--lowercase null--
|
||||
Error: 2 - mb_strstr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_strstr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--lowercase true--
|
||||
bool(false)
|
||||
|
||||
--lowercase false--
|
||||
Error: 2 - mb_strstr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_strstr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--uppercase TRUE--
|
||||
bool(false)
|
||||
|
||||
--uppercase FALSE--
|
||||
Error: 2 - mb_strstr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_strstr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--empty string DQ--
|
||||
Error: 2 - mb_strstr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_strstr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--empty string SQ--
|
||||
Error: 2 - mb_strstr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_strstr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--instance of classWithToString--
|
||||
@@ -202,11 +202,11 @@ Error: 2 - mb_strstr() expects parameter 2 to be string, object given, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--undefined var--
|
||||
Error: 2 - mb_strstr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_strstr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--unset var--
|
||||
Error: 2 - mb_strstr(): Empty delimiter., %s(%d)
|
||||
Error: 2 - mb_strstr(): Empty delimiter, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--resource--
|
||||
|
||||
@@ -133,12 +133,12 @@ int(0)
|
||||
|
||||
-- Iteration 10 --
|
||||
|
||||
Warning: mb_substr_count(): Empty substring. in %s on line %d
|
||||
Warning: mb_substr_count(): Empty substring in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 11 --
|
||||
|
||||
Warning: mb_substr_count(): Empty substring. in %s on line %d
|
||||
Warning: mb_substr_count(): Empty substring in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 12 --
|
||||
@@ -146,7 +146,7 @@ int(0)
|
||||
|
||||
-- Iteration 13 --
|
||||
|
||||
Warning: mb_substr_count(): Empty substring. in %s on line %d
|
||||
Warning: mb_substr_count(): Empty substring in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 14 --
|
||||
@@ -154,17 +154,17 @@ int(0)
|
||||
|
||||
-- Iteration 15 --
|
||||
|
||||
Warning: mb_substr_count(): Empty substring. in %s on line %d
|
||||
Warning: mb_substr_count(): Empty substring in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 16 --
|
||||
|
||||
Warning: mb_substr_count(): Empty substring. in %s on line %d
|
||||
Warning: mb_substr_count(): Empty substring in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 17 --
|
||||
|
||||
Warning: mb_substr_count(): Empty substring. in %s on line %d
|
||||
Warning: mb_substr_count(): Empty substring in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 18 --
|
||||
@@ -181,16 +181,16 @@ int(1)
|
||||
|
||||
-- Iteration 22 --
|
||||
|
||||
Warning: mb_substr_count(): Empty substring. in %s on line %d
|
||||
Warning: mb_substr_count(): Empty substring in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 23 --
|
||||
|
||||
Warning: mb_substr_count(): Empty substring. in %s on line %d
|
||||
Warning: mb_substr_count(): Empty substring in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Iteration 24 --
|
||||
|
||||
Warning: mb_substr_count() expects parameter 2 to be string, resource given in %s on line %d
|
||||
NULL
|
||||
Done
|
||||
Done
|
||||
+10
-4
@@ -2158,11 +2158,12 @@ PHP_FUNCTION(mssql_execute)
|
||||
int num_fields;
|
||||
int batchsize;
|
||||
int ac = ZEND_NUM_ARGS();
|
||||
int exec_retval;
|
||||
|
||||
batchsize = MS_SQL_G(batchsize);
|
||||
if (ac < 1 || ac > 2 || zend_get_parameters_ex(ac, &stmt, &skip)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if (ac == 2) {
|
||||
skip_results = Z_BVAL_PP(skip);
|
||||
}
|
||||
@@ -2170,10 +2171,15 @@ PHP_FUNCTION(mssql_execute)
|
||||
ZEND_FETCH_RESOURCE(statement, mssql_statement *, stmt, -1, "MS SQL-Statement", le_statement);
|
||||
|
||||
mssql_ptr=statement->link;
|
||||
exec_retval = dbrpcexec(mssql_ptr->link);
|
||||
|
||||
if (dbrpcexec(mssql_ptr->link)==FAIL || dbsqlok(mssql_ptr->link)==FAIL) {
|
||||
if (exec_retval == FAIL || dbsqlok(mssql_ptr->link) == FAIL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure execution failed");
|
||||
dbcancel(mssql_ptr->link);
|
||||
|
||||
if (exec_retval == FAIL) {
|
||||
dbcancel(mssql_ptr->link);
|
||||
}
|
||||
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -254,13 +254,6 @@ zval *mysqli_read_property(zval *object, zval *member, int type TSRMLS_DC)
|
||||
}
|
||||
|
||||
if (ret == SUCCESS) {
|
||||
if (strcmp(obj->zo.ce->name, "mysqli_driver") &&
|
||||
(!obj->ptr || ((MYSQLI_RESOURCE *)(obj->ptr))->status < MYSQLI_STATUS_INITIALIZED)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name );
|
||||
retval = EG(uninitialized_zval_ptr);
|
||||
return(retval);
|
||||
}
|
||||
|
||||
ret = hnd->read_func(obj, &retval TSRMLS_CC);
|
||||
if (ret == SUCCESS) {
|
||||
/* ensure we're creating a temporary variable */
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "php_mysqli.h"
|
||||
|
||||
#define CHECK_STATUS(value) \
|
||||
if (((MYSQLI_RESOURCE *)obj->ptr)->status < value ) { \
|
||||
if (!obj->ptr || ((MYSQLI_RESOURCE *)obj->ptr)->status < value ) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Property access is not allowed yet"); \
|
||||
ZVAL_NULL(*retval); \
|
||||
return SUCCESS; \
|
||||
@@ -134,7 +134,6 @@ static int link_client_info_read(mysqli_object *obj, zval **retval TSRMLS_DC)
|
||||
static int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC)
|
||||
{
|
||||
ALLOC_ZVAL(*retval);
|
||||
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
|
||||
ZVAL_LONG(*retval, (long)MyG(error_no));
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -144,8 +143,11 @@ static int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC)
|
||||
static int link_connect_error_read(mysqli_object *obj, zval **retval TSRMLS_DC)
|
||||
{
|
||||
ALLOC_ZVAL(*retval);
|
||||
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
|
||||
ZVAL_STRING(*retval, MyG(error_msg), 1);
|
||||
if (MyG(error_msg)) {
|
||||
ZVAL_STRING(*retval, MyG(error_msg), 1);
|
||||
} else {
|
||||
ZVAL_NULL(*retval);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #45940 MySQLI OO does not populate connect_error property on failed connect
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
include "connect.inc";
|
||||
|
||||
//a forced username/password mismatch
|
||||
$dbo = @new mysqli($host, 'hopenotexist', 'andifheexistshehasanotherpassword', 'my_db');
|
||||
|
||||
var_dump($dbo->connect_error);
|
||||
var_dump(mysqli_connect_error());
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(71) "Access denied for user 'hopenotexist'@'localhost' (using password: YES)"
|
||||
string(71) "Access denied for user 'hopenotexist'@'localhost' (using password: YES)"
|
||||
|
||||
@@ -20,6 +20,8 @@ $quoted = $db->quote($unquoted);
|
||||
|
||||
$len = strlen($unquoted);
|
||||
|
||||
@$db->exec("DROP TABLE test");
|
||||
|
||||
$db->query("CREATE TABLE test (t char($len))");
|
||||
$db->query("INSERT INTO test (t) VALUES($quoted)");
|
||||
|
||||
@@ -28,6 +30,7 @@ $stmt->execute();
|
||||
|
||||
print_r($stmt->fetchAll(PDO::FETCH_ASSOC));
|
||||
|
||||
$db->exec("DROP TABLE test");
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -527,6 +527,9 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
|
||||
case PDO_PARAM_EVT_ALLOC:
|
||||
if (param->is_param) {
|
||||
/* allocate the parameter */
|
||||
if (var->sqlind) {
|
||||
efree(var->sqlind);
|
||||
}
|
||||
var->sqlind = (void*)emalloc(var->sqllen + 2*sizeof(short));
|
||||
var->sqldata = &((char*)var->sqlind)[sizeof(short)];
|
||||
}
|
||||
|
||||
@@ -8,14 +8,14 @@ PDO_Firebird: DDL/transactions
|
||||
require("testdb.inc");
|
||||
|
||||
$db = new PDO("firebird:dbname=$test_base",$user,$password) or die;
|
||||
$db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING);
|
||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
|
||||
|
||||
$db->exec("CREATE TABLE ddl (id INT NOT NULL PRIMARY KEY, text BLOB SUB_TYPE 1)");
|
||||
$db->exec("CREATE GENERATOR gen_ddl_id");
|
||||
$db->exec("CREATE TRIGGER ddl_bi FOR ddl BEFORE INSERT AS
|
||||
BEGIN IF (NEW.id IS NULL) THEN NEW.id=GEN_ID(gen_ddl_id,1); END");
|
||||
|
||||
$db->setAttribute(PDO_ATTR_AUTOCOMMIT,0);
|
||||
$db->setAttribute(PDO::ATTR_AUTOCOMMIT,0);
|
||||
|
||||
$db->beginTransaction();
|
||||
var_dump($db->exec("INSERT INTO ddl (text) VALUES ('bla')"));
|
||||
|
||||
@@ -11,9 +11,9 @@ ibase.timestampformat=%Y-%m-%d %H:%M:%S
|
||||
|
||||
$db = new PDO("firebird:dbname=$test_base",$user,$password) or die;
|
||||
|
||||
var_dump($db->getAttribute(PDO_ATTR_CONNECTION_STATUS));
|
||||
var_dump($db->getAttribute(PDO::ATTR_CONNECTION_STATUS));
|
||||
|
||||
$db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING);
|
||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
|
||||
|
||||
$db->exec("CREATE TABLE ddl (id SMALLINT NOT NULL PRIMARY KEY, text VARCHAR(32),
|
||||
datetime TIMESTAMP DEFAULT '2000-02-12' NOT NULL)");
|
||||
@@ -21,11 +21,13 @@ ibase.timestampformat=%Y-%m-%d %H:%M:%S
|
||||
|
||||
$s = $db->prepare("SELECT * FROM ddl WHERE id=? FOR UPDATE");
|
||||
|
||||
$s->bindParam(1,$id = 0);
|
||||
$s->bindColumn("TEXT",$var = null);
|
||||
$id = 0;
|
||||
$s->bindParam(1,$id);
|
||||
$var = null;
|
||||
$s->bindColumn("TEXT",$var);
|
||||
$id = 1;
|
||||
$s->execute();
|
||||
$s->setAttribute(PDO_ATTR_CURSOR_NAME, "c");
|
||||
$s->setAttribute(PDO::ATTR_CURSOR_NAME, "c");
|
||||
|
||||
var_dump($id);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ $db->exec('CREATE TABLE test (blobid integer not null primary key, bloboid OID)'
|
||||
$db->beginTransaction();
|
||||
$oid = $db->pgsqlLOBCreate();
|
||||
try {
|
||||
$stm = $db->pgsqlLOBOpen($oid);
|
||||
$stm = $db->pgsqlLOBOpen($oid, 'w+b');
|
||||
fwrite($stm, "Hello dude\n");
|
||||
|
||||
$stmt = $db->prepare("INSERT INTO test (blobid, bloboid) values (?, ?)");
|
||||
@@ -34,14 +34,37 @@ $stm = null;
|
||||
|
||||
/* Pull it out */
|
||||
$stmt = $db->prepare("SELECT * from test");
|
||||
$stmt->execute();
|
||||
$stmt->bindColumn('bloboid', $lob, PDO::PARAM_LOB);
|
||||
$stmt->execute();
|
||||
echo "Fetching:\n";
|
||||
while (($row = $stmt->fetch(PDO::FETCH_ASSOC))) {
|
||||
var_dump($row['blobid']);
|
||||
var_dump(stream_get_contents($lob));
|
||||
}
|
||||
echo "Fetched!\n";
|
||||
|
||||
/* Try again, with late bind */
|
||||
$stmt = $db->prepare("SELECT * from test");
|
||||
$stmt->execute();
|
||||
$stmt->bindColumn('bloboid', $lob, PDO::PARAM_LOB);
|
||||
echo "Fetching late bind:\n";
|
||||
while (($row = $stmt->fetch(PDO::FETCH_ASSOC))) {
|
||||
var_dump($row['blobid']);
|
||||
var_dump(is_int($row['bloboid']));
|
||||
}
|
||||
echo "Fetched!\n";
|
||||
|
||||
/* Try again, with NO bind */
|
||||
$stmt = $db->prepare("SELECT * from test");
|
||||
$stmt->execute();
|
||||
$stmt->bindColumn('bloboid', $lob, PDO::PARAM_LOB);
|
||||
echo "Fetching NO bind:\n";
|
||||
while (($row = $stmt->fetch(PDO::FETCH_ASSOC))) {
|
||||
var_dump($row['blobid']);
|
||||
var_dump(is_int($row['bloboid']));
|
||||
}
|
||||
echo "Fetched!\n";
|
||||
|
||||
} catch (Exception $e) {
|
||||
/* catch exceptions so that we can guarantee to clean
|
||||
* up the LOB */
|
||||
@@ -53,9 +76,18 @@ echo "Fetched!\n";
|
||||
* linger and clutter up the storage */
|
||||
$db->pgsqlLOBUnlink($oid);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Fetching:
|
||||
int(1)
|
||||
string(11) "Hello dude
|
||||
"
|
||||
Fetched!
|
||||
Fetching late bind:
|
||||
int(1)
|
||||
bool(true)
|
||||
Fetched!
|
||||
Fetching NO bind:
|
||||
int(1)
|
||||
bool(true)
|
||||
Fetched!
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
session object serialization
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--INI--
|
||||
session.use_cookies=0
|
||||
session.cache_limiter=
|
||||
session.serialize_handler=php
|
||||
session.save_handler=files
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class foo {
|
||||
public $bar = "ok";
|
||||
|
||||
function method() { $this->yes = "done"; }
|
||||
}
|
||||
|
||||
$baz = new foo;
|
||||
$baz->method();
|
||||
|
||||
$arr[3] = new foo;
|
||||
$arr[3]->method();
|
||||
session_start();
|
||||
$_SESSION["baz"] = $baz;
|
||||
$_SESSION["arr"] = $arr;
|
||||
var_dump(session_encode());
|
||||
session_destroy();
|
||||
?>
|
||||
--EXPECT--
|
||||
string(126) "baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}}"
|
||||
+11
-1
@@ -4187,7 +4187,17 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
|
||||
/*style = SOAP_RPC;*/
|
||||
if (style == SOAP_RPC) {
|
||||
ns = encode_add_ns(body, uri);
|
||||
method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL);
|
||||
if (function_name) {
|
||||
method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL);
|
||||
} else if (function && function->requestName) {
|
||||
method = xmlNewChild(body, ns, BAD_CAST(function->requestName), NULL);
|
||||
} else if (function && function->functionName) {
|
||||
method = xmlNewChild(body, ns, BAD_CAST(function->functionName), NULL);
|
||||
} else {
|
||||
method = body;
|
||||
}
|
||||
} else {
|
||||
method = body;
|
||||
}
|
||||
|
||||
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "use", sizeof("use"), (void **)&zuse) == SUCCESS &&
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #47049 (SoapClient::__soapCall causes a segmentation fault)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--INI--
|
||||
soap.wsdl_cache_enabled=0
|
||||
--FILE--
|
||||
<?php
|
||||
$client = new SoapClient(dirname(__FILE__) . '/bug47049.wsdl',
|
||||
array('trace' => 1 , 'exceptions' => 0));
|
||||
$host = array('uuid' => 'foo');
|
||||
$software_list = array(array('name' => 'package', 'version' => '1.2.3', 'state' => 'installed'));
|
||||
$updates = array();
|
||||
$report_id = $client->__soapCall('reportSoftwareStatus',array($host, $software_list, $updates));
|
||||
echo $client->__getLastRequest();
|
||||
?>
|
||||
--EXPECT--
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/reporter/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:reportSoftwareStatus><host xsi:type="ns1:host"><uuid xsi:type="xsd:string">foo</uuid></host><software_list xsi:type="ns1:software_list"><software xsi:type="ns1:software"><name xsi:type="xsd:string">package</name><version xsi:type="xsd:string">1.2.3</version><state xsi:type="xsd:string">installed</state></software></software_list><updates xsi:type="ns1:updates"/></ns1:reportSoftwareStatus></SOAP-ENV:Body></SOAP-ENV:Envelope>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.example.org/reporter/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="reporter" targetNamespace="http://www.example.org/reporter/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/reporter/">
|
||||
<xsd:complexType name="host">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="uuid" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="software_list">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="software" type="tns:software"
|
||||
maxOccurs="unbounded" minOccurs="1">
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="software">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="name" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
|
||||
<xsd:element name="version" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
|
||||
<xsd:element name="state" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="updates">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="update" type="tns:update"
|
||||
maxOccurs="unbounded" minOccurs="0">
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="update">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="software" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="old_version" type="xsd:string"></xsd:element>
|
||||
<xsd:element name="new_version" type="xsd:string"></xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
</xsd:schema></wsdl:types>
|
||||
<wsdl:message name="reportSoftwareStatusRequest">
|
||||
<wsdl:part name="host" type="tns:host"/>
|
||||
<wsdl:part name="software_list" type="tns:software_list"></wsdl:part>
|
||||
<wsdl:part name="updates" type="tns:updates"></wsdl:part>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="reportSoftwareStatusResponse">
|
||||
<wsdl:part name="report_id" type="xsd:int"/>
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="reporter">
|
||||
<wsdl:operation name="reportSoftwareStatus">
|
||||
<wsdl:input message="tns:reportSoftwareStatusRequest"/>
|
||||
<wsdl:output message="tns:reportSoftwareStatusResponse"/>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="reporterHTTP" type="tns:reporter">
|
||||
|
||||
<soap:binding style="document"
|
||||
transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="reportSoftwareStatus">
|
||||
|
||||
<soap:operation
|
||||
soapAction="http://www.example.org/reporter/reportSoftwareStatus" />
|
||||
<wsdl:input>
|
||||
|
||||
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
|
||||
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="reporter">
|
||||
<wsdl:port binding="tns:reporterHTTP" name="reporterHTTP">
|
||||
<http:address location="test://"/>
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
|
||||
</wsdl:definitions>
|
||||
@@ -1078,7 +1078,7 @@ addToInt:
|
||||
} else if (numVars) {
|
||||
current = args[objIndex++];
|
||||
zval_dtor(*current);
|
||||
Z_LVAL(**current) = value;
|
||||
ZVAL_LONG(*current, value);
|
||||
} else {
|
||||
add_index_long(*return_value, objIndex++, value);
|
||||
}
|
||||
@@ -1183,7 +1183,7 @@ addToFloat:
|
||||
} else if (numVars) {
|
||||
current = args[objIndex++];
|
||||
zval_dtor(*current);
|
||||
Z_DVAL_PP( current ) = dvalue;
|
||||
ZVAL_DOUBLE(*current, dvalue);
|
||||
} else {
|
||||
add_index_double( *return_value, objIndex++, dvalue );
|
||||
}
|
||||
|
||||
@@ -1949,14 +1949,14 @@ PHP_FUNCTION(strrpos)
|
||||
|
||||
if (offset >= 0) {
|
||||
if (offset > haystack_len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
p = haystack + offset;
|
||||
e = haystack + haystack_len - needle_len;
|
||||
} else {
|
||||
if (-offset > haystack_len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -2025,7 +2025,7 @@ PHP_FUNCTION(strripos)
|
||||
Can also avoid tolower emallocs */
|
||||
if (offset >= 0) {
|
||||
if (offset > haystack_len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
p = haystack + offset;
|
||||
@@ -2033,7 +2033,7 @@ PHP_FUNCTION(strripos)
|
||||
} else {
|
||||
p = haystack;
|
||||
if (-offset > haystack_len || offset < -INT_MAX) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
e = haystack + haystack_len + offset;
|
||||
@@ -2058,7 +2058,7 @@ PHP_FUNCTION(strripos)
|
||||
if (offset > haystack_len) {
|
||||
efree(needle_dup);
|
||||
efree(haystack_dup);
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
p = haystack_dup + offset;
|
||||
@@ -2067,7 +2067,7 @@ PHP_FUNCTION(strripos)
|
||||
if (-offset > haystack_len || offset < -INT_MAX) {
|
||||
efree(needle_dup);
|
||||
efree(haystack_dup);
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
p = haystack_dup;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,159 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 10
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (1 => 1, 2 => 2, 3 => 3);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
|
||||
[3]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 11
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (0 => 0, 3 => 2);
|
||||
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[3]=>
|
||||
int(2)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[3]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[3]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 12
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (1 => 1, 5 => 2, 8 => 3);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[1]=>
|
||||
int(1)
|
||||
[5]=>
|
||||
int(2)
|
||||
[8]=>
|
||||
int(3)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[5]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[8]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[1]=>
|
||||
int(1)
|
||||
[5]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[8]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
|
||||
[3]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[1]=>
|
||||
int(1)
|
||||
[5]=>
|
||||
int(2)
|
||||
[8]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 13
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (1, 2);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 14
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (0, 1, 2);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
|
||||
[3]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 15
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (1, 2, 3);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
|
||||
[3]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 16
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (0, 1, 2, 3);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(4) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
|
||||
[3]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
|
||||
[4]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 17
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (1, 2, 3, 4);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(4) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[3]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
|
||||
[3]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[3]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
|
||||
[4]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 18
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (0, 1, 2, 3, 4);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
[4]=>
|
||||
int(4)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(5) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
[4]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
[4]=>
|
||||
array(1) {
|
||||
[4]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
[4]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[4]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
|
||||
[3]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[3]=>
|
||||
int(3)
|
||||
[4]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
|
||||
[4]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[4]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
|
||||
[5]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
[4]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
[4]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
[4]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 21
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array ("a" => 1);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["a"]=>
|
||||
int(1)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 22
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array ("b" => 1, "c" => 2);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["b"]=>
|
||||
int(1)
|
||||
["c"]=>
|
||||
int(2)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
["b"]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
["c"]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
["b"]=>
|
||||
int(1)
|
||||
["c"]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,441 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 23
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array ("p" => 1, "q" => 2, "r" => 3, "s" => 4, "u" => 5, "v" => 6);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(6) {
|
||||
["p"]=>
|
||||
int(1)
|
||||
["q"]=>
|
||||
int(2)
|
||||
["r"]=>
|
||||
int(3)
|
||||
["s"]=>
|
||||
int(4)
|
||||
["u"]=>
|
||||
int(5)
|
||||
["v"]=>
|
||||
int(6)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(6) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
[4]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(5)
|
||||
}
|
||||
[5]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(6) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
["p"]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
["q"]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
["r"]=>
|
||||
int(3)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
["s"]=>
|
||||
int(4)
|
||||
}
|
||||
[4]=>
|
||||
array(1) {
|
||||
["u"]=>
|
||||
int(5)
|
||||
}
|
||||
[5]=>
|
||||
array(1) {
|
||||
["v"]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(6) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
[4]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(5)
|
||||
}
|
||||
[5]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(4)
|
||||
}
|
||||
[2]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(5)
|
||||
[1]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
["p"]=>
|
||||
int(1)
|
||||
["q"]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
["r"]=>
|
||||
int(3)
|
||||
["s"]=>
|
||||
int(4)
|
||||
}
|
||||
[2]=>
|
||||
array(2) {
|
||||
["u"]=>
|
||||
int(5)
|
||||
["v"]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(4)
|
||||
}
|
||||
[2]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(5)
|
||||
[1]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
|
||||
[3]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(4)
|
||||
[1]=>
|
||||
int(5)
|
||||
[2]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["p"]=>
|
||||
int(1)
|
||||
["q"]=>
|
||||
int(2)
|
||||
["r"]=>
|
||||
int(3)
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
["s"]=>
|
||||
int(4)
|
||||
["u"]=>
|
||||
int(5)
|
||||
["v"]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(4)
|
||||
[1]=>
|
||||
int(5)
|
||||
[2]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
|
||||
[4]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(5)
|
||||
[1]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
["p"]=>
|
||||
int(1)
|
||||
["q"]=>
|
||||
int(2)
|
||||
["r"]=>
|
||||
int(3)
|
||||
["s"]=>
|
||||
int(4)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
["u"]=>
|
||||
int(5)
|
||||
["v"]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(5)
|
||||
[1]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
|
||||
[5]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(5) {
|
||||
["p"]=>
|
||||
int(1)
|
||||
["q"]=>
|
||||
int(2)
|
||||
["r"]=>
|
||||
int(3)
|
||||
["s"]=>
|
||||
int(4)
|
||||
["u"]=>
|
||||
int(5)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
["v"]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
|
||||
[6]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
[5]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["p"]=>
|
||||
int(1)
|
||||
["q"]=>
|
||||
int(2)
|
||||
["r"]=>
|
||||
int(3)
|
||||
["s"]=>
|
||||
int(4)
|
||||
["u"]=>
|
||||
int(5)
|
||||
["v"]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
[5]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 24
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array ("a" => "A");
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["a"]=>
|
||||
string(1) "A"
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
string(1) "A"
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,441 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 25
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array ("p" => "A", "q" => "B", "r" => "C", "s" => "D", "u" => "E", "v" => "F");
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(6) {
|
||||
["p"]=>
|
||||
string(1) "A"
|
||||
["q"]=>
|
||||
string(1) "B"
|
||||
["r"]=>
|
||||
string(1) "C"
|
||||
["s"]=>
|
||||
string(1) "D"
|
||||
["u"]=>
|
||||
string(1) "E"
|
||||
["v"]=>
|
||||
string(1) "F"
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(6) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "B"
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "C"
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "D"
|
||||
}
|
||||
[4]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "E"
|
||||
}
|
||||
[5]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(6) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
["p"]=>
|
||||
string(1) "A"
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
["q"]=>
|
||||
string(1) "B"
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
["r"]=>
|
||||
string(1) "C"
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
["s"]=>
|
||||
string(1) "D"
|
||||
}
|
||||
[4]=>
|
||||
array(1) {
|
||||
["u"]=>
|
||||
string(1) "E"
|
||||
}
|
||||
[5]=>
|
||||
array(1) {
|
||||
["v"]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(6) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "B"
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "C"
|
||||
}
|
||||
[3]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "D"
|
||||
}
|
||||
[4]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "E"
|
||||
}
|
||||
[5]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(1) "B"
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(1) "C"
|
||||
[1]=>
|
||||
string(1) "D"
|
||||
}
|
||||
[2]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(1) "E"
|
||||
[1]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
["p"]=>
|
||||
string(1) "A"
|
||||
["q"]=>
|
||||
string(1) "B"
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
["r"]=>
|
||||
string(1) "C"
|
||||
["s"]=>
|
||||
string(1) "D"
|
||||
}
|
||||
[2]=>
|
||||
array(2) {
|
||||
["u"]=>
|
||||
string(1) "E"
|
||||
["v"]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(1) "B"
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(1) "C"
|
||||
[1]=>
|
||||
string(1) "D"
|
||||
}
|
||||
[2]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(1) "E"
|
||||
[1]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
|
||||
[3]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(1) "B"
|
||||
[2]=>
|
||||
string(1) "C"
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "D"
|
||||
[1]=>
|
||||
string(1) "E"
|
||||
[2]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["p"]=>
|
||||
string(1) "A"
|
||||
["q"]=>
|
||||
string(1) "B"
|
||||
["r"]=>
|
||||
string(1) "C"
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
["s"]=>
|
||||
string(1) "D"
|
||||
["u"]=>
|
||||
string(1) "E"
|
||||
["v"]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(1) "B"
|
||||
[2]=>
|
||||
string(1) "C"
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "D"
|
||||
[1]=>
|
||||
string(1) "E"
|
||||
[2]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
|
||||
[4]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(1) "B"
|
||||
[2]=>
|
||||
string(1) "C"
|
||||
[3]=>
|
||||
string(1) "D"
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(1) "E"
|
||||
[1]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
["p"]=>
|
||||
string(1) "A"
|
||||
["q"]=>
|
||||
string(1) "B"
|
||||
["r"]=>
|
||||
string(1) "C"
|
||||
["s"]=>
|
||||
string(1) "D"
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
["u"]=>
|
||||
string(1) "E"
|
||||
["v"]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(1) "B"
|
||||
[2]=>
|
||||
string(1) "C"
|
||||
[3]=>
|
||||
string(1) "D"
|
||||
}
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(1) "E"
|
||||
[1]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
|
||||
[5]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(1) "B"
|
||||
[2]=>
|
||||
string(1) "C"
|
||||
[3]=>
|
||||
string(1) "D"
|
||||
[4]=>
|
||||
string(1) "E"
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(5) {
|
||||
["p"]=>
|
||||
string(1) "A"
|
||||
["q"]=>
|
||||
string(1) "B"
|
||||
["r"]=>
|
||||
string(1) "C"
|
||||
["s"]=>
|
||||
string(1) "D"
|
||||
["u"]=>
|
||||
string(1) "E"
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
["v"]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(5) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(1) "B"
|
||||
[2]=>
|
||||
string(1) "C"
|
||||
[3]=>
|
||||
string(1) "D"
|
||||
[4]=>
|
||||
string(1) "E"
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
|
||||
[6]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(1) "B"
|
||||
[2]=>
|
||||
string(1) "C"
|
||||
[3]=>
|
||||
string(1) "D"
|
||||
[4]=>
|
||||
string(1) "E"
|
||||
[5]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["p"]=>
|
||||
string(1) "A"
|
||||
["q"]=>
|
||||
string(1) "B"
|
||||
["r"]=>
|
||||
string(1) "C"
|
||||
["s"]=>
|
||||
string(1) "D"
|
||||
["u"]=>
|
||||
string(1) "E"
|
||||
["v"]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
[0]=>
|
||||
string(1) "A"
|
||||
[1]=>
|
||||
string(1) "B"
|
||||
[2]=>
|
||||
string(1) "C"
|
||||
[3]=>
|
||||
string(1) "D"
|
||||
[4]=>
|
||||
string(1) "E"
|
||||
[5]=>
|
||||
string(1) "F"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 26
|
||||
--FILE--
|
||||
<?php
|
||||
$array =array (0);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 27
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (1);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 28
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (-1);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(-1)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(-1)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(-1)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(-1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 29
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (0, 2);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 30
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (1, 2, 3);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
[2]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
|
||||
[3]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 31
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (1 => 0);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(0)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(0)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 32
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (2 => 1);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 8
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (3 => -1);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[3]=>
|
||||
int(-1)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(-1)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[3]=>
|
||||
int(-1)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(-1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
--TEST--
|
||||
array_chunk() - variation 9
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array (1 => 0, 2 => 2);
|
||||
var_dump ($array);
|
||||
for ($i = 0; $i < (sizeof($array) + 1); $i++) {
|
||||
echo "[$i]\n";
|
||||
var_dump (@array_chunk ($array, $i));
|
||||
var_dump (@array_chunk ($array, $i, TRUE));
|
||||
var_dump (@array_chunk ($array, $i, FALSE));
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[1]=>
|
||||
int(0)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
[0]
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
[1]
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
|
||||
[2]
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[1]=>
|
||||
int(0)
|
||||
[2]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,12 @@ $outFile = "mailBasic2.out";
|
||||
echo "-- extra parameters --\n";
|
||||
// Calling mail() with all possible arguments
|
||||
var_dump( mail($to, $subject, $message, $additional_headers, $additional_parameters) );
|
||||
sleep(1);
|
||||
|
||||
//This test is just using a shell command (see the INI setting). The sleep()
|
||||
//is used because that can take a while. If you see the test failing sometimes try
|
||||
//increasing the length of the sleep.
|
||||
|
||||
sleep(5);
|
||||
echo file_get_contents($outFile);
|
||||
//unlink($outFile);
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Test mail() function : basic functionality
|
||||
--INI--
|
||||
sendmail_path="exit -1"
|
||||
sendmail_path="exit 1"
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(substr(PHP_OS, 0, 3) == "WIN")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Test mail() function : basic functionality
|
||||
--INI--
|
||||
sendmail_path="exit -2"
|
||||
sendmail_path="exit 1"
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(substr(PHP_OS, 0, 3) == "WIN")
|
||||
|
||||
@@ -53,10 +53,10 @@ bool(false)
|
||||
Warning: stripos(): Offset not contained in string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
int(2)
|
||||
string(8) "abcdeabc"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #47322 (sscanf %d does't work)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
sscanf(":59:58","%s:%d:%f", $a, $b, $c);
|
||||
echo "[$a][$b][$c]\n";
|
||||
|
||||
sscanf("15:01:58.2","%d:%f:%f", $a, $b, $c);
|
||||
echo "[$a][$b][$c]\n";
|
||||
|
||||
sscanf("15.1111::foo","%f:%d:%s", $a, $b, $c);
|
||||
echo "[$a][$b][$c]\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
[:59:58][][]
|
||||
[15][1][58.2]
|
||||
[15.1111][1][58.2]
|
||||
@@ -16,30 +16,30 @@ var_dump(strripos(1024, "te", -PHP_INT_MAX-1));
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: strripos() expects parameter 1 to be string, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
@@ -92,7 +92,7 @@ int(6)
|
||||
int(6)
|
||||
-- Iteration 3 --
|
||||
|
||||
Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
-- Iteration 4 --
|
||||
int(6)
|
||||
|
||||
@@ -94,23 +94,23 @@ bool(false)
|
||||
bool(false)
|
||||
-- Iteration 3 --
|
||||
|
||||
Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
-- Iteration 4 --
|
||||
|
||||
Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
-- Iteration 5 --
|
||||
|
||||
Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
-- Iteration 6 --
|
||||
|
||||
Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
-- Iteration 7 --
|
||||
|
||||
Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
|
||||
bool(false)
|
||||
-- Iteration 8 --
|
||||
bool(false)
|
||||
|
||||
@@ -29,11 +29,11 @@ string(125) "<?xml version="1.0" encoding="utf-8"?>
|
||||
</param>
|
||||
</params>
|
||||
"
|
||||
string(128) "<?xml version="1.0" encoding="utf-8"?>
|
||||
string(130) "<?xml version="1.0" encoding="utf-8"?>
|
||||
<params>
|
||||
<param>
|
||||
<value>
|
||||
<double>11234567891000</double>
|
||||
<double>1.1234567891E+13</double>
|
||||
</value>
|
||||
</param>
|
||||
</params>
|
||||
|
||||
@@ -26,7 +26,7 @@ xmlrpc_server_call_method ($server, $request, NULL, $options);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: xmlrpc_server_call_method(): Invalid callback 'foobar' passed in %s on line %d
|
||||
|
||||
|
||||
Warning: xmlrpc_server_call_method(): xml parse error: [line 1, column 1, message: Invalid document end] Unable to add introspection data returned from bar::test() in %s on line %d
|
||||
|
||||
Warning: xmlrpc_server_call_method(): Invalid callback 'foo::bar' passed in %s on line %d
|
||||
@@ -528,7 +528,9 @@ PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const c
|
||||
*end = '\0';
|
||||
end++;
|
||||
}
|
||||
snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename);
|
||||
if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) >= MAXPATHLEN) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN);
|
||||
}
|
||||
if (PG(safe_mode)) {
|
||||
if (VCWD_STAT(trypath, &sb) == 0) {
|
||||
/* file exists ... check permission */
|
||||
|
||||
+2
-2
@@ -3,6 +3,6 @@
|
||||
#define PHP_MAJOR_VERSION 5
|
||||
#define PHP_MINOR_VERSION 2
|
||||
#define PHP_RELEASE_VERSION 9
|
||||
#define PHP_EXTRA_VERSION "RC1"
|
||||
#define PHP_VERSION "5.2.9RC1"
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "5.2.9"
|
||||
#define PHP_VERSION_ID 50209
|
||||
@@ -1324,7 +1324,9 @@ not_relative_path:
|
||||
/* getcwd() will return always return [DRIVE_LETTER]:/) on windows. */
|
||||
*(cwd+3) = '\0';
|
||||
|
||||
snprintf(trypath, MAXPATHLEN, "%s%s", cwd, filename);
|
||||
if (snprintf(trypath, MAXPATHLEN, "%s%s", cwd, filename) >= MAXPATHLEN) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", cwd, filename, MAXPATHLEN);
|
||||
}
|
||||
|
||||
free(cwd);
|
||||
|
||||
@@ -1385,7 +1387,9 @@ not_relative_path:
|
||||
if (*ptr == '\0') {
|
||||
goto stream_skip;
|
||||
}
|
||||
snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename);
|
||||
if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) >= MAXPATHLEN) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN);
|
||||
}
|
||||
|
||||
if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir_ex(trypath, 0 TSRMLS_CC)) {
|
||||
goto stream_skip;
|
||||
|
||||
@@ -281,7 +281,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
|
||||
if (sock->socket == -1) {
|
||||
alive = 0;
|
||||
} else if (php_pollfd_for(sock->socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) {
|
||||
if (0 == recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EWOULDBLOCK) {
|
||||
if (0 >= recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EWOULDBLOCK) {
|
||||
alive = 0;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -302,7 +302,7 @@ memory_limit = 128M ; Maximum amount of memory a script may consume (128MB)
|
||||
;
|
||||
; - Show all errors except for notices and coding standards warnings
|
||||
;
|
||||
error_reporting = E_ALL & ~E_NOTICE
|
||||
error_reporting = E_ALL & ~E_NOTICE
|
||||
|
||||
; Print out errors (as a part of the output). For production web sites,
|
||||
; you're strongly encouraged to turn this feature off, and use error logging
|
||||
|
||||
Loaded 100 of 101 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user