Sync leading and final newlines in *.phpt sections

This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
This commit is contained in:
Peter Kokot 2018-10-15 04:33:09 +02:00
parent e84662c35c
commit d679f02295
3401 changed files with 1530 additions and 4009 deletions

View File

@ -17,7 +17,6 @@ $arr[][]->bar = 2;
?>
--EXPECTF--
Notice: Undefined variable: arr in %s on line %d
Notice: Undefined variable: arr in %s on line %d

View File

@ -9,5 +9,4 @@ abstract class TestClass
?>
===DONE===
--EXPECT--
===DONE===

View File

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

View File

@ -19,7 +19,6 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
Warning: A non-numeric value encountered in %s on line %d
Exception: Unsupported operand types

View File

@ -6,5 +6,3 @@ var_dump(new class{});
--EXPECTF--
object(class@%s)#%d (0) {
}

View File

@ -18,4 +18,3 @@ var_dump($a instanceof A, $a instanceof B);
--EXPECT--
bool(true)
bool(true)

View File

@ -51,4 +51,3 @@ object(class@%s)#1 (1) {
["i"]=>
int(10)
}

View File

@ -12,4 +12,3 @@ namespace {
--EXPECTF--
object(class@%s)#1 (0) {
}

View File

@ -20,4 +20,3 @@ namespace lone {
--EXPECTF--
object(class@%s)#2 (0) {
}

View File

@ -16,4 +16,3 @@ array(1) {
["public"]=>
string(6) "public"
}

View File

@ -25,4 +25,3 @@ GenerateError2("Test2");
#0 userErrorHandler(8, Undefined variable: b, %sbug29896.php, 11, Array ([A1] => Test1)) called at [%sbug29896.php:11]
#1 GenerateError1(Test1) called at [%sbug29896.php:16]
#2 GenerateError2(Test2) called at [%sbug29896.php:19]

View File

@ -13,4 +13,3 @@ switch ($a) {
?>
--EXPECT--
ok

View File

@ -7,4 +7,3 @@ class test implements a {
?>
--EXPECTF--
Fatal error: Interface 'a' not found in %sbug30519.php on line 2

View File

@ -24,4 +24,3 @@ echo "this is still executed\n";
BUG
please fix this thing, it wasted a nice part of my life!
this is still executed

View File

@ -18,4 +18,3 @@ echo "$a\n";
?>
--EXPECT--
ok

View File

@ -21,4 +21,3 @@ try {
(((
here
)))

View File

@ -36,4 +36,3 @@ Stack trace:
#0 %s(%d): XmlTest->run()
#1 {main}
thrown in %sbug34064.php on line 18

View File

@ -15,4 +15,3 @@ if(!$kids) echo "ok\n"; else echo "bug\n";
bool(false)
ok
ok

View File

@ -18,4 +18,3 @@ stch::g ();
EHLO
EHLO
EHLO

View File

@ -13,4 +13,3 @@ echo "NO LEAK\n";
--EXPECT--
clonned
NO LEAK

View File

@ -35,4 +35,3 @@ bool(false)
bool(true)
bool(true)
bool(false)

View File

@ -9,4 +9,3 @@ Fatal error: Uncaught Error: __clone method called on non-object in %sbug42818.p
Stack trace:
#0 {main}
thrown in %sbug42818.php on line 2

View File

@ -28,4 +28,3 @@ bool(true)
bool(false)
bool(false)
bool(false)

View File

@ -48,4 +48,3 @@ Class [ <user> class x extends c implements a, b ] {
}
}
}

View File

@ -28,7 +28,6 @@ $child->test();
?>
--EXPECT--
From parent scope
array(1) {
["prot"]=>

View File

@ -10,4 +10,3 @@ var_dump(ini_get("arg_separator.output"));
--EXPECT--
bool(false)
string(1) "&"

View File

@ -8,4 +8,3 @@ $a->{"a"."b"};
Notice: Undefined variable: a in %sbug47109.php on line 2
Notice: Trying to get property 'ab' of non-object in %sbug47109.php on line 2

View File

@ -23,7 +23,6 @@ $l_aa=new aa();
$l_aa->dosome();
?>
--EXPECTF--
Fatal error: Uncaught Exception in %s
Stack trace:
#0 %s(%d): do_throw()

View File

@ -22,7 +22,6 @@ catch(Exception $e){
}
?>
--EXPECTF--
Fatal error: Uncaught Exception in %s
Stack trace:
#0 %s(%d): C->generate(0)

View File

@ -21,4 +21,3 @@ var_dump($arg);
bar called!
bar called!
int(3)

View File

@ -7,6 +7,5 @@ preg_match('//', '', $data->info);
var_dump($data);
?>
--EXPECTF--
Warning: Attempt to modify property 'info' of non-object in %sbug52237.php on line 3
string(4) "test"

View File

@ -32,4 +32,3 @@ Stack trace:
Stack trace:
#0 %sbug52361.php(16): bbb()
#1 {main}

View File

@ -7,5 +7,3 @@ var_dump(isset($s[0][0]));
?>
--EXPECT--
bool(false)

View File

@ -14,4 +14,3 @@ echo "ok\n";
--EXPECT--
EROOR: Creating default object from empty value
ok

View File

@ -22,6 +22,5 @@ $a->__construct();
echo "DONE";
?>
--EXPECTF--
Notice: Undefined property: Z::$x in %s on line 14
DONE

View File

@ -20,4 +20,3 @@ Fatal error: Uncaught Exception: Exception! in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d

View File

@ -37,4 +37,3 @@ object(B)#%d (4) {
["v4"]=>
string(1) "B"
}

View File

@ -10,6 +10,5 @@ abstract class Foo {
class Bar extends Foo {
protected function __construct(){}
}
--EXPECTF--
Fatal error: Access level to Bar::__construct() must be public (as in class Foo) in %s

View File

@ -14,6 +14,5 @@ class Bar extends Foo {
class Baz extends Bar {
protected function __construct(){}
}
--EXPECTF--
Fatal error: Access level to Baz::__construct() must be public (as in class Bar) in %s

View File

@ -17,4 +17,3 @@ namespace ns {
?>
--EXPECTF--
Fatal error: Declaration of ns\Foo::method(ns\stdClass $o) must be compatible with Iface::method(stdClass $o) in %s on line %d

View File

@ -35,4 +35,3 @@ Fatal error: Uncaught Error: Cannot call abstract method Foo::bar() in %sbug6311
Stack trace:
#0 {main}
thrown in %sbug63111.php on line 20

View File

@ -49,7 +49,6 @@ $test->protectedProperty = 'value';
$test->privateProperty = 'value';
?>
--EXPECTF--
__get nonExisting
@ -71,4 +70,3 @@ __set nonExisting
__set publicProperty
__set protectedProperty
__set privateProperty

View File

@ -27,4 +27,3 @@ $x = new Bar;
var_dump($x->run());
--EXPECT--
string(3) "Bar"

View File

@ -50,4 +50,3 @@ Warning: Value for function is no string in %s on line %d
Warning: args element is no array in %s on line %d
string(60) "#0 [unknown function][unknown][unknown][unknown]()
#1 {main}"

View File

@ -36,4 +36,3 @@ $o['x'] = 1;
echo $o['x'], "\n";
--EXPECT--
2

View File

@ -7,5 +7,4 @@ function a() {
}
echo "Done\n";
--EXPECTF--
Parse error: memory exhausted in %s on line %d

View File

@ -1,9 +1,7 @@
--TEST--
bug67436: Autoloader isn't called if user defined error handler is present
--INI--
error_reporting=-1
--FILE--
<?php
@ -20,7 +18,6 @@ a::staticTest();
$b = new b();
$b->test();
--EXPECT--
b::test()
a::test(c::TESTCONSTANT)

View File

@ -13,7 +13,6 @@ a::staticTest();
$b = new b();
$b->test();
--EXPECTF--
Warning: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s%ebug67436%eb.inc on line %d
b::test()

View File

@ -37,4 +37,3 @@ Stack trace:
#0 %s(%d): a(NULL)
#1 {main}
thrown in %s on line %d

View File

@ -12,7 +12,6 @@ var_dump(defined("PHP_VERSION"));
var_dump(constant("PHP_VERSION"));
var_dump(call_user_func("strlen"));
var_dump(is_string("xxx"));
--EXPECTF--
bool(false)
bool(true)

View File

@ -16,4 +16,3 @@ object(Foo)#%d (%d) {
[""]=>
int(1)
}

View File

@ -28,4 +28,3 @@ Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in
Stack trace:
#0 {main}
thrown in %s on line %d

View File

@ -27,4 +27,3 @@ bool(true)
bool(false)
bool(true)
bool(true)

View File

@ -29,4 +29,3 @@ string(4) "Test"
bool(true)
int(1)
string(4) "Test"

View File

@ -19,4 +19,3 @@ string(7) "default"
string(7) "default"
string(7) "default"
string(7) "default"

View File

@ -81,4 +81,3 @@ float(INF)
Double mod
Type: DivisionByZeroError
Message: Modulo by zero

View File

@ -18,9 +18,7 @@ var_dump($foo);
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d

View File

@ -10,4 +10,3 @@ class B extends A {
}
--EXPECTF--
Warning: Declaration of B::m(array $a = Array) should be compatible with A::m(?array $a = NULL) in %sbug71428.1.php on line 7

View File

@ -20,4 +20,3 @@ echo "ok";
?>
--EXPECT--
ok

View File

@ -8,4 +8,3 @@ class C extends B { public function m(A $a , $n) { echo "C.m";} };
?>
--EXPECTF--
Warning: Declaration of C::m(A $a, $n) should be compatible with B::m(?A $a, $n) in %sbug71428.3.php on line 4

View File

@ -16,7 +16,6 @@ function test(&$param) {
?>
--EXPECTF--
Notice: Only variables should be passed by reference in %s on line %d
object(stdClass)#1 (0) {
}
@ -24,4 +23,3 @@ object(stdClass)#1 (0) {
Notice: Only variables should be passed by reference in %s on line %d
int(2)
int(1)

View File

@ -10,9 +10,7 @@ set_error_handler(
);
(function (int $i) { bar(); })("7as");
--EXPECTF--
Fatal error: Uncaught Exception: My custom error in %s:%d
Stack trace:
#0 %s(%d): {closure}(8, 'A non well form...', '%s', %d, Array)

View File

@ -16,4 +16,3 @@ echo "OK\n";
?>
--EXPECTF--
Fatal error: Declaration of Hello::bar(array $baz = Array) must be compatible with Foo::bar(?array $baz = NULL) in %s on line %d

View File

@ -16,4 +16,3 @@ echo "Value: {$properties[1234]}\n";
--EXPECT--
bool(true)
Value: Numeric

View File

@ -23,4 +23,3 @@ Fatal error: Uncaught Error: Undefined class constant 'I::FOO' in %sbug74657.php
Stack trace:
#0 {main}
thrown in %sbug74657.php on line %d

View File

@ -23,4 +23,3 @@ object(Closure)#2 (1) {
string(10) "<required>"
}
}

View File

@ -17,4 +17,3 @@ var_dump($name);
string(6) "foofoo"
int(42)
int(24)

View File

@ -13,7 +13,6 @@ class Test
call_user_func("Test::Two", 'A', 'B');
call_user_func(array("Test", "Three"), NULL, 0, false);
Test::Four(5, 6, 7, 8);
--EXPECT--
Two() called with 2 arguments
Three() called with 3 arguments

View File

@ -21,4 +21,3 @@ Notice: Undefined variable: i in %sclosure_012.php on line 2
Notice: Undefined variable: i in %sclosure_012.php on line 7
NULL
int(2)

View File

@ -12,4 +12,3 @@ Fatal error: Uncaught Error: Closure object cannot have properties in %sclosure_
Stack trace:
#0 {main}
thrown in %sclosure_022.php on line 5

View File

@ -11,4 +11,3 @@ class foo {
foo::bar();
--EXPECT--
Done

View File

@ -16,4 +16,3 @@ try {
?>
--EXPECT--
Error: Closure object cannot have properties

View File

@ -67,4 +67,3 @@ Array
)
#0 {closure}(23) called at [%s:%d]
#1 test(Closure Object ()) called at [%s:%d]

View File

@ -63,7 +63,6 @@ $d = $nonstaticUnscoped->bindTo(new B); $d(); echo " (should be scoped to dummy
$d = $nonstaticScoped->bindTo(new B); $d(); echo "\n";
echo "Done.\n";
--EXPECTF--
Before binding
scoped to A: bool(false)

View File

@ -38,7 +38,6 @@ $d = $staticUnscoped->bindTo(new A, 'A');
$d = $staticScoped->bindTo(new A, 'A');
echo "Done.\n";
--EXPECTF--
Before binding
bool(false)

View File

@ -38,7 +38,6 @@ $d = $nonstaticUnscoped->bindTo(new A, 'A'); $d(); echo "\n";
$d = $nonstaticScoped->bindTo(new A, 'A'); $d(); echo "\n";
echo "Done.\n";
--EXPECT--
Before binding
bool(false)

View File

@ -13,6 +13,5 @@ $a = A::foo();
$a->bindTo(new A);
echo "Done.\n";
--EXPECT--
Done.

View File

@ -38,7 +38,6 @@ echo "After binding, with different instance for the bound one", "\n";
$d = $nonstaticScoped->bindTo(new B, "static"); $d(); echo "\n";
echo "Done.\n";
--EXPECT--
Before binding
bool(false)

View File

@ -1,6 +1,5 @@
--TEST--
Closure 049: static::class in static closure in non-static method.
--FILE--
<?php

View File

@ -1,6 +1,5 @@
--TEST--
Closure 050: static::class in non-static closure in non-static method.
--FILE--
<?php
@ -17,6 +16,5 @@ class B extends A {}
$b = new B;
var_dump($b->foo());
--EXPECT--
string(1) "B"

View File

@ -1,6 +1,5 @@
--TEST--
Closure 051: static::class in static closure in static method.
--FILE--
<?php
@ -16,6 +15,5 @@ class A {
class B extends A {}
var_dump(B::foo());
--EXPECT--
string(1) "B"

View File

@ -1,6 +1,5 @@
--TEST--
Closure 052: static::class in non-static closure in static method.
--FILE--
<?php
@ -16,6 +15,5 @@ class A {
class B extends A {}
var_dump(B::foo());
--EXPECT--
string(1) "B"

View File

@ -1,6 +1,5 @@
--TEST--
Closure 053: self::class in static closure in non-static method.
--FILE--
<?php
@ -17,6 +16,5 @@ class B extends A {}
$b = new B;
var_dump($b->foo());
--EXPECT--
string(1) "A"

View File

@ -1,6 +1,5 @@
--TEST--
Closure 054: self::class in non-static closure in non-static method.
--FILE--
<?php
@ -17,6 +16,5 @@ class B extends A {}
$b = new B;
var_dump($b->foo());
--EXPECT--
string(1) "A"

View File

@ -1,6 +1,5 @@
--TEST--
Closure 055: self::class in static closure in static method.
--FILE--
<?php
@ -16,6 +15,5 @@ class A {
class B extends A {}
var_dump(B::foo());
--EXPECT--
string(1) "A"

View File

@ -1,6 +1,5 @@
--TEST--
Closure 056: self::class in non-static closure in static method.
--FILE--
<?php
@ -16,6 +15,5 @@ class A {
class B extends A {}
var_dump(B::foo());
--EXPECT--
string(1) "A"

View File

@ -1,6 +1,5 @@
--TEST--
Bug 66622: Closures do not correctly capture the late bound class (static::) in some cases
--FILE--
<?php
class A {
@ -29,7 +28,6 @@ function test() {
B::baz();
}
test();
--EXPECT--
B vs B
B vs B

View File

@ -98,7 +98,6 @@ echo $fn(" OK".PHP_EOL);
?>
===DONE===
--EXPECT--
Access public static function OK
Access public static function with different case OK
Access public static function with colon scheme OK

View File

@ -195,7 +195,6 @@ echo "OK\n";
?>
===DONE===
--EXPECT--
Cannot access privateInstance method statically
Cannot access privateInstance method statically with colon scheme
Cannot access privateInstance method

View File

@ -50,7 +50,6 @@ var_dump($d.$d);
echo "Done\n";
?>
--EXPECTF--
Notice: Array to string conversion in %sconcat_001.php on line %d
string(24) "Arraythis is test object"

View File

@ -21,4 +21,3 @@ echo "Done\n";
--EXPECT--
int(33554432)
Done

View File

@ -7,7 +7,6 @@ error_reporting(E_ALL);
var_dump("foobar"[3]);
var_dump("foobar"[2][0]);
var_dump("foobar"["foo"]["bar"]);
--EXPECTF--
string(1) "b"
string(1) "o"

View File

@ -30,7 +30,6 @@ var_dump(define('ELEPHPANT', [new StdClass]));
$recursive = [];
$recursive[0] = &$recursive;
var_dump(define('RECURSION', $recursive));
--EXPECTF--
array(4) {
[0]=>

View File

@ -8,4 +8,3 @@ const A = [][] ?? 1;
?>
--EXPECTF--
Fatal error: Cannot use [] for reading in %s.php on line %d

View File

@ -45,7 +45,6 @@ var_dump(
?>
--EXPECTF--
Warning: A non-numeric value encountered in %s on line %d
int(3)
string(4) "1foo"

View File

@ -13,4 +13,3 @@ Fatal error: Uncaught Error: Cannot declare self-referencing constant 'self::BAR
Stack trace:
#0 {main}
thrown in %s on line %d

View File

@ -36,4 +36,3 @@ Stack trace:
#0 %s(%d): CL->load('class://non.exi...')
#1 {main}
thrown in %s on line %d

View File

@ -6,5 +6,4 @@ declare(ticks = UNKNOWN_CONST) {
echo 'Done';
}
--EXPECTF--
Fatal error: declare(ticks) value must be a literal in %sdeclare_006.php on line 2

View File

@ -10,5 +10,4 @@ class test {
echo "Done\n";
?>
--EXPECTF--
Fatal error: Class test contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (test::foo) in %s on line %d

View File

@ -7,7 +7,6 @@ throw new Exception(1);
?>
--EXPECTF--
Fatal error: Uncaught Exception: 1 in %s:%d
Stack trace:
#0 {main}

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