Trim trailing whitespace in *.phpt

This commit is contained in:
Peter Kokot 2018-10-14 17:23:43 +02:00
parent cc7215f48f
commit 17ccbeec32
6435 changed files with 17425 additions and 17434 deletions

View File

@ -44,7 +44,7 @@ var_dump(func_num_args());
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
int(0)
int(1)
Exception: Too few arguments to function test2(), 0 passed in %s001.php on line 18 and exactly 1 expected

View File

@ -50,7 +50,7 @@ var_dump(func_get_arg(1));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
bool(false)

View File

@ -44,7 +44,7 @@ var_dump(func_get_args());
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
array(0) {
}
array(1) {

View File

@ -12,7 +12,7 @@ var_dump(strncmp("qwerty", "qwerty123", 7));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: strncmp() expects exactly 3 parameters, 2 given in %s on line %d
NULL
int(0)

View File

@ -14,7 +14,7 @@ var_dump(strcasecmp("01", "01"));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: strcasecmp() expects exactly 2 parameters, 1 given in %s on line %d
NULL
int(0)

View File

@ -15,7 +15,7 @@ var_dump(strncasecmp("01", "01", 1000));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: strncasecmp() expects exactly 3 parameters, 1 given in %s on line %d
NULL

View File

@ -21,7 +21,7 @@ var_dump(each($a));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: each() expects exactly 1 parameter, 0 given in %s on line %d
NULL

View File

@ -22,7 +22,7 @@ var_dump(constant("test const"));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: define() expects at least 2 parameters, 0 given in %s on line %d
NULL

View File

@ -35,7 +35,7 @@ $f1->testNull();
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Deprecated: Non-static method foo::bar() should not be called statically in %s on line %d
string(3) "foo"

View File

@ -41,7 +41,7 @@ var_dump(get_parent_class(1));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
bool(false)
bool(false)
string(3) "foo"

View File

@ -52,7 +52,7 @@ $bar->test();
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: property_exists() expects exactly 2 parameters, 0 given in %s on line %d
NULL

View File

@ -18,7 +18,7 @@ var_dump(class_exists("stdClass"));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: class_exists() expects at least 1 parameter, 0 given in %s on line %d
NULL
bool(false)

View File

@ -18,7 +18,7 @@ var_dump(interface_exists("stdClass"));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: interface_exists() expects at least 1 parameter, 0 given in %s on line %d
NULL
bool(false)

View File

@ -20,7 +20,7 @@ var_dump(get_included_files());
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
array(1) {
[0]=>
string(%d) "%s"

View File

@ -13,7 +13,7 @@ var_dump(trigger_error("error", E_USER_DEPRECATED));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: trigger_error() expects at least 1 parameter, 0 given in %s on line %d
NULL

View File

@ -3,10 +3,10 @@ isset() with object properties when operating on non-object
--FILE--
<?php
$foo = NULL;
$foo = NULL;
isset($foo->bar->bar);
echo "Done\n";
?>
--EXPECT--
--EXPECT--
Done

View File

@ -43,7 +43,7 @@ var_dump(count(get_extension_funcs("zend")));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: get_resource_type() expects exactly 1 parameter, 0 given in %s on line %d
NULL

View File

@ -17,7 +17,7 @@ var_dump(constant("TEST_CONST2"));
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: constant() expects exactly 1 parameter, 0 given in %s on line %d
NULL

View File

@ -16,7 +16,7 @@ echo "*** Testing unset(), empty() & isset() with scalar variables ***\n";
// testing scalar variables
$scalar_variables = array(
0,
0,
1,
+1
-1,
@ -52,23 +52,23 @@ foreach ($scalar_variables as $scalar_var) {
echo "-- Iteration $loop_counter --\n"; $loop_counter++;
// checking with isset before unsetting, expected: bool(true)
var_dump( isset($scalar_var) );
var_dump( isset($scalar_var, $set_var) );
var_dump( isset($scalar_var) );
var_dump( isset($scalar_var, $set_var) );
// checking if the var is empty, expected: bool(false) on most
// except "", 0, "0", NULL, FALSE
var_dump( empty($scalar_var) );
var_dump( empty($scalar_var) );
// destroy the variable using unset
unset( $scalar_var );
// dump and see if its destroyed, expcted: NULL
var_dump( $scalar_var );
unset( $scalar_var );
// dump and see if its destroyed, expcted: NULL
var_dump( $scalar_var );
// check using isset to see if unset, expected: bool(false)
var_dump( isset($scalar_var) );
var_dump( isset($scalar_var, $set_var) );
var_dump( isset($scalar_var) );
var_dump( isset($scalar_var, $set_var) );
// empty to check if empty, expecting bool(true)
var_dump( empty($scalar_var) );
var_dump( empty($scalar_var) );
// isset() with two args, one arg only unset, expected: bool(false)
var_dump( isset($scalar_var, $set_var) );
@ -90,36 +90,36 @@ $array_variables = array(
array(1 => "One", 2 => "two"),
array("Name" => "Jack", "Age" => "30"),
array(1,2, "One" => "1", 2 => "two", ""=>"empty", "" => '')
);
);
$outer_loop_counter = 1;
foreach ($array_variables as $array_var) {
echo "--- Outerloop Iteration $outer_loop_counter ---\n";
// check the isset and unset on non existing key
$var = 1; // a var which is defined
// try to unset the element which is non-existent
unset($array_var['non_existent']);
unset($array_var['non_existent']);
// check using isset() & empty() on a non_existent element in the array
var_dump( isset($array_var['non_existent']) );
var_dump( isset($array_var['non_existent'], $var) );
var_dump( isset($array_var['non_existent'], $array_var['none']) );
var_dump( empty($array_var['non_existent']) );
// testing empty and isset on arrays
// testing empty and isset on arrays
var_dump( empty($array_var) ); // expecting bool(false), except: array(), which is considered empty
var_dump( isset($array_var) ); // expecting bool(true), except: array(), which is not set
// get the keys of the $array_var
// get the keys of the $array_var
$keys = array_keys($array_var);
// unset each element in the array and see the working of unset, isset & empty
$inner_loop_counter = 1;
foreach ($keys as $key_value) {
echo "-- Innerloop Iteration $inner_loop_counter of Outerloop Iteration $outer_loop_counter --\n";
echo "-- Innerloop Iteration $inner_loop_counter of Outerloop Iteration $outer_loop_counter --\n";
$inner_loop_counter++;
// unset the element
unset($array_var[$key_value]);
unset($array_var[$key_value]);
// dump the array after element was unset
var_dump($array_var);
// check using isset for the element that was unset
@ -127,10 +127,10 @@ foreach ($array_variables as $array_var) {
// calling isset with more args
var_dump( isset($array_var[$key_val], $array_var) ); //expected: bool(false)
// calling empty, expected bool(true)
// calling empty, expected bool(true)
var_dump( empty($array_var[$key_val]) );
// dump the array to see that that array did not get modified
// dump the array to see that that array did not get modified
// because of using isset, empty and unset on its element
var_dump($array_var);
}
@ -144,7 +144,7 @@ foreach ($array_variables as $array_var) {
// use isset to see that array is not set
var_dump( isset($array_var) ); //expected: bool(false)
var_dump( isset($array_var, $array_var[$key_val]) ); // expected: bool(false)
// empty() to see if the array is empty
var_dump( empty($array_var) ); // expected: bool(true)
}
@ -183,12 +183,12 @@ foreach ($resources as $resource) {
unset($temp_var);
// now the isset() with both the args as unset
var_dump( isset($resource, $temp_var) ); // expected: bool(false);
// dump the resource to see if there any effect on it
// dump the resource to see if there any effect on it
var_dump($resource);
}
// unset and dump the array containing all the resources to see that
// unset works correctly
// unset works correctly
unset($resources);
var_dump($resources);
var_dump( isset($resources) ); //expected: bool(false)
@ -200,12 +200,12 @@ class Point
var $x;
var $y;
var $lable;
function __construct($x, $y) {
$this->x = $x;
$this->y = $y;
}
function setLable($lable) {
$this->lable = $lable;
}
@ -215,8 +215,8 @@ class Point
}
$point1 = new Point(30,40);
// use unset/empty/isset to check the object
var_dump($point1); // dump the object
// use unset/empty/isset to check the object
var_dump($point1); // dump the object
// check the object and member that is not set
var_dump( isset($point1) ); // expected: bool(true)
@ -229,7 +229,7 @@ $point1->setLable("Point1");
var_dump( isset($point1->$lable) ); //expected: bool(true)
var_dump( empty($point1->$lable) ); //expected: bool(false)
// dump the object to see that obj was not harmed
// dump the object to see that obj was not harmed
// because of the usage of the isset & empty
var_dump($point1);
@ -270,36 +270,36 @@ var_dump($point2);
/* testing variation in operation for isset(), empty() & unset().
Note: Most of the variation for function unset() is testing by a
set of testcases named "Zend/tests/unset_cv??.phpt", only
set of testcases named "Zend/tests/unset_cv??.phpt", only
variation not tested are attempted here */
echo "\n*** Testing possible variation in operation for isset(), empty() & unset() ***\n";
/* unset() variation1: checking unset on static variable inside a function.
/* unset() variation1: checking unset on static variable inside a function.
* unset() destroys the variable only in the context of the rest of a function
* Following calls will restore the previous value of a variable.
*/
echo "\n** Testing unset() variation 1: unset on static variable inside a function **\n";
function test_unset1() {
static $static_var;
// increment the value of the static. this change is in function context
$static_var ++;
echo "value of static_var before unset: $static_var\n";
// check using isset and empty
echo "value of static_var before unset: $static_var\n";
// check using isset and empty
var_dump( isset($static_var) );
var_dump( empty($static_var) );
// unset the static var
unset($static_var);
echo "value of static_var after unset: $static_var\n";
// check using isset and empty
echo "value of static_var after unset: $static_var\n";
// check using isset and empty
var_dump( isset($static_var) );
var_dump( empty($static_var) );
// assign a value to static var
$static_var = 20;
echo "value of static_var after new assignment: $static_var\n";
echo "value of static_var after new assignment: $static_var\n";
}
// call the functiont
test_unset1();
@ -308,10 +308,10 @@ test_unset1();
echo "\n** Testing unset() variation 2: unset on a variable passed by ref. inside of a function **\n";
/* unset() variation2: Pass by reference
* If a variable that is PASSED BY REFERENCE is unset() inside of a function,
/* unset() variation2: Pass by reference
* If a variable that is PASSED BY REFERENCE is unset() inside of a function,
* only the local variable is destroyed. The variable in the calling environment
* will retain the same value as before unset() was called.
* will retain the same value as before unset() was called.
*/
function test_unset2( &$ref_val ) {
// unset the variable passed
@ -329,7 +329,7 @@ var_dump($value);
test_unset2($value);
var_dump($value);
echo "\n** Testing unset() variation 3: unset on a global variable inside of a function **\n";
/* unset() variation2: unset on a global variable inside a function
* If a globalized variable is unset() inside of a function, only the
@ -340,17 +340,17 @@ $global_var = 10;
function test_unset3() {
global $global_var;
// check the $global_var using isset and empty
var_dump( isset($global_var) );
var_dump( empty($global_var) );
// check the $global_var using isset and empty
var_dump( isset($global_var) );
var_dump( empty($global_var) );
// unset the global var
unset($global_var);
// check the $global_var using isset and empty
var_dump( isset($global_var) );
var_dump( empty($global_var) );
// check the $global_var using isset and empty
var_dump( isset($global_var) );
var_dump( empty($global_var) );
}
var_dump($global_var);

View File

@ -19,7 +19,7 @@ foo(1,2);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: func_get_arg() expects exactly 1 parameter, 3 given in %s on line %d
NULL

View File

@ -7,7 +7,7 @@ class foo {
public $test = 0;
private $test_2 = 1;
protected $test_3 = 2;
public function bar() {
try {
throw new Exception('foo');
@ -15,13 +15,13 @@ class foo {
var_dump($this);
}
$this->baz();
$this->baz();
}
public function baz() {
foreach ($this as $k => $v) {
printf("'%s' => '%s'\n", $k, $v);
}
}
print "ok\n";
}
}

View File

@ -1,7 +1,7 @@
--TEST--
Testing array with '[]' passed as argument by value
--FILE--
<?php
<?php
function test($var) { }
test($arr[]);

View File

@ -1,7 +1,7 @@
--TEST--
Testing array with '[]' passed as argument by reference
--FILE--
<?php
<?php
function test(&$var) { }
test($arr[]);

View File

@ -1,7 +1,7 @@
--TEST--
Using undefined multidimensional array
--FILE--
<?php
<?php
$arr[1][2][3][4][5];

View File

@ -1,7 +1,7 @@
--TEST--
Testing multiples 'default:' in switch
--FILE--
<?php
<?php
switch (1) {
case 2:

View File

@ -649,7 +649,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -665,7 +665,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -681,7 +681,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
@ -698,7 +698,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -714,7 +714,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -730,7 +730,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -746,7 +746,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -762,7 +762,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -778,7 +778,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -794,7 +794,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -810,7 +810,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -826,7 +826,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -842,7 +842,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
try {
@ -858,7 +858,7 @@ try {
var_dump($e->getPrevious() === NULL);
var_dump($e->getFile() === __FILE__);
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
}
}
}
?>

View File

@ -8,5 +8,5 @@ abstract class B extends A { abstract function bar($x); }
echo "DONE";
?>
--EXPECT--
--EXPECT--
DONE

View File

@ -8,5 +8,5 @@ abstract class B extends A { abstract function bar($x, $y = 0); }
echo "DONE";
?>
--EXPECT--
--EXPECT--
DONE

View File

@ -8,5 +8,5 @@ abstract class B extends A { abstract function bar($x); }
echo "DONE";
?>
--EXPECTF--
--EXPECTF--
Fatal error: Declaration of B::bar($x) must be compatible with A::bar($x, $y = 0) in %s

View File

@ -10,5 +10,5 @@ class test {
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Fatal error: Multiple access type modifiers are not allowed in %s on line %d

View File

@ -9,5 +9,5 @@ class test {
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Fatal error: Multiple access type modifiers are not allowed in %s on line %d

View File

@ -9,5 +9,5 @@ final final class test {
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Fatal error: Multiple final modifiers are not allowed in %s on line %d

View File

@ -10,5 +10,5 @@ class test {
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Fatal error: Multiple abstract modifiers are not allowed in %s on line %d

View File

@ -10,5 +10,5 @@ class test {
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Fatal error: Multiple final modifiers are not allowed in %s on line %d

View File

@ -10,5 +10,5 @@ class test {
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Fatal error: Multiple static modifiers are not allowed in %s on line %d

View File

@ -9,5 +9,5 @@ class test {
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Fatal error: Cannot use the final modifier on an abstract class member in %s on line %d

View File

@ -21,7 +21,7 @@ abstract class b extends a {
class c extends b {
public function __construct() {
$this->test();
}
}
}
new c;

View File

@ -32,7 +32,7 @@ echo $a->func1(),"\n";
echo $a->func2(),"\n";
?>
--EXPECTF--
--EXPECTF--
var1 value
var2 value
in func1

View File

@ -29,7 +29,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
array(3) {
[0]=>
int(1)

View File

@ -19,7 +19,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Notice: Object of class stdClass could not be converted to int in %sadd_002.php on line %d
Exception: Unsupported operand types

View File

@ -1,5 +1,5 @@
--TEST--
adding arrays to objects
adding arrays to objects
--FILE--
<?php
@ -19,7 +19,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Notice: Object of class stdClass could not be converted to int in %sadd_003.php on line %d
Exception: Unsupported operand types

View File

@ -16,7 +16,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Exception: Unsupported operand types
Fatal error: Uncaught Error: Unsupported operand types in %s:%d

View File

@ -16,7 +16,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
float(2834756759.1231)
float(2834756759.1231)
Done

View File

@ -37,7 +37,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: A non-numeric value encountered in %s on line %d
int(75636)

View File

@ -1,5 +1,5 @@
--TEST--
adding strings to arrays
adding strings to arrays
--FILE--
<?php
@ -18,7 +18,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: A non-numeric value encountered in %s on line %d

View File

@ -30,7 +30,7 @@ var_dump($s);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
string(3) "020"
string(4) "pead"
string(4) "pead"

View File

@ -1,12 +1,12 @@
--TEST--
Testing calls to anonymous function
--FILE--
<?php
<?php
for ($i = 0; $i < 10; $i++) {
$a = create_function('', 'return '. $i .';');
var_dump($a());
$b = "\0lambda_". ($i + 1);
var_dump($b());
}

View File

@ -1,7 +1,7 @@
--TEST--
Testing anonymous function return as array key and accessing $GLOBALS
--FILE--
<?php
<?php
$test = create_function('$v', 'return $v;');

View File

@ -1,7 +1,7 @@
--TEST--
Using throw $var with anonymous function return
--FILE--
<?php
<?php
try {
$a = create_function('', 'return new Exception("test");');

View File

@ -4,12 +4,12 @@ Bug #55719 (Argument restriction should come with a more specific error message)
<?php
Class Base {
public function &test($foo, array $bar, $option = NULL, $extra = "lllllllllllllllllllllllllllllllllllllllllllllllllll") {
}
}
}
class Sub extends Base {
public function &test() {
}
}
}
?>
--EXPECTF--

View File

@ -4,12 +4,12 @@ Bug #55719 (Argument restriction should come with a more specific error message)
<?php
Abstract Class Base {
public function test($foo, array &$bar, $option = NULL, $extra = 3.141592653589793238462643383279502884197169399375105 ) {
}
}
}
class Sub extends Base {
public function test($foo, array &$bar) {
}
}
}
?>
--EXPECTF--

View File

@ -7,12 +7,12 @@ class Foo {
Abstract Class Base {
public function test(Foo $foo, array $bar, $option = NULL, $extra = "lllllllllllllllllllllllllllllllllllllllllllllllllll") {
}
}
}
class Sub extends Base {
public function test() {
}
}
}
?>
--EXPECTF--

View File

@ -11,7 +11,7 @@ Abstract Class Base {
class Sub extends Base {
public function test(Foo $foo, array $bar, $option = NULL, $extra = 0xffffff ) {
}
}
}
?>
--EXPECTF--

View File

@ -4,7 +4,7 @@ Bug #55719 (Argument restriction should come with a more specific error message)
<?php
class Sub implements ArrayAccess {
public function offsetSet() {
}
}
}
?>
--EXPECTF--

View File

@ -4,12 +4,12 @@ Bug #60174 (Notice when array in method prototype error)
<?php
Abstract Class Base {
public function test($foo, $extra = array("test")) {
}
}
}
class Sub extends Base {
public function test($foo, $extra) {
}
}
}
?>
--EXPECTF--

View File

@ -10,7 +10,7 @@ Ensure "undefined offset" notice formats message corectly when undefined key is
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Notice: Undefined offset: -1 in %s on line 3
Notice: Undefined offset: -1 in %s on line 4

View File

@ -20,5 +20,5 @@ $a->test();
$a->test();
echo "okey";
?>
--EXPECT--
--EXPECT--
okey

View File

@ -12,7 +12,7 @@ var_dump($var1);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
int(2)
int(2)
Done

View File

@ -12,7 +12,7 @@ var_dump($var1);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
string(1) "g"
string(1) "g"
Done

View File

@ -12,7 +12,7 @@ var_dump($var1);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
NULL
NULL
Done

View File

@ -15,7 +15,7 @@ var_dump($var2);
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
string(5) "space"
string(5) "space"
string(5) "space"

View File

@ -3,7 +3,7 @@ Bug #18556 (Setting locale to 'tr_TR' lowercases class names)
--FILE--
<?php
$g_lang = 'tr_TR';
putenv("LANG=$g_lang");
putenv("LANG=$g_lang");
setlocale(LC_ALL, $g_lang);
class InfoBlob {

View File

@ -1,7 +1,7 @@
--TEST--
Bug #21478 (Zend/zend_alloc.c :: shutdown_memory_manager produces segfault)
Bug #21478 (Zend/zend_alloc.c :: shutdown_memory_manager produces segfault)
--SKIPIF--
<?php
<?php
if (!function_exists('stream_filter_register')) die('skip stream_filter_register() not available');
?>
--FILE--
@ -27,7 +27,7 @@ fwrite($fp, "This is a test.\n");
print "Done.\n";
fclose($fp);
// Uncommenting the following 'print' line causes the segfault to stop occurring
// print "2\n";
// print "2\n";
readfile(dirname(__FILE__)."/test.txt");
unlink(dirname(__FILE__)."/test.txt");
?>

View File

@ -8,19 +8,19 @@ class mom {
protected function prot() {
print "protected method\n";
}
}
}
class child extends mom {
public function callMom() {
$this->prot();
}
public function viewMom() {
print $this->prot;
}
}
$c = new child();

View File

@ -15,12 +15,12 @@ class SectionClass {
$this->Comment = $comment;
}
function __destruct() {
out($this->Comment); // this line doesn't crash PHP
out($this->Comment); // this line doesn't crash PHP
out("\n<!-- End Section: " . $this->Comment . "-->"); // this line
}
}
function out($code) { return; }
$site = new SiteClass();
$site = new SiteClass();
$site->page->Display();
echo "OK\n";
?>

View File

@ -5,7 +5,7 @@ Bug #26229 (getIterator() segfaults when it returns arrays or scalars)
class array_iterator implements IteratorAggregate {
public function getIterator() {
return array('foo', 'bar');
return array('foo', 'bar');
}
}

View File

@ -14,15 +14,15 @@ $function();
class foo
{
static $method = 'global_func';
static public function foo_func()
{
echo __METHOD__ . "\n";
}
}
/* The following is a BC break with PHP 4 where it would
* call foo::fail. In PHP 5 we first evaluate static class
/* The following is a BC break with PHP 4 where it would
* call foo::fail. In PHP 5 we first evaluate static class
* properties and then do the function call.
*/
$method = 'foo_func';

View File

@ -14,7 +14,7 @@ class Staticexample
$b = new Staticexample();
Staticexample::test();
$b->test();
?>
===DONE===
--EXPECT--

View File

@ -8,7 +8,7 @@ class Base
public $Foo = 1;
protected $Bar = 2;
private $Baz = 3;
function __construct()
{
echo __METHOD__ . "\n";

View File

@ -4,8 +4,8 @@ Bug #28072 (static array with some constant keys will be incorrectly ordered)
<?php
define("FIRST_KEY", "a");
define("THIRD_KEY", "c");
function test()
{
static $arr = array(
@ -16,7 +16,7 @@ function test()
);
print_r($arr);
}
function test2()
{
static $arr = array(
@ -27,7 +27,7 @@ function test2()
);
print_r($arr);
}
test();
test2();
?>

View File

@ -8,14 +8,14 @@ function doit($a, $b)
custom_callback('dereferenced', $trace);
custom_callback('direct', debug_backtrace());
}
function custom_callback($traceName, $btInfo)
{
echo $traceName ." -- args: ";
echo isset($btInfo[0]['args']) ? count($btInfo[0]['args']) : 'does not exist';
echo "\n";
}
doit('a','b');
?>
--EXPECT--

View File

@ -3,15 +3,15 @@ Bug #29104 (Function declaration in method doesn't work)
--FILE--
<?php
class A
{
function g()
{
{
function g()
{
echo "function g - begin\n";
function f()
{
function f()
{
echo "function f\n";
}
}
echo "function g - end\n";
}

View File

@ -6,7 +6,7 @@ Bug #29674 (inherited method doesn't have access to private variables of the der
class BaseClass
{
private $private_base = "Base";
function printVars ()
{
var_dump($this->private_base);

View File

@ -2,13 +2,13 @@
Bug #30080 (Passing array or non array of objects)
--FILE--
<?php
class foo {
function __construct($arrayobj) {
class foo {
function __construct($arrayobj) {
var_dump($arrayobj);
}
}
}
}
new foo(array(new stdClass));
new foo(array(new stdClass));
?>
--EXPECTF--
array(1) {

View File

@ -18,7 +18,7 @@ class hariCow extends FIIFO {
} catch(Exception $e) {
}
}
public function __toString() {
return "ok\n";
}

View File

@ -24,7 +24,7 @@ class hariCow extends FIIFO {
} catch(Exception $e) {
}
}
public function __toString() {
return "Rusticus in asino sedet.";
}

View File

@ -5,7 +5,7 @@ Bug #30346 (arrayAccess and using $this)
class Test implements ArrayAccess
{
public function __construct() { }
public function __construct() { }
public function offsetExists( $offset ) { return false; }
public function offsetGet( $offset ) { return $offset; }
public function offsetSet( $offset, $data ) { }

View File

@ -8,12 +8,12 @@ class Container
{
return $this->_p[ $what ];
}
public function __set( $what, $value )
{
$this->_p[ $what ] = $value;
}
private $_p = array();
}

View File

@ -6,7 +6,7 @@ Bug #30451 (static properties permissions broken)
class A {
protected static $property = TRUE;
protected static function method() {
return TRUE;
}
@ -16,15 +16,15 @@ class A {
class B extends A {
public function __construct() {
var_dump(self::method());
var_dump(parent::method());
var_dump(self::$property);
var_dump(parent::$property);
}
}
new B;

View File

@ -14,7 +14,7 @@ class C {
}
}
function plap($a) {
function plap($a) {
}
function plop() {

View File

@ -1,7 +1,7 @@
--TEST--
Bug #30725 (PHP segfaults when an exception is thrown in getIterator() within foreach)
--FILE--
<?php
<?php
class Test implements IteratorAggregate
{
@ -12,7 +12,7 @@ class Test implements IteratorAggregate
}
try
{
{
$it = new Test;
foreach($it as $v)
{

View File

@ -3,14 +3,14 @@ Bug #30998 (Crash when user error handler returns false)
--FILE--
<?php
error_reporting(-1);
function my_error($errno, $errstr, $errfile, $errline)
{
print "$errstr ($errno) in $errfile:$errline\n";
return false;
}
set_error_handler('my_error');
$f = fopen("/tmp/blah", "r");
?>
===DONE===

View File

@ -7,7 +7,7 @@ class DbGow {
public function query() {
throw new Exception;
}
public function select() {
return new DbGowRecordSet($this->query());
}
@ -32,7 +32,7 @@ try {
} catch(Exception $e) {
echo "ok\n";
}
try {
$db->select2();
} catch(Exception $e) {

View File

@ -6,42 +6,42 @@ Bug #31683 (changes to $name in __get($name) override future parameters)
class Foo implements ArrayAccess {
function __get($test) {
var_dump($test);
var_dump($test);
$test = 'bug';
}
function __set($test, $val) {
var_dump($test);
var_dump($test);
var_dump($val);
$test = 'bug';
$val = 'bug';
}
function __call($test, $arg) {
var_dump($test);
var_dump($test);
$test = 'bug';
}
function offsetget($test) {
var_dump($test);
var_dump($test);
$test = 'bug';
return 123;
}
function offsetset($test, $val) {
var_dump($test);
var_dump($val);
var_dump($test);
var_dump($val);
$test = 'bug';
$val = 'bug';
}
function offsetexists($test) {
var_dump($test);
var_dump($test);
$test = 'bug';
}
function offsetunset($test) {
var_dump($test);
var_dump($test);
$test = 'bug';
}

View File

@ -8,8 +8,8 @@ class test
{
private static $instance = null;
private $myname = '';
private function __construct( $value = '' )
private function __construct( $value = '' )
{
echo "New class $value created \n";
$this -> myname = $value;
@ -38,7 +38,7 @@ class test
}
return $instance2;
}
public function __destruct()
public function __destruct()
{
if ( defined('SCRIPT_END') )
{
@ -47,7 +47,7 @@ class test
echo "Class " . $this -> myname . " destroyed beforce script end\n";
}
}
}
}
echo "Try static instance inside class :\n";
$getCopyofSingleton = test::getInstance();
$getCopyofSingleton = null;

View File

@ -1,12 +1,12 @@
--TEST--
Bug #32428 (The @ warning error suppression operator is broken)
--FILE--
<?php
$data = @$not_exists;
$data = @($not_exists);
$data = @!$not_exists;
$data = !@$not_exists;
$data = @($not_exists+1);
<?php
$data = @$not_exists;
$data = @($not_exists);
$data = @!$not_exists;
$data = !@$not_exists;
$data = @($not_exists+1);
echo "ok\n";
?>
--EXPECT--

View File

@ -4,7 +4,7 @@ Bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct)
<?php
class BUG {
public $error = "please fix this thing, it wasted a nice part of my life!\n";
static function instance() {return new BUG();}
static function instance() {return new BUG();}
function __destruct()
{

View File

@ -52,7 +52,7 @@ try {
//irrelevant
}
echo 'shouldn`t get here';
//$dummy = 'this will not crash';
//$dummy = 'this will not crash';
$obj->dummy = 'this will crash';
} catch (Exception $e) {
echo "ok\n";

View File

@ -1,7 +1,7 @@
--TEST--
Bug #32833 (Invalid opcode with $a[] .= '')
--FILE--
<?php
<?php
$test = array();
$test[] .= "ok\n";
echo $test[0];

View File

@ -10,7 +10,7 @@ class A
class B extends A
{
private $c = "B's c";
public function go()
{
foreach ($this as $key => $val)

View File

@ -7,20 +7,20 @@ class foo {
echo "private!\n";
}
}
class fooson extends foo {
function barson() {
$this->bar();
}
}
class foo2son extends fooson {
function bar() {
echo "public!\n";
}
}
$b = new foo2son();
$b->barson();
?>

View File

@ -8,7 +8,7 @@ Bug #33282 (Re-assignment by reference does not clear the is_ref flag)
$r = &$a[2];
var_dump($a);
?>
--EXPECT--
--EXPECT--
array(3) {
[0]=>
int(1)

View File

@ -41,7 +41,7 @@ class TheObj {
var_dump($SomeObj->RealVar1);
print $SomeObj->{'RealVar'.(3)}."\n";
unset($SomeObj->RealVar1);
unset($SomeObj->{'RealVar'.(3)});

View File

@ -9,12 +9,12 @@ class Foo implements ArrayAccess
function offsetGet($offset) {/*...*/}
function offsetSet($offset, $value) {/*...*/}
function offsetUnset($offset) {/*...*/}
function fail()
{
$this['blah'];
}
function succeed()
{
$this;

View File

@ -33,7 +33,7 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
int(32767)
int(32767)
int(30719)

View File

@ -16,7 +16,7 @@ class Faulty
function NormalMethod($Args)
{
echo "I heart me\n";
echo "I heart me\n";
}
}

View File

@ -8,10 +8,10 @@ class abc {
function __set ($key, $value) {
$this->arr[$key] = $value;
}
function __get ($key) {
return $this->arr[$key];
}
}
}
$abc = new abc();
foreach (array (1,2,3) as $abc->k => $abc->v) {

View File

@ -1,5 +1,5 @@
--TEST--
Bug #34617 (zend_deactivate: objects_store used after zend_objects_store_destroy is called)
Bug #34617 (zend_deactivate: objects_store used after zend_objects_store_destroy is called)
--SKIPIF--
<?php if (!extension_loaded("xml")) print "skip the xml extension not available"; ?>
--FILE--

View File

@ -22,6 +22,6 @@ $myPwa->test();
echo "Done\n";
?>
--EXPECT--
--EXPECT--
string(7) "myvalue"
Done

View File

@ -10,7 +10,7 @@ try {
echo "0\n";
}
echo "?\n";
} catch(Exception $e) {
} catch(Exception $e) {
echo "This Exception should be catched\n";
}
function errorHandler($errno, $errstr, $errfile, $errline, $vars) {

Some files were not shown because too many files have changed in this diff Show More