Add many missing closing PHP tags to tests

Closes GH-5958
This commit is contained in:
Máté Kocsis 2020-08-09 11:06:57 +02:00
parent 05478e985e
commit 7aacc705d0
No known key found for this signature in database
GPG key ID: FD055E41728BF310
1103 changed files with 1097 additions and 30 deletions

View file

@ -19,6 +19,7 @@ class Ext extends Base
$a = new Ext(); $a = new Ext();
$a->someMethod("foo"); $a->someMethod("foo");
$a->someMethod(); $a->someMethod();
?>
--EXPECT-- --EXPECT--
foo foo
default default

View file

@ -3,6 +3,7 @@ declare bare anonymous class
--FILE-- --FILE--
<?php <?php
var_dump(new class{}); var_dump(new class{});
?>
--EXPECTF-- --EXPECTF--
object(class@%s)#%d (0) { object(class@%s)#%d (0) {
} }

View file

@ -15,6 +15,7 @@ $a = new class extends A implements B {
}; };
var_dump($a instanceof A, $a instanceof B); var_dump($a instanceof A, $a instanceof B);
?>
--EXPECT-- --EXPECT--
bool(true) bool(true)
bool(true) bool(true)

View file

@ -10,6 +10,7 @@ while (@$i++<10) {
} }
}); });
} }
?>
--EXPECTF-- --EXPECTF--
object(class@%s)#1 (1) { object(class@%s)#1 (1) {
["i"]=> ["i"]=>

View file

@ -26,5 +26,6 @@ $outer = new Outer(array(
/* not null because inheritance */ /* not null because inheritance */
var_dump($outer->getArrayAccess()[0]); var_dump($outer->getArrayAccess()[0]);
?>
--EXPECTF-- --EXPECTF--
int(%d) int(%d)

View file

@ -32,5 +32,6 @@ $proxy = $outer->getArrayAccess();
/* null because no inheritance, so no access to protected member */ /* null because no inheritance, so no access to protected member */
var_dump(@$outer->getArrayAccess()[0]); var_dump(@$outer->getArrayAccess()[0]);
?>
--EXPECT-- --EXPECT--
NULL NULL

View file

@ -9,6 +9,7 @@ namespace lone {
namespace { namespace {
var_dump ($hello); var_dump ($hello);
} }
?>
--EXPECTF-- --EXPECTF--
object(class@%s)#1 (0) { object(class@%s)#1 (0) {
} }

View file

@ -17,6 +17,7 @@ namespace lone {
new Outer(); new Outer();
} }
?>
--EXPECTF-- --EXPECTF--
object(class@%s)#2 (0) { object(class@%s)#2 (0) {
} }

View file

@ -18,6 +18,7 @@ $anonClass = new class("cats", "dogs") {
var_dump($anonClass::$foo); var_dump($anonClass::$foo);
var_dump($anonClass::getBar()); var_dump($anonClass::getBar());
?>
--EXPECT-- --EXPECT--
string(4) "cats" string(4) "cats"
string(4) "dogs" string(4) "dogs"

View file

@ -14,5 +14,6 @@ $anonClass = new class {
}; };
var_dump($anonClass->someMethod()); var_dump($anonClass->someMethod());
?>
--EXPECT-- --EXPECT--
string(3) "bar" string(3) "bar"

View file

@ -24,6 +24,7 @@ var_dump([...new ArrayIterator(['a', 'b', 'c'])]);
var_dump([0, ...$array, ...getArr(), 6, 7, 8, 9, 10, ...arrGen()]); var_dump([0, ...$array, ...getArr(), 6, 7, 8, 9, 10, ...arrGen()]);
var_dump([0, ...$array, ...$array, 'end']); var_dump([0, ...$array, ...$array, 'end']);
?>
--EXPECT-- --EXPECT--
array(0) { array(0) {
} }

View file

@ -22,6 +22,7 @@ try {
} catch (Error $ex) { } catch (Error $ex) {
echo "Exception: " . $ex->getMessage() . "\n"; echo "Exception: " . $ex->getMessage() . "\n";
} }
?>
--EXPECT-- --EXPECT--
array(5) { array(5) {
[0]=> [0]=>

View file

@ -13,5 +13,6 @@ try {
echo "Exception: " . $ex->getMessage() . "\n"; echo "Exception: " . $ex->getMessage() . "\n";
} }
?>
--EXPECT-- --EXPECT--
Exception: Cannot unpack Traversable with non-integer keys Exception: Cannot unpack Traversable with non-integer keys

View file

@ -10,6 +10,7 @@ unset($a); //array (0 => (refcount=1, is_ref=1)=1)
var_dump([...$b]); //array (0 => (refcount=0, is_ref=0)=1) var_dump([...$b]); //array (0 => (refcount=0, is_ref=0)=1)
?>
--EXPECT-- --EXPECT--
array(1) { array(1) {
[0]=> [0]=>

View file

@ -16,6 +16,7 @@ try {
var_dump($ex->getMessage()); var_dump($ex->getMessage());
} }
?>
--EXPECT-- --EXPECT--
string(36) "Cannot unpack array with string keys" string(36) "Cannot unpack array with string keys"
string(42) "Cannot unpack Traversable with string keys" string(42) "Cannot unpack Traversable with string keys"

View file

@ -5,6 +5,7 @@ array unpacking with undefinded variable
var_dump([...$arr]); var_dump([...$arr]);
?>
--EXPECTF-- --EXPECTF--
Warning: Undefined variable $arr in %s on line %d Warning: Undefined variable $arr in %s on line %d

View file

@ -8,5 +8,6 @@ assert.exception=0
assert_options(ASSERT_WARNING); assert_options(ASSERT_WARNING);
assert(false && ($a **= 2)); assert(false && ($a **= 2));
?>
--EXPECTF-- --EXPECTF--
Warning: assert(): assert(false && ($a **= 2)) failed in %s%ezend-pow-assign.php on line %d Warning: assert(): assert(false && ($a **= 2)) failed in %s%ezend-pow-assign.php on line %d

View file

@ -8,5 +8,6 @@ assert.exception=0
assert_options(ASSERT_WARNING); assert_options(ASSERT_WARNING);
assert(false && `echo -n ""`); assert(false && `echo -n ""`);
?>
--EXPECTF-- --EXPECTF--
Warning: assert(): assert(false && `echo -n ""`) failed in %s%east_serialize_backtick_literal.php on line %d Warning: assert(): assert(false && `echo -n ""`) failed in %s%east_serialize_backtick_literal.php on line %d

View file

@ -14,6 +14,7 @@ foreach ($attributes as $attribute) {
var_dump(get_class($a)); var_dump(get_class($a));
var_dump($a->flags == Attribute::TARGET_ALL); var_dump($a->flags == Attribute::TARGET_ALL);
} }
?>
--EXPECT-- --EXPECT--
string(9) "Attribute" string(9) "Attribute"
array(0) { array(0) {

View file

@ -5,5 +5,6 @@ Attributes: Prevent Attribute on non classes
@@Attribute @@Attribute
function foo() {} function foo() {}
?>
--EXPECTF-- --EXPECTF--
Fatal error: Attribute "Attribute" cannot target function (allowed targets: class) in %s Fatal error: Attribute "Attribute" cannot target function (allowed targets: class) in %s

View file

@ -11,5 +11,6 @@ if (!extension_loaded('zend-test')) {
@@ZendTestAttribute @@ZendTestAttribute
function foo() { function foo() {
} }
?>
--EXPECTF-- --EXPECTF--
Fatal error: Only classes can be marked with @@ZendTestAttribute in %s Fatal error: Only classes can be marked with @@ZendTestAttribute in %s

View file

@ -77,6 +77,7 @@ var_dump(-0b11111111111111111111111111111111);
var_dump(-0b1111111111111111111111111111111); var_dump(-0b1111111111111111111111111111111);
var_dump(-0b111111111111111111111111111111); var_dump(-0b111111111111111111111111111111);
var_dump(-0b1); var_dump(-0b1);
?>
--EXPECT-- --EXPECT--
int(1) int(1)
int(3) int(3)

View file

@ -79,6 +79,7 @@ var_dump(-0b1111111111111111111111111111111111111111111111111111111111111111);
var_dump(-0b111111111111111111111111111111111111111111111111111111111111111); var_dump(-0b111111111111111111111111111111111111111111111111111111111111111);
var_dump(-0b11111111111111111111111111111111111111111111111111111111111111); var_dump(-0b11111111111111111111111111111111111111111111111111111111111111);
var_dump(-0b1); var_dump(-0b1);
?>
--EXPECT-- --EXPECT--
int(1) int(1)
int(3) int(3)

View file

@ -13,6 +13,7 @@ try {
} catch (Exception $e) { } catch (Exception $e) {
var_dump($x); var_dump($x);
} }
?>
--EXPECT-- --EXPECT--
object(foo)#1 (0) { object(foo)#1 (0) {
} }

View file

@ -13,5 +13,6 @@ try {
} catch (Error $e) { } catch (Error $e) {
echo 'OK'; echo 'OK';
} }
?>
--EXPECT-- --EXPECT--
OK OK

View file

@ -24,6 +24,7 @@ foreach($a as $k => $d)
} }
// Alternatively $c = $a; and foreachloop removal will cause identical results. // Alternatively $c = $a; and foreachloop removal will cause identical results.
var_dump(key($a['b'])); var_dump(key($a['b']));
?>
--EXPECT-- --EXPECT--
int(3) int(3)
int(3) int(3)

View file

@ -35,6 +35,7 @@ $a = new A();
$b = new B(); $b = new B();
$c = new C(); $c = new C();
$d = new D(); $d = new D();
?>
--EXPECT-- --EXPECT--
A::foo A::foo
A::foo A::foo

View file

@ -19,6 +19,7 @@ foreach ($arr["v"] as $k => $v) {
var_dump($k); var_dump($k);
} }
var_dump(key($arr["v"])); var_dump(key($arr["v"]));
?>
--EXPECT-- --EXPECT--
int(0) int(0)
int(0) int(0)

View file

@ -17,6 +17,7 @@ foreach ($foo as $k => $v) {
var_dump($k); var_dump($k);
} }
var_dump(key($foo)); var_dump(key($foo));
?>
--EXPECT-- --EXPECT--
int(0) int(0)
int(0) int(0)

View file

@ -5,6 +5,7 @@ Bug #41401 (wrong precedence for unary minus)
echo 1/-2*5; echo 1/-2*5;
echo "\n"; echo "\n";
echo 6/+2*-3; echo 6/+2*-3;
?>
--EXPECT-- --EXPECT--
-2.5 -2.5
-9 -9

View file

@ -8,6 +8,7 @@ class foo {
} }
var_dump(get_class_vars("foo")); var_dump(get_class_vars("foo"));
?>
--EXPECT-- --EXPECT--
array(1) { array(1) {
["x"]=> ["x"]=>

View file

@ -20,6 +20,7 @@ $a = new A();
$a->foo(); $a->foo();
$b = new B(); $b = new B();
$b->foo(); $b->foo();
?>
--EXPECT-- --EXPECT--
bool(true) bool(true)
bool(true) bool(true)

View file

@ -11,5 +11,6 @@ function foo($c = ok::constant) {
} }
foo(); foo();
?>
--EXPECT-- --EXPECT--
ok ok

View file

@ -31,6 +31,7 @@ test2($x);
test3($x); test3($x);
test4($y); test4($y);
test5($x); test5($x);
?>
--EXPECTF-- --EXPECTF--
ok ok
ok ok

View file

@ -17,6 +17,7 @@ var_dump(defined('\\ns\\foo::ok'));
var_dump(defined('\\ns\\foo::bug')); var_dump(defined('\\ns\\foo::bug'));
var_dump(defined('ns\\bar::bug')); var_dump(defined('ns\\bar::bug'));
var_dump(defined('\\ns\\bar::bug')); var_dump(defined('\\ns\\bar::bug'));
?>
--EXPECT-- --EXPECT--
bool(true) bool(true)
bool(false) bool(false)

View file

@ -8,5 +8,6 @@ class Foo {}
class Bar {} class Bar {}
use Test\Bar; use Test\Bar;
echo "ok\n"; echo "ok\n";
?>
--EXPECT-- --EXPECT--
ok ok

View file

@ -11,6 +11,7 @@ class foo {
$foo = new foo; $foo = new foo;
$foo->bar($foo); // Ok! $foo->bar($foo); // Ok!
$foo->bar(new \stdclass); // Error, ok! $foo->bar(new \stdclass); // Error, ok!
?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: foobar\foo::bar(): Argument #1 ($a) must be of type foobar\foo, stdClass given, called in %s:%d Fatal error: Uncaught TypeError: foobar\foo::bar(): Argument #1 ($a) must be of type foobar\foo, stdClass given, called in %s:%d
Stack trace: Stack trace:

View file

@ -11,5 +11,6 @@ class foo {
$foo = new foo; $foo = new foo;
$foo->bar($foo); // Ok! $foo->bar($foo); // Ok!
$foo->bar(new stdclass); // Error, ok! $foo->bar(new stdclass); // Error, ok!
?>
--EXPECTF-- --EXPECTF--
Fatal error: '\self' is an invalid class name in %sbug43332_2.php on line 5 Fatal error: '\self' is an invalid class name in %sbug43332_2.php on line 5

View file

@ -22,6 +22,7 @@ var_dump(is_callable("Test::foo"));
var_dump(is_callable("\\Test::foo")); var_dump(is_callable("\\Test::foo"));
var_dump(is_callable("is_string")); var_dump(is_callable("is_string"));
var_dump(is_callable("\\is_string")); var_dump(is_callable("\\is_string"));
?>
--EXPECT-- --EXPECT--
bool(false) bool(false)
bool(false) bool(false)

View file

@ -21,6 +21,7 @@ class Y extends X
$y = Y::cheat(5); $y = Y::cheat(5);
echo $y->x, PHP_EOL; echo $y->x, PHP_EOL;
?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught Error: Call to private X::__construct() from scope Y in %s:%d Fatal error: Uncaught Error: Call to private X::__construct() from scope Y in %s:%d
Stack trace: Stack trace:

View file

@ -33,6 +33,7 @@ class Bar2 extends Foo2 {
} }
new Bar2(array()); new Bar2(array());
?>
--EXPECT-- --EXPECT--
array(0) { array(0) {
} }

View file

@ -6,6 +6,7 @@ $a = "string";
$b = &$a[1]; $b = &$a[1];
$b = "f"; $b = "f";
echo $a; echo $a;
?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught Error: Cannot create references to/from string offsets in %sbug49866.php:3 Fatal error: Uncaught Error: Cannot create references to/from string offsets in %sbug49866.php:3
Stack trace: Stack trace:

View file

@ -17,6 +17,7 @@ $proxy = new Proxy;
call_user_func_array( array( $proxy, 'bar' ), $args ); call_user_func_array( array( $proxy, 'bar' ), $args );
call_user_func_array( array( $proxy, 'bar' ), array(&$arg) ); call_user_func_array( array( $proxy, 'bar' ), array(&$arg) );
var_dump($arg); var_dump($arg);
?>
--EXPECT-- --EXPECT--
bar called! bar called!
bar called! bar called!

View file

@ -35,6 +35,7 @@ var_dump($mapWithoutConst0[1]);
var_dump($mapWithoutConst1[1]); var_dump($mapWithoutConst1[1]);
var_dump($mapWithoutConst2[1]); var_dump($mapWithoutConst2[1]);
var_dump($mapWithoutConst3[1]); var_dump($mapWithoutConst3[1]);
?>
--EXPECT-- --EXPECT--
string(3) "two" string(3) "two"
string(3) "two" string(3) "two"

View file

@ -12,6 +12,7 @@ function eh()
set_error_handler("eh"); set_error_handler("eh");
$a = $empty($b); $a = $empty($b);
?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught Exception: error! in %sbug51394.php:%d Fatal error: Uncaught Exception: error! in %sbug51394.php:%d
Stack trace: Stack trace:

View file

@ -69,6 +69,7 @@ $foo->f1()[0]++;
var_dump($foo->a1[0]); var_dump($foo->a1[0]);
$foo->f6()[0]++; $foo->f6()[0]++;
var_dump($foo->a1[0]); var_dump($foo->a1[0]);
?>
--EXPECT-- --EXPECT--
NULL NULL
array(0) { array(0) {

View file

@ -12,5 +12,6 @@ $myGlobal=new MyClass();
$myGlobal->myRef=&$myGlobal; $myGlobal->myRef=&$myGlobal;
$myGlobal->myNonExistentProperty="ok\n"; $myGlobal->myNonExistentProperty="ok\n";
echo $myGlobal; echo $myGlobal;
?>
--EXPECT-- --EXPECT--
ok ok

View file

@ -19,6 +19,7 @@ function test() {
test(); test();
echo "bug\n"; echo "bug\n";
?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught Exception: ops 1 in %sbug53511.php:4 Fatal error: Uncaught Exception: ops 1 in %sbug53511.php:4
Stack trace: Stack trace:

View file

@ -15,6 +15,7 @@ echo (defined('ChildClass::TEST_CONSTANT') ? 'true' : 'false') . "\n";
echo (is_subclass_of('ParentClass', 'MyInterface') ? 'true' : 'false') . "\n"; echo (is_subclass_of('ParentClass', 'MyInterface') ? 'true' : 'false') . "\n";
echo (defined('ParentClass::TEST_CONSTANT') ? 'true' : 'false') . "\n"; echo (defined('ParentClass::TEST_CONSTANT') ? 'true' : 'false') . "\n";
?>
--EXPECT-- --EXPECT--
true true
true true

View file

@ -41,6 +41,7 @@ function test_3() {
} }
$f = test_3(); $f(); $f = test_3(); $f();
$f = test_3(); $f(); $f = test_3(); $f();
?>
--EXPECT-- --EXPECT--
Outer function increments $v to 1 Outer function increments $v to 1
Inner function reckons $v is 1 Inner function reckons $v is 1

View file

@ -31,5 +31,6 @@ class Test
} }
$x = new Test(); $x = new Test();
Test::$mystatic = new DestructorCreator(); Test::$mystatic = new DestructorCreator();
?>
--EXPECTF-- --EXPECTF--
Fatal error: Allowed memory size of %s bytes exhausted%s(tried to allocate %s bytes) in %s on line %d Fatal error: Allowed memory size of %s bytes exhausted%s(tried to allocate %s bytes) in %s on line %d

View file

@ -13,6 +13,7 @@ var_dump("0x7fffffffffffffff" == "9223372036854775808");
/* not exactly what the bug is about, but closely related problem: */ /* not exactly what the bug is about, but closely related problem: */
var_dump("999223372036854775807"=="999223372036854775808"); var_dump("999223372036854775807"=="999223372036854775808");
var_dump("899223372036854775807">"00999223372036854775807"); var_dump("899223372036854775807">"00999223372036854775807");
?>
--EXPECT-- --EXPECT--
bool(false) bool(false)
bool(false) bool(false)

View file

@ -24,5 +24,6 @@ class B extends A {}
$input = new B(); $input = new B();
echo $input->getEmail(); echo $input->getEmail();
?>
--EXPECT-- --EXPECT--
No such method - 'noSuchMethod' No such method - 'noSuchMethod'

View file

@ -24,6 +24,7 @@ $test->{'method'}();
Test::method(); Test::method();
Test::$method(); Test::$method();
Test::{'method'}(); Test::{'method'}();
?>
--EXPECT-- --EXPECT--
method method
method method

View file

@ -12,6 +12,7 @@ class C { use T1; }
$c1 = new C; $c1 = new C;
$c1->inc(); $c1->inc();
$c1->inc(); $c1->inc();
?>
--EXPECT-- --EXPECT--
1 1
2 2

View file

@ -7,5 +7,6 @@ $arr = array("test");
list($a,$b) = is_array($arr)? $arr : $arr; list($a,$b) = is_array($arr)? $arr : $arr;
list($c,$d) = is_array($arr)?: NULL; list($c,$d) = is_array($arr)?: NULL;
echo "ok\n"; echo "ok\n";
?>
--EXPECT-- --EXPECT--
ok ok

View file

@ -59,6 +59,7 @@ if (empty($arr['exists'][1][0])) {
var_dump($arr['exists'][1][0]); var_dump($arr['exists'][1][0]);
} }
echo "DONE"; echo "DONE";
?>
--EXPECT-- --EXPECT--
sub-key 'non_existent' is not set. sub-key 'non_existent' is not set.
sub-key 1 is set: string(1) "o" sub-key 1 is set: string(1) "o"

View file

@ -14,5 +14,6 @@ class Some {
} }
new Foo; new Foo;
echo "done\n"; echo "done\n";
?>
--EXPECT-- --EXPECT--
done done

View file

@ -14,5 +14,6 @@ $cls->{true}();
$cls->{false}(); $cls->{false}();
$cls->{null}(); $cls->{null}();
echo "ok\n"; echo "ok\n";
?>
--EXPECTF-- --EXPECTF--
Fatal error: Method name must be a string in %sbug60613.php on line %d Fatal error: Method name must be a string in %sbug60613.php on line %d

View file

@ -9,6 +9,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){
}); });
require 'notfound.php'; require 'notfound.php';
?>
--EXPECTF-- --EXPECTF--
error(require(notfound.php): Failed to open stream: %s) error(require(notfound.php): Failed to open stream: %s)
Fatal error: Uncaught Exception: Foo in %sbug60909_1.php:5 Fatal error: Uncaught Exception: Foo in %sbug60909_1.php:5

View file

@ -12,6 +12,7 @@ class Bad {
$bad = new Bad(); $bad = new Bad();
echo "$bad"; echo "$bad";
?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught Exception: I CAN DO THIS in %s:%d Fatal error: Uncaught Exception: I CAN DO THIS in %s:%d
Stack trace: Stack trace:

View file

@ -21,6 +21,7 @@ for ($i = 0; $i < 3; $i++) {
strip_tags(new T); strip_tags(new T);
} }
var_dump($handler); var_dump($handler);
?>
--EXPECTF-- --EXPECTF--
object(T)#%d (1) { object(T)#%d (1) {
["_this"]=> ["_this"]=>

View file

@ -10,6 +10,7 @@ Bug #61273 (call_user_func_array with more than 16333 arguments leaks / crashes)
$args = array_fill(0, 64 * 1024 - 64, 0); $args = array_fill(0, 64 * 1024 - 64, 0);
call_user_func_array(function(&$a) {}, $args); call_user_func_array(function(&$a) {}, $args);
echo strval("okey"); echo strval("okey");
?>
--EXPECTF-- --EXPECTF--
Warning: {closure}(): Argument #1 ($a) must be passed by reference, value given in %s on line %d Warning: {closure}(): Argument #1 ($a) must be passed by reference, value given in %s on line %d
okey okey

View file

@ -14,6 +14,7 @@ register_shutdown_function(function(){
//$undefined = null; // defined variable does not cause problems //$undefined = null; // defined variable does not cause problems
$undefined->foo(); $undefined->foo();
?>
--EXPECTF-- --EXPECTF--
Error handler called (Undefined variable $undefined) Error handler called (Undefined variable $undefined)

View file

@ -23,6 +23,7 @@ Bug #61782 (__clone/__destruct do not match other methods when checking access c
$obj = new LatchkeyKid(); $obj = new LatchkeyKid();
echo "DONE\n"; echo "DONE\n";
?>
--EXPECT-- --EXPECT--
In LatchkeyKid: In LatchkeyKid:
MommasBoy::__clone MommasBoy::__clone

View file

@ -12,5 +12,6 @@ class Bar extends Foo {
} }
echo 'DONE'; echo 'DONE';
?>
--EXPECT-- --EXPECT--
DONE DONE

View file

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

View file

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

View file

@ -10,6 +10,7 @@ var_dump("02147483647" == "2147483647",
"02147483648" == "2147483648", "02147483648" == "2147483648",
"09007199254740991" == "9007199254740991", "09007199254740991" == "9007199254740991",
"09007199254740992" == "9007199254740992"); "09007199254740992" == "9007199254740992");
?>
--EXPECT-- --EXPECT--
bool(true) bool(true)
bool(true) bool(true)

View file

@ -25,5 +25,6 @@ class Bar extends Foo
$x = new Bar; $x = new Bar;
var_dump($x->run()); var_dump($x->run());
?>
--EXPECT-- --EXPECT--
string(3) "Bar" string(3) "Bar"

View file

@ -34,6 +34,7 @@ for ($n = 0; $n < 20; $n++) {
echo "$n\n"; echo "$n\n";
} }
echo "ok\n"; echo "ok\n";
?>
--EXPECT-- --EXPECT--
0 0
1 1

View file

@ -10,6 +10,7 @@ $test = new Test();
var_dump(isset($test->protectedProperty)); var_dump(isset($test->protectedProperty));
var_dump(isset($test->protectedProperty->foo)); var_dump(isset($test->protectedProperty->foo));
?>
--EXPECT-- --EXPECT--
bool(false) bool(false)
bool(false) bool(false)

View file

@ -13,5 +13,6 @@ try {
} catch(Throwable $e) { } catch(Throwable $e) {
echo "Exception is thrown"; echo "Exception is thrown";
} }
?>
--EXPECT-- --EXPECT--
Exception is thrown Exception is thrown

View file

@ -15,6 +15,7 @@ trait T2 {
} }
print_r(get_class_methods("A")); print_r(get_class_methods("A"));
print_r(get_class_methods("B")); print_r(get_class_methods("B"));
?>
--EXPECT-- --EXPECT--
Array Array
( (

View file

@ -34,5 +34,6 @@ $o = new obj;
$o['x'] = 1; $o['x'] = 1;
++$o['x']; ++$o['x'];
echo $o['x'], "\n"; echo $o['x'], "\n";
?>
--EXPECT-- --EXPECT--
2 2

View file

@ -9,6 +9,7 @@ function x($s) { $s['2a'] = 1; };
$y = '1'; $y = '1';
x($y); x($y);
print_r($y); print_r($y);
?>
--EXPECT-- --EXPECT--
string(26) "Illegal string offset "2a"" string(26) "Illegal string offset "2a""
1 1

View file

@ -22,6 +22,7 @@ Class E {
} }
$isCallable = is_callable(array('E', 'f')); $isCallable = is_callable(array('E', 'f'));
var_dump($isCallable); var_dump($isCallable);
?>
--EXPECT-- --EXPECT--
bool(false) bool(false)
bool(false) bool(false)

View file

@ -16,5 +16,6 @@ catch (Exception $e)
{ {
echo 'caught'; echo 'caught';
} }
?>
--EXPECT-- --EXPECT--
caught caught

View file

@ -53,6 +53,7 @@ function foo3() {
} }
$bar = foo3(); $bar = foo3();
?>
--EXPECTF-- --EXPECTF--
string(9) "not catch" string(9) "not catch"
NULL NULL

View file

@ -23,7 +23,6 @@ class Test
$test = new Test(); $test = new Test();
?> ?>
--EXPECT-- --EXPECT--
array ( array (
1 => 'first', 1 => 'first',

View file

@ -10,5 +10,6 @@ class B extends A {
} }
const C = B::BHW; const C = B::BHW;
echo C, "\n"; echo C, "\n";
?>
--EXPECT-- --EXPECT--
this is A extended by B this is A extended by B

View file

@ -57,6 +57,7 @@ function bar() {
echo "13\n"; echo "13\n";
} }
bar(); bar();
?>
--EXPECT-- --EXPECT--
1 1
2 2

View file

@ -14,6 +14,7 @@ crash();
echo "made it once\n"; echo "made it once\n";
crash(); crash();
echo "ok\n"; echo "ok\n";
?>
--EXPECTF-- --EXPECTF--
Warning: Undefined variable $i in %s on line %d Warning: Undefined variable $i in %s on line %d
made it once made it once

View file

@ -8,5 +8,6 @@ class FooBar {
const bar = ["bar" => 3]["bar"]; const bar = ["bar" => 3]["bar"];
} }
echo "okey"; echo "okey";
?>
--EXPECT-- --EXPECT--
okey okey

View file

@ -21,6 +21,7 @@ a::staticTest();
$b = new b(); $b = new b();
$b->test(); $b->test();
?>
--EXPECTF-- --EXPECTF--
string(%d) "The magic method b::__invoke() must have public visibility" string(%d) "The magic method b::__invoke() must have public visibility"
b::test() b::test()

View file

@ -13,6 +13,7 @@ a::staticTest();
$b = new b(); $b = new b();
$b->test(); $b->test();
?>
--EXPECTF-- --EXPECTF--
Warning: The magic method b::__invoke() must have public visibility in %s on line %d Warning: The magic method b::__invoke() must have public visibility in %s on line %d
b::test() b::test()

View file

@ -12,5 +12,6 @@ $c = new C();
$x = $c->test(); $x = $c->test();
print_r($x); print_r($x);
unset($c, $x); unset($c, $x);
?>
--EXPECTF-- --EXPECTF--
Fatal error: Cannot unset $this in %sbug68370.php on line 4 Fatal error: Cannot unset $this in %sbug68370.php on line 4

View file

@ -26,6 +26,7 @@ $obj = new A;
$obj["a"] = 1; $obj["a"] = 1;
$obj["a"] .= "test"; $obj["a"] .= "test";
var_dump($obj["a"]); var_dump($obj["a"]);
?>
--EXPECT-- --EXPECT--
string(5) "1test" string(5) "1test"
string(5) "1test" string(5) "1test"

View file

@ -21,6 +21,7 @@ $foo->bad->x = new stdClass;
unset($foo); unset($foo);
gc_collect_cycles(); gc_collect_cycles();
var_dump($bar); var_dump($bar);
?>
--EXPECT-- --EXPECT--
object(bad)#2 (2) { object(bad)#2 (2) {
["x"]=> ["x"]=>

View file

@ -30,6 +30,7 @@ unserialize(serialize($foo));
gc_collect_cycles(); gc_collect_cycles();
var_dump($bar); var_dump($bar);
?>
--EXPECT-- --EXPECT--
object(bad)#4 (1) { object(bad)#4 (1) {
["_private"]=> ["_private"]=>

View file

@ -19,6 +19,7 @@ $wpq = new wpq;
$wpq->interesting =& ret_assoc(); $wpq->interesting =& ret_assoc();
$x = $wpq->interesting; $x = $wpq->interesting;
printf("%s\n", $x); printf("%s\n", $x);
?>
--EXPECTF-- --EXPECTF--
Warning: Undefined property: wpq::$interesting in %s on line %d Warning: Undefined property: wpq::$interesting in %s on line %d

View file

@ -6,6 +6,7 @@ Bug #69891: Unexpected array comparison result
var_dump([1, 2, 3] <=> []); var_dump([1, 2, 3] <=> []);
var_dump([] <=> [1, 2, 3]); var_dump([] <=> [1, 2, 3]);
var_dump([1] <=> [2, 3]); var_dump([1] <=> [2, 3]);
?>
--EXPECT-- --EXPECT--
int(1) int(1)
int(-1) int(-1)

View file

@ -25,6 +25,7 @@ class C10 implements ArrayAccess
$c10 = new C10; $c10 = new C10;
var_dump($c10[] += 5); var_dump($c10[] += 5);
?>
--EXPECT-- --EXPECT--
Inside C10::offsetGet Inside C10::offsetGet
NULL NULL

View file

@ -16,6 +16,7 @@ function &foo1() :string {
var_dump(foo()); var_dump(foo());
var_dump(foo1()); var_dump(foo1());
?>
--EXPECT-- --EXPECT--
string(1) "1" string(1) "1"
string(3) "ref" string(3) "ref"

View file

@ -35,5 +35,6 @@ unset($t);
unset($a); unset($a);
var_dump(gc_collect_cycles()); var_dump(gc_collect_cycles());
?>
--EXPECT-- --EXPECT--
int(2) int(2)

View file

@ -22,5 +22,6 @@ class B extends A {
$b = new B; $b = new B;
$b->test(); $b->test();
?>
--EXPECT-- --EXPECT--
bool(true) bool(true)

View file

@ -3,6 +3,7 @@ Bug #71221 (Null pointer deref (segfault) in get_defined_vars via ob_start)
--FILE-- --FILE--
<?php <?php
register_shutdown_function("get_defined_vars"); register_shutdown_function("get_defined_vars");
?>
--EXPECT-- --EXPECT--
Fatal error: Uncaught Error: Cannot call get_defined_vars() dynamically in [no active file]:0 Fatal error: Uncaught Error: Cannot call get_defined_vars() dynamically in [no active file]:0
Stack trace: Stack trace:

View file

@ -21,5 +21,6 @@ class Y extends X implements InterfaceY {
} }
echo "ok"; echo "ok";
?>
--EXPECT-- --EXPECT--
ok ok

View file

@ -8,5 +8,6 @@ class A {
class B extends A { class B extends A {
public function m(array $a = []) {} public function m(array $a = []) {}
} }
?>
--EXPECTF-- --EXPECTF--
Fatal error: Declaration of B::m(array $a = []) must be compatible with A::m(?array $a = null) in %s on line %d Fatal error: Declaration of B::m(array $a = []) must be compatible with A::m(?array $a = null) in %s on line %d

View file

@ -73,6 +73,7 @@ $OuterMatcher->methodNameMatcher = null;
$OuterMatcher->stub = new PHPUnit_Framework_MockObject_Stub_ReturnCallback([$foo, 'callback']); $OuterMatcher->stub = new PHPUnit_Framework_MockObject_Stub_ReturnCallback([$foo, 'callback']);
$a = $b = $c = 0; $a = $b = $c = 0;
$foo->bar($a, $b, $c); $foo->bar($a, $b, $c);
?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught Error: Class "DoesNotExists" not found in %s:%d Fatal error: Uncaught Error: Class "DoesNotExists" not found in %s:%d
Stack trace: Stack trace:

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