1
0
mirror of https://github.com/php/php-src.git synced 2026-04-30 03:33:17 +02:00

fix tests: better float values

This commit is contained in:
Raghubansh Kumar
2007-11-09 07:29:18 +00:00
parent 22416fba09
commit 6079ffd434
14 changed files with 686 additions and 695 deletions
@@ -3,7 +3,7 @@ Test chunk_split() function : usage variations - with unexpected values for 'str
--FILE--
<?php
/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
* Description: Returns split line %d%d%d%d
* Description: Returns split line
* Source code: ext/standard/string.c
* Alias to functions: none
*/
@@ -33,58 +33,58 @@ $fp = fopen(__FILE__, 'r');
//different values for 'str'
$values = array(
// int data
0,
1,
12345,
-2345,
// int data
0,
1,
12345,
-2345,
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
.5,
// float data
10.5,
-10.5,
10.1234567e10,
10.7654321E-10,
.5,
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// array data
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
// null data
NULL,
null,
// null data
NULL,
null,
// boolean data
true,
false,
TRUE,
FALSE,
// boolean data
true,
false,
TRUE,
FALSE,
// empty data
"",
'',
// empty data
"",
'',
// string data
"string",
'string',
// string data
"string",
'string',
// object data
new MyClass(),
// object data
new MyClass(),
// undefined data
@$undefined_var,
// undefined data
@$undefined_var,
// unset data
@$unset_var,
// unset data
@$unset_var,
// resource data
$fp
// resource data
$fp
);
// loop through each element of the array for str
// loop through each element of the array for 'str'
for($count = 0; $count < count($values); $count++) {
echo "-- Iteration ".($count+1)." --\n";
var_dump( chunk_split($values[$count], $chunklen, $ending) );
@@ -111,30 +111,30 @@ string(6) "10 .5 "
-- Iteration 6 --
string(8) "-1 0. 5 "
-- Iteration 7 --
string(18) "10 50 00 00 00 00 "
string(18) "10 12 34 56 70 00 "
-- Iteration 8 --
string(11) "1. 06 E- 9 "
string(20) "1. 07 65 43 21 E- 9 "
-- Iteration 9 --
string(5) "0. 5 "
-- Iteration 10 --
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d%d
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration 11 --
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d%d
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration 12 --
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d%d
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration 13 --
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d%d
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration 14 --
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d%d
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration 15 --
string(1) " "
@@ -164,10 +164,9 @@ string(1) " "
string(1) " "
-- Iteration 28 --
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d%d
Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing chunk_split() : with unexpected values for 'str' argument ***
-- Iteration 1 --
@@ -183,9 +182,9 @@ unicode(6) "10 .5 "
-- Iteration 6 --
unicode(8) "-1 0. 5 "
-- Iteration 7 --
unicode(18) "10 50 00 00 00 00 "
unicode(18) "10 12 34 56 70 00 "
-- Iteration 8 --
unicode(11) "1. 06 E- 9 "
unicode(20) "1. 07 65 43 21 E- 9 "
-- Iteration 9 --
unicode(5) "0. 5 "
-- Iteration 10 --
@@ -1,11 +1,11 @@
--TEST--
Test chunk_split() function : usage variations - unexpected values for 'chunklen' argument
Test chunk_split() function : usage variations - unexpected values for 'chunklen' argument(Bug#42796)
--FILE--
<?php
/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
* Description: Returns split line
* Source code: ext/standard/string.c
* Alias to functions:
* Alias to functions: none
*/
echo "*** Testing chunk_split() : with unexpected values for 'chunklen' argument ***\n";
@@ -24,7 +24,7 @@ $fp = fopen(__FILE__, 'r');
//Class to get object variable
class MyClass
{
public function __tostring() {
public function __toString() {
return "object";
}
}
@@ -35,8 +35,8 @@ $values = array(
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array data
@@ -95,92 +95,93 @@ fclose($fp);
string(28) "This is ch*uklen vari*ation*"
-- Iteration 2 --
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 3 --
string(26) "This is chuklen variation*"
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 4 --
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 5 --
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 6 --
Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d%d
Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d
NULL
-- Iteration 7 --
Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d%d
Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d
NULL
-- Iteration 8 --
Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d%d
Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d
NULL
-- Iteration 9 --
Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d%d
Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d
NULL
-- Iteration 10 --
Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d%d
Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d
NULL
-- Iteration 11 --
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 12 --
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 13 --
string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
-- Iteration 14 --
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 15 --
string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
-- Iteration 16 --
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 17 --
Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d%d
Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 18 --
Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d%d
Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 19 --
Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d%d
Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 20 --
Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d%d
Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 21 --
Warning: chunk_split() expects parameter 2 to be long, object given in %s on line %d%d
Warning: chunk_split() expects parameter 2 to be long, object given in %s on line %d
NULL
-- Iteration 22 --
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 23 --
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 24 --
Warning: chunk_split() expects parameter 2 to be long, resource given in %s on line %d%d
Warning: chunk_split() expects parameter 2 to be long, resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing chunk_split() : with unexpected values for 'chunklen' argument ***
-- Iteration 1 --
@@ -190,7 +191,9 @@ unicode(28) "This is ch*uklen vari*ation*"
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 3 --
unicode(26) "This is chuklen variation*"
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 4 --
Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
@@ -24,7 +24,7 @@ $fp = fopen(__FILE__,'r');
//Class to get object variable
class MyClass
{
public function __tostring()
public function __toString()
{
return "object";
}
@@ -42,8 +42,8 @@ $values = array(
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
10.123456e10,
10.7654321E-10,
.5,
// array data
@@ -106,30 +106,30 @@ string(46) "This10.5 is 10.5simp10.5le s10.5trin10.5g.10.5"
-- Iteration 6 --
string(52) "This-10.5 is -10.5simp-10.5le s-10.5trin-10.5g.-10.5"
-- Iteration 7 --
string(94) "This105000000000 is 105000000000simp105000000000le s105000000000trin105000000000g.105000000000"
string(94) "This101234560000 is 101234560000simp101234560000le s101234560000trin101234560000g.101234560000"
-- Iteration 8 --
string(64) "This1.06E-9 is 1.06E-9simp1.06E-9le s1.06E-9trin1.06E-9g.1.06E-9"
string(100) "This1.07654321E-9 is 1.07654321E-9simp1.07654321E-9le s1.07654321E-9trin1.07654321E-9g.1.07654321E-9"
-- Iteration 9 --
string(40) "This0.5 is 0.5simp0.5le s0.5trin0.5g.0.5"
-- Iteration 10 --
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d%d
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration 11 --
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d%d
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration 12 --
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d%d
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration 13 --
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d%d
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration 14 --
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d%d
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration 15 --
string(22) "This is simple string."
@@ -155,10 +155,9 @@ string(22) "This is simple string."
string(22) "This is simple string."
-- Iteration 26 --
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), resource given in %s on line %d%d
Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing chunk_split() : unexpected values for 'ending' ***
-- Iteration 1 --
@@ -174,9 +173,9 @@ unicode(46) "This10.5 is 10.5simp10.5le s10.5trin10.5g.10.5"
-- Iteration 6 --
unicode(52) "This-10.5 is -10.5simp-10.5le s-10.5trin-10.5g.-10.5"
-- Iteration 7 --
unicode(94) "This105000000000 is 105000000000simp105000000000le s105000000000trin105000000000g.105000000000"
unicode(94) "This101234560000 is 101234560000simp101234560000le s101234560000trin101234560000g.101234560000"
-- Iteration 8 --
unicode(64) "This1.06E-9 is 1.06E-9simp1.06E-9le s1.06E-9trin1.06E-9g.1.06E-9"
unicode(100) "This1.07654321E-9 is 1.07654321E-9simp1.07654321E-9le s1.07654321E-9trin1.07654321E-9g.1.07654321E-9"
-- Iteration 9 --
unicode(40) "This0.5 is 0.5simp0.5le s0.5trin0.5g.0.5"
-- Iteration 10 --
+114 -90
View File
@@ -46,8 +46,8 @@ $values = array(
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array data
@@ -89,7 +89,8 @@ $values = array(
$count = 1;
foreach($values as $value) {
echo "\n-- Iteration $count --\n";
var_dump( crc32((binary)$value) );
var_dump( crc32($value) );
$count++;
};
// closing the resource
@@ -107,92 +108,101 @@ Notice: Undefined variable: unset_var in %s on line %d
-- Iteration 1 --
int(-186917087)
-- Iteration 1 --
-- Iteration 2 --
int(-2082672713)
-- Iteration 1 --
-- Iteration 3 --
int(-873121252)
-- Iteration 1 --
-- Iteration 4 --
int(1860518047)
-- Iteration 1 --
-- Iteration 5 --
int(269248583)
-- Iteration 1 --
-- Iteration 6 --
int(-834950157)
-- Iteration 1 --
int(-638440228)
-- Iteration 7 --
int(-965354630)
-- Iteration 1 --
int(-742287383)
-- Iteration 8 --
int(1376932222)
-- Iteration 1 --
-- Iteration 9 --
int(-2036403827)
-- Iteration 1 --
-- Iteration 10 --
Notice: Array to string conversion in %s on line %d
int(1624097203)
Warning: crc32() expects parameter 1 to be string, array given in %s on line %d
NULL
-- Iteration 1 --
-- Iteration 11 --
Notice: Array to string conversion in %s on line %d
int(1624097203)
Warning: crc32() expects parameter 1 to be string, array given in %s on line %d
NULL
-- Iteration 1 --
-- Iteration 12 --
Notice: Array to string conversion in %s on line %d
int(1624097203)
Warning: crc32() expects parameter 1 to be string, array given in %s on line %d
NULL
-- Iteration 1 --
-- Iteration 13 --
Notice: Array to string conversion in %s on line %d
int(1624097203)
Warning: crc32() expects parameter 1 to be string, array given in %s on line %d
NULL
-- Iteration 1 --
-- Iteration 14 --
Notice: Array to string conversion in %s on line %d
int(1624097203)
Warning: crc32() expects parameter 1 to be string, array given in %s on line %d
NULL
-- Iteration 1 --
int(0)
-- Iteration 15 --
-- Iteration 1 --
int(0)
Warning: crc32() expects parameter 1 to be strictly a binary string, null given in %s on line %d
NULL
-- Iteration 1 --
-- Iteration 16 --
Warning: crc32() expects parameter 1 to be strictly a binary string, null given in %s on line %d
NULL
-- Iteration 17 --
int(-2082672713)
-- Iteration 1 --
-- Iteration 18 --
int(0)
-- Iteration 1 --
-- Iteration 19 --
int(-2082672713)
-- Iteration 1 --
-- Iteration 20 --
int(0)
-- Iteration 1 --
-- Iteration 21 --
int(0)
-- Iteration 1 --
-- Iteration 22 --
int(0)
-- Iteration 1 --
-- Iteration 23 --
int(-1465013268)
-- Iteration 1 --
int(0)
-- Iteration 24 --
-- Iteration 1 --
int(0)
Warning: crc32() expects parameter 1 to be strictly a binary string, null given in %s on line %d
NULL
-- Iteration 1 --
int(716753449)
-- Iteration 25 --
Warning: crc32() expects parameter 1 to be strictly a binary string, null given in %s on line %d
NULL
-- Iteration 26 --
Warning: crc32() expects parameter 1 to be string, resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing crc32() : with unexpected values for str argument ***
@@ -203,88 +213,102 @@ Notice: Undefined variable: unset_var in %s on line %d
-- Iteration 1 --
int(-186917087)
-- Iteration 1 --
-- Iteration 2 --
int(-2082672713)
-- Iteration 1 --
-- Iteration 3 --
int(-873121252)
-- Iteration 1 --
-- Iteration 4 --
int(1860518047)
-- Iteration 1 --
-- Iteration 5 --
int(269248583)
-- Iteration 1 --
-- Iteration 6 --
int(-834950157)
-- Iteration 1 --
int(-638440228)
-- Iteration 7 --
int(-965354630)
-- Iteration 1 --
int(-742287383)
-- Iteration 8 --
int(1376932222)
-- Iteration 1 --
-- Iteration 9 --
int(-2036403827)
-- Iteration 1 --
-- Iteration 10 --
Notice: Array to string conversion in %s on line %d
int(1624097203)
Warning: crc32() expects parameter 1 to be binary string, array given in %s on line %d
NULL
-- Iteration 1 --
-- Iteration 11 --
Notice: Array to string conversion in %s on line %d
int(1624097203)
Warning: crc32() expects parameter 1 to be binary string, array given in %s on line %d
NULL
-- Iteration 1 --
-- Iteration 12 --
Notice: Array to string conversion in %s on line %d
int(1624097203)
Warning: crc32() expects parameter 1 to be binary string, array given in %s on line %d
NULL
-- Iteration 1 --
-- Iteration 13 --
Notice: Array to string conversion in %s on line %d
int(1624097203)
Warning: crc32() expects parameter 1 to be binary string, array given in %s on line %d
NULL
-- Iteration 1 --
-- Iteration 14 --
Notice: Array to string conversion in %s on line %d
int(1624097203)
Warning: crc32() expects parameter 1 to be binary string, array given in %s on line %d
NULL
-- Iteration 1 --
int(0)
-- Iteration 15 --
-- Iteration 1 --
int(0)
Warning: crc32() expects parameter 1 to be strictly a binary string, null given in %s on line %d
NULL
-- Iteration 1 --
-- Iteration 16 --
Warning: crc32() expects parameter 1 to be strictly a binary string, null given in %s on line %d
NULL
-- Iteration 17 --
int(-2082672713)
-- Iteration 1 --
-- Iteration 18 --
int(0)
-- Iteration 1 --
-- Iteration 19 --
int(-2082672713)
-- Iteration 1 --
-- Iteration 20 --
int(0)
-- Iteration 1 --
int(0)
-- Iteration 21 --
-- Iteration 1 --
int(0)
Warning: crc32() expects parameter 1 to be strictly a binary string, Unicode string given in %s on line %d
NULL
-- Iteration 1 --
-- Iteration 22 --
Warning: crc32() expects parameter 1 to be strictly a binary string, Unicode string given in %s on line %d
NULL
-- Iteration 23 --
int(-1465013268)
-- Iteration 1 --
int(0)
-- Iteration 24 --
-- Iteration 1 --
int(0)
Warning: crc32() expects parameter 1 to be strictly a binary string, null given in %s on line %d
NULL
-- Iteration 1 --
int(716753449)
-- Iteration 25 --
Warning: crc32() expects parameter 1 to be strictly a binary string, null given in %s on line %d
NULL
-- Iteration 26 --
Warning: crc32() expects parameter 1 to be binary string, resource given in %s on line %d
NULL
Done
@@ -9,6 +9,7 @@ Test strcspn() function : usage variations - unexpected values for str argument
* Alias to functions: none
*/
error_reporting(E_ALL & ~E_NOTICE);
/*
* Testing strspn() : with different unexpected values for str argument
@@ -49,8 +50,8 @@ $values = array(
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array data
@@ -90,7 +91,7 @@ $values = array(
// loop through each element of the array for str
foreach($values as $value) {
echo "\n-- Iteration with str value as \"$value\" \n";
echo "\n-- Iteration with str value as \"$value\"\n";
var_dump( strcspn($value,$mask) ); // with default args
var_dump( strcspn($value,$mask,$start) ); // with default len value
var_dump( strcspn($value,$mask,$start,$len) ); // with all args
@@ -104,58 +105,52 @@ echo "Done"
--EXPECTF--
*** Testing strcspn() : with unexpected values for str argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with str value as "0"
-- Iteration with str value as "0"
int(0)
int(0)
int(0)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(0)
int(0)
int(0)
-- Iteration with str value as "12345"
-- Iteration with str value as "12345"
int(0)
int(0)
int(0)
-- Iteration with str value as "-2345"
-- Iteration with str value as "-2345"
int(1)
int(0)
int(0)
-- Iteration with str value as "10.5"
-- Iteration with str value as "10.5"
int(0)
int(0)
int(0)
-- Iteration with str value as "-10.5"
-- Iteration with str value as "-10.5"
int(1)
int(0)
int(0)
-- Iteration with str value as "105000000000"
-- Iteration with str value as "101234567000"
int(0)
int(0)
int(0)
-- Iteration with str value as "1.06E-9"
-- Iteration with str value as "1.07654321E-9"
int(0)
int(1)
int(1)
-- Iteration with str value as "0.5"
-- Iteration with str value as "0.5"
int(0)
int(1)
int(1)
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -166,9 +161,7 @@ NULL
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -179,9 +172,7 @@ NULL
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -192,9 +183,7 @@ NULL
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -205,9 +194,7 @@ NULL
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -218,62 +205,62 @@ NULL
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(0)
int(0)
int(0)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(0)
int(0)
int(0)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "object"
-- Iteration with str value as "object"
int(0)
int(0)
int(0)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "Resource id #%d"
-- Iteration with str value as "Resource id #5"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
NULL
@@ -284,62 +271,55 @@ NULL
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing strcspn() : with unexpected values for str argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with str value as "0"
-- Iteration with str value as "0"
int(0)
int(0)
int(0)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(0)
int(0)
int(0)
-- Iteration with str value as "12345"
-- Iteration with str value as "12345"
int(0)
int(0)
int(0)
-- Iteration with str value as "-2345"
-- Iteration with str value as "-2345"
int(1)
int(0)
int(0)
-- Iteration with str value as "10.5"
-- Iteration with str value as "10.5"
int(0)
int(0)
int(0)
-- Iteration with str value as "-10.5"
-- Iteration with str value as "-10.5"
int(1)
int(0)
int(0)
-- Iteration with str value as "105000000000"
-- Iteration with str value as "101234567000"
int(0)
int(0)
int(0)
-- Iteration with str value as "1.06E-9"
-- Iteration with str value as "1.07654321E-9"
int(0)
int(1)
int(1)
-- Iteration with str value as "0.5"
-- Iteration with str value as "0.5"
int(0)
int(1)
int(1)
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -350,9 +330,7 @@ NULL
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -363,9 +341,7 @@ NULL
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -376,9 +352,7 @@ NULL
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -389,9 +363,7 @@ NULL
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -402,62 +374,62 @@ NULL
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(0)
int(0)
int(0)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(0)
int(0)
int(0)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "object"
-- Iteration with str value as "object"
int(0)
int(0)
int(0)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "Resource id #%d"
-- Iteration with str value as "Resource id #5"
Warning: strcspn() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
NULL
@@ -9,6 +9,8 @@ Test strcspn() function : usage variations - unexpected values for mask argument
* Alias to functions: none
*/
error_reporting(E_ALL & ~E_NOTICE);
/*
* Testing strcspn() : with different unexpected values for mask argument
*/
@@ -47,8 +49,8 @@ $values = array(
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array data
@@ -88,7 +90,7 @@ $values = array(
// loop through each element of the array for mask
foreach($values as $value) {
echo "\n-- Iteration with mask value as \"$value\" -- \n";
echo "\n-- Iteration with mask value as \"$value\" --\n";
var_dump( strcspn($str,$value) ); // with defalut args
var_dump( strcspn($str,$value,$start) ); // with default len value
var_dump( strcspn($str,$value,$start,$len) ); // with all args
@@ -102,58 +104,52 @@ echo "Done"
--EXPECTF--
*** Testing strcspn() : with diferent unexpected values of mask argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with mask value as "0" --
-- Iteration with mask value as "0" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "1" --
-- Iteration with mask value as "1" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "12345" --
-- Iteration with mask value as "12345" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "-2345" --
-- Iteration with mask value as "-2345" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "10.5" --
-- Iteration with mask value as "10.5" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "-10.5" --
-- Iteration with mask value as "-10.5" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "105000000000" --
-- Iteration with mask value as "101234567000" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "1.06E-9" --
-- Iteration with mask value as "1.07654321E-9" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "0.5" --
-- Iteration with mask value as "0.5" --
int(10)
int(9)
int(9)
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -164,9 +160,7 @@ NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -177,9 +171,7 @@ NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -190,9 +182,7 @@ NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -203,9 +193,7 @@ NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -216,62 +204,231 @@ NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "1" --
-- Iteration with mask value as "1" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "1" --
-- Iteration with mask value as "1" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "object" --
-- Iteration with mask value as "object" --
int(1)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "Resource id #%d" --
-- Iteration with mask value as "Resource id #5" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), resource given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), resource given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing strcspn() : with diferent unexpected values of mask argument ***
-- Iteration with mask value as "0" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "1" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "12345" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "-2345" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "10.5" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "-10.5" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "101234567000" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "1.07654321E-9" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "0.5" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "Array" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with mask value as "Array" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with mask value as "Array" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with mask value as "Array" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with mask value as "Array" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "1" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "1" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "object" --
int(1)
int(0)
int(0)
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "" --
int(10)
int(9)
int(9)
-- Iteration with mask value as "Resource id #5" --
Warning: strcspn() expects parameter 2 to be string (Unicode or binary), resource given in %s on line %d
NULL
@@ -2,13 +2,15 @@
Test strcspn() function : usage variations - unexpected values of start argument
--FILE--
<?php
/* Prototype : proto int strcspn(string str, string mask [, start [, len]])
/* Prototype : proto int strcspn(string str, string mask [,int start [,int len]])
* Description: Finds length of initial segment consisting entirely of characters not found in mask.
If start or/and length is provided works like strcspn(substr($s,$start,$len),$bad_chars)
* Source code: ext/standard/string.c
* Alias to functions: none
*/
error_reporting(E_ALL & ~E_NOTICE);
/*
* Testing strcspn() : with unexpected values of start argument
*/
@@ -41,8 +43,8 @@ $values = array(
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array data
@@ -99,10 +101,6 @@ echo "Done"
--EXPECTF--
*** Testing strcspn() : with unexpected values of start argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with start value as "10.5" --
int(0)
int(0)
@@ -111,11 +109,11 @@ int(0)
int(0)
int(0)
-- Iteration with start value as "105000000000" --
bool(false)
bool(false)
-- Iteration with start value as "101234567000" --
int(0)
int(0)
-- Iteration with start value as "1.06E-9" --
-- Iteration with start value as "1.07654321E-9" --
int(0)
int(0)
@@ -123,7 +121,13 @@ int(0)
int(0)
int(0)
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strcspn() expects parameter 3 to be long, array given in %s on line 89
NULL
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
-- Iteration with start value as "Array" --
@@ -133,8 +137,6 @@ NULL
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
@@ -143,8 +145,6 @@ NULL
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
@@ -153,18 +153,6 @@ NULL
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
@@ -253,14 +241,9 @@ NULL
Warning: strcspn() expects parameter 3 to be long, resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing strcspn() : with unexpected values of start argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with start value as "10.5" --
int(0)
int(0)
@@ -269,11 +252,11 @@ int(0)
int(0)
int(0)
-- Iteration with start value as "105000000000" --
bool(false)
bool(false)
-- Iteration with start value as "101234567000" --
int(0)
int(0)
-- Iteration with start value as "1.06E-9" --
-- Iteration with start value as "1.07654321E-9" --
int(0)
int(0)
@@ -281,7 +264,13 @@ int(0)
int(0)
int(0)
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
-- Iteration with start value as "Array" --
@@ -291,8 +280,6 @@ NULL
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
@@ -301,8 +288,6 @@ NULL
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
@@ -311,18 +296,6 @@ NULL
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strcspn() expects parameter 3 to be long, array given in %s on line %d
@@ -403,7 +376,7 @@ int(0)
int(0)
int(0)
-- Iteration with start value as "Resource id #%d" --
-- Iteration with start value as "Resource id #5" --
Warning: strcspn() expects parameter 3 to be long, resource given in %s on line %d
NULL
@@ -9,6 +9,8 @@ Test strcspn() function : usage variations - unexpected values of len argument
* Alias to functions: none
*/
error_reporting(E_ALL & ~E_NOTICE);
/*
* Testing strcspn() : with unexpected values of len argument
*/
@@ -41,8 +43,8 @@ $values = array(
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array data
@@ -98,55 +100,41 @@ echo "Done"
--EXPECTF--
*** Testing strcspn() : with unexpected values of len argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with len value as "10.5" --
int(0)
-- Iteration with len value as "-10.5" --
int(0)
-- Iteration with len value as "105000000000" --
-- Iteration with len value as "101234567000" --
int(0)
-- Iteration with len value as "1.06E-9" --
-- Iteration with len value as "1.07654321E-9" --
int(0)
-- Iteration with len value as "0.5" --
int(0)
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
NULL
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
@@ -206,59 +194,44 @@ int(0)
Warning: strcspn() expects parameter 4 to be long, resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing strcspn() : with unexpected values of len argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with len value as "10.5" --
int(0)
-- Iteration with len value as "-10.5" --
int(0)
-- Iteration with len value as "105000000000" --
-- Iteration with len value as "101234567000" --
int(0)
-- Iteration with len value as "1.06E-9" --
-- Iteration with len value as "1.07654321E-9" --
int(0)
-- Iteration with len value as "0.5" --
int(0)
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
NULL
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strcspn() expects parameter 4 to be long, array given in %s on line %d
@@ -313,7 +286,7 @@ int(0)
-- Iteration with len value as "" --
int(0)
-- Iteration with len value as "Resource id #%d" --
-- Iteration with len value as "Resource id #5" --
Warning: strcspn() expects parameter 4 to be long, resource given in %s on line %d
NULL
@@ -2,13 +2,15 @@
Test strspn() function : usage variations - unexpected values for str argument
--FILE--
<?php
/* Prototype : int strspn(string str, string mask [, int start [, int len]])
/* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
* Description: Finds length of initial segment consisting entirely of characters found in mask.
If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)
* Source code: ext/standard/string.c
* Alias to functions: none
*/
error_reporting(E_ALL & ~E_NOTICE);
/*
* Testing strspn() : with different unexpected values for str argument
*/
@@ -48,8 +50,8 @@ $values = array(
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array data
@@ -89,7 +91,7 @@ $values = array(
// loop through each element of the array for str
foreach($values as $value) {
echo "\n-- Iteration with str value as \"$value\" \n";
echo "\n-- Iteration with str value as \"$value\"\n";
var_dump( strspn($value,$mask) ); // with default args
var_dump( strspn($value,$mask,$start) ); // with default len value
var_dump( strspn($value,$mask,$start,$len) ); // with all args
@@ -103,58 +105,52 @@ echo "Done"
--EXPECTF--
*** Testing strspn() : with unexpected values for str argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with str value as "0"
-- Iteration with str value as "0"
int(1)
int(0)
int(0)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(1)
int(0)
int(0)
-- Iteration with str value as "12345"
-- Iteration with str value as "12345"
int(5)
int(4)
int(4)
-- Iteration with str value as "-2345"
-- Iteration with str value as "-2345"
int(0)
int(4)
int(4)
-- Iteration with str value as "10.5"
-- Iteration with str value as "10.5"
int(2)
int(1)
int(1)
-- Iteration with str value as "-10.5"
-- Iteration with str value as "-10.5"
int(0)
int(2)
int(2)
-- Iteration with str value as "105000000000"
-- Iteration with str value as "101234567000"
int(12)
int(11)
int(10)
-- Iteration with str value as "1.06E-9"
-- Iteration with str value as "1.07654321E-9"
int(1)
int(0)
int(0)
-- Iteration with str value as "0.5"
-- Iteration with str value as "0.5"
int(1)
int(0)
int(0)
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -165,9 +161,7 @@ NULL
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -178,9 +172,7 @@ NULL
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -191,9 +183,7 @@ NULL
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -204,9 +194,7 @@ NULL
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -217,62 +205,62 @@ NULL
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(1)
int(0)
int(0)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(1)
int(0)
int(0)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "object"
-- Iteration with str value as "object"
int(2)
int(1)
int(1)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "Resource id #%d"
-- Iteration with str value as "Resource id #%d"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
NULL
@@ -283,62 +271,55 @@ NULL
Warning: strspn() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing strspn() : with unexpected values for str argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with str value as "0"
-- Iteration with str value as "0"
int(1)
int(0)
int(0)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(1)
int(0)
int(0)
-- Iteration with str value as "12345"
-- Iteration with str value as "12345"
int(5)
int(4)
int(4)
-- Iteration with str value as "-2345"
-- Iteration with str value as "-2345"
int(0)
int(4)
int(4)
-- Iteration with str value as "10.5"
-- Iteration with str value as "10.5"
int(2)
int(1)
int(1)
-- Iteration with str value as "-10.5"
-- Iteration with str value as "-10.5"
int(0)
int(2)
int(2)
-- Iteration with str value as "105000000000"
-- Iteration with str value as "101234567000"
int(12)
int(11)
int(10)
-- Iteration with str value as "1.06E-9"
-- Iteration with str value as "1.07654321E-9"
int(1)
int(0)
int(0)
-- Iteration with str value as "0.5"
-- Iteration with str value as "0.5"
int(1)
int(0)
int(0)
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -349,9 +330,7 @@ NULL
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -362,9 +341,7 @@ NULL
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -375,9 +352,7 @@ NULL
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -388,9 +363,7 @@ NULL
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with str value as "Array"
-- Iteration with str value as "Array"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -401,62 +374,62 @@ NULL
Warning: strspn() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(1)
int(0)
int(0)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "1"
-- Iteration with str value as "1"
int(1)
int(0)
int(0)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "object"
-- Iteration with str value as "object"
int(2)
int(1)
int(1)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as ""
-- Iteration with str value as ""
int(0)
bool(false)
bool(false)
-- Iteration with str value as "Resource id #%d"
-- Iteration with str value as "Resource id #%d"
Warning: strspn() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
NULL
@@ -2,13 +2,15 @@
Test strspn() function : usage variations - unexpected values for mask argument
--FILE--
<?php
/* Prototype : int strspn(string str, string mask [, int start [, int len]])
/* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
* Description: Finds length of initial segment consisting entirely of characters found in mask.
If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)
* Source code: ext/standard/string.c
* Alias to functions: none
*/
error_reporting(E_ALL & ~E_NOTICE);
/*
* Testing strspn() : with different unexpected values for mask argument
*/
@@ -47,8 +49,8 @@ $values = array(
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array data
@@ -88,7 +90,7 @@ $values = array(
// loop through each element of the array for mask
foreach($values as $value) {
echo "\n-- Iteration with mask value as \"$value\" -- \n";
echo "\n-- Iteration with mask value as \"$value\" --\n";
var_dump( strspn($str,$value) ); // with defalut args
var_dump( strspn($str,$value,$start) ); // with default len value
var_dump( strspn($str,$value,$start,$len) ); // with all args
@@ -102,58 +104,52 @@ echo "Done"
--EXPECTF--
*** Testing strspn() : with diferent unexpected values of mask argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with mask value as "0" --
-- Iteration with mask value as "0" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "1" --
-- Iteration with mask value as "1" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "12345" --
-- Iteration with mask value as "12345" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "-2345" --
-- Iteration with mask value as "-2345" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "10.5" --
-- Iteration with mask value as "10.5" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "-10.5" --
-- Iteration with mask value as "-10.5" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "105000000000" --
-- Iteration with mask value as "101234567000" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "1.06E-9" --
-- Iteration with mask value as "1.07654321E-9" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "0.5" --
-- Iteration with mask value as "0.5" --
int(0)
int(0)
int(0)
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -164,9 +160,7 @@ NULL
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -177,9 +171,7 @@ NULL
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -190,9 +182,7 @@ NULL
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -203,9 +193,7 @@ NULL
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -216,62 +204,62 @@ NULL
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "1" --
-- Iteration with mask value as "1" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "1" --
-- Iteration with mask value as "1" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "object" --
-- Iteration with mask value as "object" --
int(0)
int(1)
int(1)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "Resource id #%d" --
-- Iteration with mask value as "Resource id #%d" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), resource given in %s on line %d
NULL
@@ -282,62 +270,55 @@ NULL
Warning: strspn() expects parameter 2 to be string (Unicode or binary), resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing strspn() : with diferent unexpected values of mask argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with mask value as "0" --
-- Iteration with mask value as "0" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "1" --
-- Iteration with mask value as "1" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "12345" --
-- Iteration with mask value as "12345" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "-2345" --
-- Iteration with mask value as "-2345" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "10.5" --
-- Iteration with mask value as "10.5" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "-10.5" --
-- Iteration with mask value as "-10.5" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "105000000000" --
-- Iteration with mask value as "101234567000" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "1.06E-9" --
-- Iteration with mask value as "1.07654321E-9" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "0.5" --
-- Iteration with mask value as "0.5" --
int(0)
int(0)
int(0)
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -348,9 +329,7 @@ NULL
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -361,9 +340,7 @@ NULL
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -374,9 +351,7 @@ NULL
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -387,9 +362,7 @@ NULL
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with mask value as "Array" --
-- Iteration with mask value as "Array" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
@@ -400,62 +373,62 @@ NULL
Warning: strspn() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
NULL
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "1" --
-- Iteration with mask value as "1" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "1" --
-- Iteration with mask value as "1" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "object" --
-- Iteration with mask value as "object" --
int(0)
int(1)
int(1)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "" --
-- Iteration with mask value as "" --
int(0)
int(0)
int(0)
-- Iteration with mask value as "Resource id #%d" --
-- Iteration with mask value as "Resource id #%d" --
Warning: strspn() expects parameter 2 to be string (Unicode or binary), resource given in %s on line %d
NULL
@@ -2,13 +2,15 @@
Test strspn() function : usage variations - unexpected values of start argument
--FILE--
<?php
/* Prototype : int strspn(string str, string mask [, int start [, int len]])
/* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
* Description: Finds length of initial segment consisting entirely of characters found in mask.
If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)
* Source code: ext/standard/string.c
* Alias to functions: none
*/
error_reporting(E_ALL & ~E_NOTICE);
/*
* Testing strspn() : with unexpected values of start argument
*/
@@ -41,8 +43,8 @@ $values = array(
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array data
@@ -99,10 +101,6 @@ echo "Done"
--EXPECTF--
*** Testing strspn() : with unexpected values of start argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with start value as "10.5" --
int(0)
int(0)
@@ -111,11 +109,11 @@ int(0)
int(2)
int(2)
-- Iteration with start value as "105000000000" --
bool(false)
bool(false)
-- Iteration with start value as "101234567000" --
int(2)
int(2)
-- Iteration with start value as "1.06E-9" --
-- Iteration with start value as "1.07654321E-9" --
int(2)
int(2)
@@ -123,7 +121,13 @@ int(2)
int(2)
int(2)
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
-- Iteration with start value as "Array" --
@@ -133,8 +137,6 @@ NULL
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
@@ -143,8 +145,6 @@ NULL
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
@@ -153,18 +153,6 @@ NULL
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
@@ -253,14 +241,9 @@ NULL
Warning: strspn() expects parameter 3 to be long, resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing strspn() : with unexpected values of start argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with start value as "10.5" --
int(0)
int(0)
@@ -269,11 +252,11 @@ int(0)
int(2)
int(2)
-- Iteration with start value as "105000000000" --
bool(false)
bool(false)
-- Iteration with start value as "101234567000" --
int(2)
int(2)
-- Iteration with start value as "1.06E-9" --
-- Iteration with start value as "1.07654321E-9" --
int(2)
int(2)
@@ -281,7 +264,13 @@ int(2)
int(2)
int(2)
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
-- Iteration with start value as "Array" --
@@ -291,8 +280,6 @@ NULL
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
@@ -301,8 +288,6 @@ NULL
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
@@ -311,18 +296,6 @@ NULL
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with start value as "Array" --
Warning: strspn() expects parameter 3 to be long, array given in %s on line %d
@@ -403,7 +376,7 @@ int(2)
int(2)
int(2)
-- Iteration with start value as "Resource id #%d" --
-- Iteration with start value as "Resource id #5" --
Warning: strspn() expects parameter 3 to be long, resource given in %s on line %d
NULL
@@ -2,13 +2,15 @@
Test strspn() function : usage variations - unexpected values of len argument
--FILE--
<?php
/* Prototype : int strspn(string str, string mask [, int start [, int len]])
/* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
* Description: Finds length of initial segment consisting entirely of characters found in mask.
If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)
* Source code: ext/standard/string.c
* Alias to functions: none
*/
error_reporting(E_ALL & ~E_NOTICE);
/*
* Testing strspn() : with unexpected values of len argument
*/
@@ -41,8 +43,8 @@ $values = array(
// float data
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array data
@@ -98,55 +100,41 @@ echo "Done"
--EXPECTF--
*** Testing strspn() : with unexpected values of len argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with len value as "10.5" --
int(2)
-- Iteration with len value as "-10.5" --
int(0)
-- Iteration with len value as "105000000000" --
int(2)
-- Iteration with len value as "101234567000" --
int(0)
-- Iteration with len value as "1.06E-9" --
-- Iteration with len value as "1.07654321E-9" --
int(0)
-- Iteration with len value as "0.5" --
int(0)
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
NULL
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
@@ -206,59 +194,44 @@ int(0)
Warning: strspn() expects parameter 4 to be long, resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing strspn() : with unexpected values of len argument ***
Notice: Undefined variable: undefined_var in %s on line %d
Notice: Undefined variable: unset_var in %s on line %d
-- Iteration with len value as "10.5" --
int(2)
-- Iteration with len value as "-10.5" --
int(0)
-- Iteration with len value as "105000000000" --
int(2)
-- Iteration with len value as "101234567000" --
int(0)
-- Iteration with len value as "1.06E-9" --
-- Iteration with len value as "1.07654321E-9" --
int(0)
-- Iteration with len value as "0.5" --
int(0)
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
NULL
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
-- Iteration with len value as "Array" --
Warning: strspn() expects parameter 4 to be long, array given in %s on line %d
@@ -313,7 +286,7 @@ int(0)
-- Iteration with len value as "" --
int(0)
-- Iteration with len value as "Resource id #%d" --
-- Iteration with len value as "Resource id #5" --
Warning: strspn() expects parameter 4 to be long, resource given in %s on line %d
NULL
@@ -41,8 +41,8 @@ $values = array (
// float values
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array values
@@ -120,9 +120,9 @@ string(4) "10.5"
-- Iteration 6 --
string(4) "10.5"
-- Iteration 7 --
string(12) "105000000000"
string(12) "101234567000"
-- Iteration 8 --
string(5) "1.06E"
string(11) "1.07654321E"
-- Iteration 9 --
string(3) "0.5"
-- Iteration 10 --
@@ -172,7 +172,6 @@ bool(false)
Warning: strtok() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
NULL
Done
--UEXPECTF--
*** Testing strtok() : with first argument as non-string ***
@@ -194,9 +193,9 @@ unicode(4) "10.5"
-- Iteration 6 --
unicode(4) "10.5"
-- Iteration 7 --
unicode(12) "105000000000"
unicode(12) "101234567000"
-- Iteration 8 --
unicode(5) "1.06E"
unicode(11) "1.07654321E"
-- Iteration 9 --
unicode(3) "0.5"
-- Iteration 10 --
@@ -49,8 +49,8 @@ $values = array (
// float values
10.5,
-10.5,
10.5e10,
10.6E-10,
10.1234567e10,
10.7654321E-10,
.5,
// array values
@@ -139,9 +139,9 @@ string(4) "10.5"
-- Iteration 12 --
string(5) "-10.5"
-- Iteration 13 --
string(12) "105000000000"
string(12) "101234567000"
-- Iteration 14 --
string(7) "1.06E-9"
string(13) "1.07654321E-9"
-- Iteration 15 --
string(3) "0.5"
-- Iteration 16 --
@@ -228,9 +228,9 @@ unicode(4) "10.5"
-- Iteration 12 --
unicode(5) "-10.5"
-- Iteration 13 --
unicode(12) "105000000000"
unicode(12) "101234567000"
-- Iteration 14 --
unicode(7) "1.06E-9"
unicode(13) "1.07654321E-9"
-- Iteration 15 --
unicode(3) "0.5"
-- Iteration 16 --