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"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
int(0) int(0)
int(1) int(1)
Exception: Too few arguments to function test2(), 0 passed in %s001.php on line 18 and exactly 1 expected 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"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
bool(false) bool(false)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,5 +8,5 @@ abstract class B extends A { abstract function bar($x); }
echo "DONE"; echo "DONE";
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Declaration of B::bar($x) must be compatible with A::bar($x, $y = 0) in %s 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"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Multiple access type modifiers are not allowed in %s on line %d 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"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Multiple access type modifiers are not allowed in %s on line %d 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"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Multiple final modifiers are not allowed in %s on line %d Fatal error: Multiple final modifiers are not allowed in %s on line %d

View File

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

View File

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

View File

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

View File

@ -9,5 +9,5 @@ class test {
echo "Done\n"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Cannot use the final modifier on an abstract class member in %s on line %d 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 { class c extends b {
public function __construct() { public function __construct() {
$this->test(); $this->test();
} }
} }
new c; new c;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
--TEST-- --TEST--
Using throw $var with anonymous function return Using throw $var with anonymous function return
--FILE-- --FILE--
<?php <?php
try { try {
$a = create_function('', 'return new Exception("test");'); $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 <?php
Class Base { Class Base {
public function &test($foo, array $bar, $option = NULL, $extra = "lllllllllllllllllllllllllllllllllllllllllllllllllll") { public function &test($foo, array $bar, $option = NULL, $extra = "lllllllllllllllllllllllllllllllllllllllllllllllllll") {
} }
} }
class Sub extends Base { class Sub extends Base {
public function &test() { public function &test() {
} }
} }
?> ?>
--EXPECTF-- --EXPECTF--

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,7 +15,7 @@ var_dump($var2);
echo "Done\n"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
string(5) "space" string(5) "space"
string(5) "space" 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-- --FILE--
<?php <?php
$g_lang = 'tr_TR'; $g_lang = 'tr_TR';
putenv("LANG=$g_lang"); putenv("LANG=$g_lang");
setlocale(LC_ALL, $g_lang); setlocale(LC_ALL, $g_lang);
class InfoBlob { class InfoBlob {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,15 +3,15 @@ Bug #29104 (Function declaration in method doesn't work)
--FILE-- --FILE--
<?php <?php
class A class A
{ {
function g() function g()
{ {
echo "function g - begin\n"; echo "function g - begin\n";
function f() function f()
{ {
echo "function f\n"; echo "function f\n";
} }
echo "function g - end\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 class BaseClass
{ {
private $private_base = "Base"; private $private_base = "Base";
function printVars () function printVars ()
{ {
var_dump($this->private_base); var_dump($this->private_base);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,7 @@ class Faulty
function NormalMethod($Args) 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) { function __set ($key, $value) {
$this->arr[$key] = $value; $this->arr[$key] = $value;
} }
function __get ($key) { function __get ($key) {
return $this->arr[$key]; return $this->arr[$key];
} }
} }
$abc = new abc(); $abc = new abc();
foreach (array (1,2,3) as $abc->k => $abc->v) { foreach (array (1,2,3) as $abc->k => $abc->v) {

View File

@ -1,5 +1,5 @@
--TEST-- --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-- --SKIPIF--
<?php if (!extension_loaded("xml")) print "skip the xml extension not available"; ?> <?php if (!extension_loaded("xml")) print "skip the xml extension not available"; ?>
--FILE-- --FILE--

View File

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

View File

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

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