Close PHP tags in tests

Closes GH-12422
This commit is contained in:
Ilija Tovilo 2023-10-11 23:03:11 +02:00
parent 1c9c3af157
commit f39b5c4c25
No known key found for this signature in database
GPG Key ID: A4F5D403F118200A
237 changed files with 252 additions and 5 deletions

View File

@ -4,6 +4,7 @@ Bug #54547: wrong equality of string numbers near LONG_MAX with 64-bit longs
<?php
if (PHP_INT_MAX !== 9223372036854775807)
die("skip for 64-bit long systems only");
?>
--FILE--
<?php
var_dump("9223372036854775807" == "9223372036854775808");

View File

@ -32,5 +32,6 @@ try {
}
}
echo 'okey';
?>
--EXPECT--
okey

View File

@ -4,6 +4,7 @@ Bug #62097: fix for bug #54547 is wrong for 32-bit machines
<?php
if (PHP_INT_MAX !== 2147483647)
die('skip for system with 32-bit wide longs only');
?>
--FILE--
<?php
var_dump("02147483647" == "2147483647",

View File

@ -18,5 +18,6 @@ class C extends B {
}
}
echo "okey";
?>
--EXPECT--
okey

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,7 @@ Bug #65969 (Chain assignment with T_LIST failure)
$obj = new stdClass;
list($a,$b) = $obj->prop = [1,2];
var_dump($a,$b);
?>
--EXPECT--
int(1)
int(2)

View File

@ -3,5 +3,6 @@ Invalid consecutive numeric separators after hex literal
--FILE--
<?php
0x0__F;
?>
--EXPECTF--
Parse error: syntax error, unexpected identifier "__F" in %s on line %d

View File

@ -3,5 +3,6 @@ Invalid consecutive numeric separators after binary literal
--FILE--
<?php
0b0__1
?>
--EXPECTF--
Parse error: syntax error, unexpected identifier "__1" in %s on line %d

View File

@ -17,5 +17,6 @@ function a() {
}
foreach(a() as $v);
?>
--EXPECTF--
Fatal error: Allowed memory size of %d bytes exhausted %s

View File

@ -20,6 +20,7 @@ A::out();
B::out();
C::out();
echo PHP_EOL;
?>
--EXPECT--
A
B

View File

@ -19,6 +19,7 @@ class C extends A {
A::out();
B::out();
C::out();
?>
--EXPECT--
A
B

View File

@ -10,5 +10,6 @@ class Bar {
}
new Bar();
echo "ok\n";
?>
--EXPECT--
ok

View File

@ -64,5 +64,6 @@ $test
->f()->f()->f()->f()->f()->f()->f()->f()->f()->f()
;
?>
--EXPECTF--
Fatal error: Maximum call stack size of %d bytes reached during compilation. Try splitting expression in %s on line %d

View File

@ -116,5 +116,6 @@ $test = [
1
];
?>
--EXPECTF--
Fatal error: Maximum call stack size of %d bytes reached during compilation. Try splitting expression in %s on line %d

View File

@ -21,6 +21,7 @@ gc_collect_cycles();
var_dump($map);
?>
--EXPECTF--
object(WeakMap)#%d (1) {
[0]=>

View File

@ -21,6 +21,7 @@ gc_collect_cycles();
var_dump($map);
?>
--EXPECTF--
object(WeakMap)#%d (1) {
[0]=>

View File

@ -26,6 +26,7 @@ gc_collect_cycles();
var_dump($ref->get());
?>
--EXPECTF--
object(WeakMap)#%d (1) {
[0]=>

View File

@ -26,6 +26,7 @@ gc_collect_cycles();
var_dump($ref->get());
?>
--EXPECTF--
object(WeakMap)#%d (1) {
[0]=>

View File

@ -26,6 +26,7 @@ gc_collect_cycles();
var_dump($map);
?>
--EXPECTF--
object(WeakMap)#%d (1) {
[0]=>

View File

@ -23,6 +23,7 @@ gc_collect_cycles();
var_dump($map2);
?>
--EXPECT--
object(WeakMap)#1 (1) {
[0]=>

View File

@ -27,6 +27,7 @@ unset($container, $canary);
gc_collect_cycles();
echo 2;
?>
--EXPECT--
1container
canary

View File

@ -25,6 +25,7 @@ unset($canary);
gc_collect_cycles();
echo 2;
?>
--EXPECT--
1canary
2

View File

@ -19,6 +19,7 @@ gc_collect_cycles();
var_dump($m);
?>
--EXPECT--
object(WeakMap)#1 (0) {
}

View File

@ -19,6 +19,7 @@ var_dump(zend_test_zend_ini_parse_quantity('0g10'));
var_dump(zend_test_zend_ini_parse_quantity('0m10'));
var_dump(zend_test_zend_ini_parse_quantity('0k10'));
?>
--EXPECTF--
Warning: Invalid quantity "0x0x12": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
int(0)

View File

@ -31,6 +31,7 @@ foreach (['', ' '] as $leadingWS) {
}
}
}
?>
--EXPECT--
# "1"
int(1)

View File

@ -28,6 +28,7 @@ foreach (['', ' '] as $leadingWS) {
}
}
}
?>
--EXPECT--
# "0b11"
int(3)

View File

@ -36,6 +36,7 @@ foreach ($tests as $setting) {
var_dump(zend_test_zend_ini_parse_quantity($setting));
print "\n";
}
?>
--EXPECTF--
# "K"

View File

@ -28,6 +28,7 @@ foreach (['', ' '] as $leadingWS) {
}
}
}
?>
--EXPECT--
# "0x1F"
int(31)

View File

@ -7,6 +7,7 @@ zend_test
var_dump(ini_set("zend_test.quantity_value", "1MB"));
var_dump(ini_get("zend_test.quantity_value"));
?>
--EXPECTF--
Warning: Invalid "zend_test.quantity_value" setting. Invalid quantity "1MB": unknown multiplier "B", interpreting as "1" for backwards compatibility in %s on line %d
string(1) "0"

View File

@ -8,6 +8,7 @@ zend_test.quantity_value=1MB
<?php
var_dump(ini_get("zend_test.quantity_value"));
?>
--EXPECTF--
Warning: Invalid "zend_test.quantity_value" setting. Invalid quantity "1MB": unknown multiplier "B", interpreting as "1" for backwards compatibility in %s on line %d
string(3) "1MB"

View File

@ -28,6 +28,7 @@ foreach (['', ' '] as $leadingWS) {
}
}
}
?>
--EXPECT--
# "0o14"
int(12)

View File

@ -46,6 +46,7 @@ foreach ($tests as $name => $value) {
print "----------\n";
}
?>
--EXPECTF--
# No overflow 001: "0"
0

View File

@ -27,6 +27,7 @@ foreach ($tests as $setting) {
var_dump(zend_test_zend_ini_parse_quantity($setting));
print "\n";
}
?>
--EXPECT--
# "0"
int(0)

View File

@ -34,6 +34,7 @@ foreach ($tests as $name => $value) {
printf("# zend_test_zend_ini_parse_uquantity(\"-1\") === -1\n");
var_dump(zend_test_zend_ini_parse_uquantity("-1") === -1);
?>
--EXPECTF--
# No overflow 001: "0"
0

View File

@ -5,6 +5,7 @@ curl
--SKIPIF--
<?php
if (curl_version()['version_number'] < 0x73800) die('skip requires curl >= 7.56.0');
?>
--FILE--
<?php
include 'server.inc';

View File

@ -16,5 +16,6 @@ try {
} catch (DOMException $e) {
echo "DOMException: " . $e->getMessage();
}
?>
--EXPECT--
DOMException: Not Found Error

View File

@ -17,5 +17,6 @@ try {
} catch (DOMException $e) {
echo "DOMException: " . $e->getMessage();
}
?>
--EXPECT--
DOMException: Not Found Error

View File

@ -15,5 +15,6 @@ try {
} catch (DOMException $e) {
echo "DOMException: " . $e->getMessage();
}
?>
--EXPECT--
DOMException: Hierarchy Request Error

View File

@ -9,5 +9,6 @@ $doc = new \DOMDocument();
$doc->loadXML('<a><!-- foo --></a>');
$doc->documentElement->firstChild->remove();
echo $doc->saveXML($doc->documentElement);
?>
--EXPECT--
<a/>

View File

@ -21,6 +21,7 @@ foreach ($test_values as $test_value) {
var_dump($test_struct->y === $test_value);
}
var_dump($test_struct->x);
?>
--EXPECT--
bool(true)
bool(true)

View File

@ -18,6 +18,7 @@ try {
} catch (ValueError $ex) {
echo "Exception: ", $ex->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
bool(true)

View File

@ -11,5 +11,6 @@ try {
} catch (Error $ex) {
echo "Exception: ", $ex->getMessage(), "\n";
}
?>
--EXPECT--
Exception: Cannot directly construct FTP\Connection, use ftp_connect() or ftp_ssl_connect() instead

View File

@ -27,6 +27,7 @@ foreach ($options as $option) try {
echo "Exception: ", $ex->getMessage(), "\n";
}
?>
--EXPECT--
Exception: ftp_set_option(): Argument #3 ($value) must be greater than 0 for the FTP_TIMEOUT_SEC option
Exception: ftp_set_option(): Argument #3 ($value) must be of type int for the FTP_TIMEOUT_SEC option, string given

View File

@ -22,6 +22,7 @@ try {
}
echo "===DONE===\n";
?>
--EXPECTF--
*** Testing ftp_ssl_connect() function : error conditions ***

View File

@ -8,6 +8,7 @@ gettext
if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
die("skip en_US.UTF-8 locale not supported.");
}
?>
--FILE--
<?php
chdir(__DIR__);

View File

@ -8,6 +8,7 @@ gettext
if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
die("SKIP en_US.UTF-8 locale not supported.");
}
?>
--FILE--
<?php
chdir(__DIR__);

View File

@ -8,6 +8,7 @@ gettext
if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
die("skip en_US.UTF-8 locale not supported.");
}
?>
--FILE--
<?php
chdir(__DIR__);

View File

@ -10,5 +10,6 @@ try {
} catch (Error $ex) {
echo "Exception: ", $ex->getMessage(), "\n";
}
?>
--EXPECT--
Exception: Cannot directly construct IMAP\Connection, use imap_open() instead

View File

@ -6,5 +6,6 @@ imap
<?php
class T extends IMAP\Connection {}
?>
--EXPECTF--
Fatal error: Class T cannot extend final class IMAP\Connection in %s on line %d

View File

@ -5,6 +5,7 @@ intl
--SKIPIF--
<?php
if (version_compare(INTL_ICU_VERSION, '57.1') <= 0) die('skip for ICU >= 58.1');
?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);

View File

@ -6,6 +6,7 @@ intl
<?php
if (!class_exists('Spoofchecker'))
die('skip intl extension does not have spoof checker');
?>
--FILE--
<?php
class A extends IntlDateFormatter {

View File

@ -8,6 +8,7 @@ intl
<?php
if (version_compare(INTL_ICU_VERSION, '52.1') >= 0)
die('skip for ICU < 52.1');
?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);

View File

@ -8,6 +8,7 @@ intl
<?php
if (version_compare(INTL_ICU_VERSION, '52.1') < 0)
die('skip for ICU >= 52.1');
?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);

View File

@ -19,5 +19,6 @@ try {
echo $e->getMessage();
}
?>
--EXPECT--
datefmt_create: time format must be UDAT_PATTERN if date format is UDAT_PATTERN: U_ILLEGAL_ARGUMENT_ERROR

View File

@ -17,5 +17,6 @@ try {
} catch (\IntlException $e) {
echo $e->getMessage();
}
?>
--EXPECT--
datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR

View File

@ -6,6 +6,7 @@ intl
<?php
if (!defined('INTL_IDNA_VARIANT_UTS46'))
die('skip no UTS #46 API');
?>
--FILE--
<?php
$utf8dn = "www.fußball.com";

View File

@ -6,6 +6,7 @@ intl
<?php
if (!defined('INTL_IDNA_VARIANT_UTS46'))
die('skip no UTS #46 API');
?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);

View File

@ -14,6 +14,7 @@ $mf = new MessageFormatter('en_US', $fmt);
var_dump($mf->format(array("foo" => 7, "\x80" => "bar")));
var_dump($mf->format(array("foo" => "\x80")));
?>
--EXPECTF--
Warning: MessageFormatter::format(): Invalid UTF-8 data in argument key: '€' in %s on line %d
bool(false)

View File

@ -10,5 +10,6 @@ try {
} catch (Error $ex) {
echo "Exception: ", $ex->getMessage(), "\n";
}
?>
--EXPECT--
Exception: Cannot directly construct LDAP\Connection, use ldap_connect() instead

View File

@ -6,6 +6,7 @@ dom
--SKIPIF--
<?php
if (LIBXML_VERSION < 20912) die('skip For libxml2 >= 2.9.12 only');
?>
--FILE--
<?php

View File

@ -29,6 +29,7 @@ print libxml_get_external_entity_loader()[0] . "\n";
libxml_set_external_entity_loader(null);
var_dump(libxml_get_external_entity_loader());
?>
--EXPECT--
NULL
Handler#A

View File

@ -5,6 +5,7 @@ dom
--CLEAN--
<?php
@unlink(__DIR__ . "/foobar.dtd");
?>
--FILE--
<?php
chdir(__DIR__);

View File

@ -70,6 +70,7 @@ require_once 'skipifconnectfailure.inc';
$mysqli->close();
print "done!";
?>
--CLEAN--
<?php
require_once 'clean_table.inc';

View File

@ -39,6 +39,7 @@ require_once 'skipifconnectfailure.inc';
}
print "done!";
?>
--CLEAN--
<?php
require_once 'clean_table.inc';

View File

@ -21,6 +21,7 @@ register_shutdown_function(function () {
});
new BadClass();
?>
--EXPECTF--
Autoloading BadClass
Autoloading Foo

View File

@ -21,6 +21,7 @@ register_shutdown_function(function () {
});
new BadClass();
?>
--EXPECTF--
Autoloading BadClass
Autoloading Foo

View File

@ -21,6 +21,7 @@ register_shutdown_function(function () {
});
new BadClass2();
?>
--EXPECTF--
Autoloading BadClass2

View File

@ -18,6 +18,7 @@ if (PHP_OS_FAMILY === 'Windows') {
var_dump($loaded);
var_dump(ini_get('dl_test.long'));
?>
--EXPECT--
bool(true)
string(1) "0"

View File

@ -22,6 +22,7 @@ try {
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined variable $y in %s on line %d
Cannot assign null to reference held by property Test::$x of type string

View File

@ -30,5 +30,6 @@ function checkTree($treeNode) {
$tree = createTree(12);
var_dump(checkTree($tree));
?>
--EXPECT--
int(8191)

View File

@ -57,6 +57,7 @@ eq(3.0, 3.0, true, false);
eq(3.0, 2.0, true, false);
eq(3.0, NAN, true, false);
eq(NAN, NAN, true, false);
?>
--EXPECT--
bool(false)
bool(false)

View File

@ -108,5 +108,6 @@ for ($y = 0; $y < 10; $y++) {
}
}
$m = Matrix::fromArray($a);
?>
--EXPECT--
These are the array bounds: 10 * 10

View File

@ -52,6 +52,7 @@ for ($i = 0; $i < 5; $i++) {
}
}
?>
--EXPECT--
0
1

View File

@ -33,5 +33,6 @@ for ($i = 0; $i < 10; $i++) {
touch(__DIR__ . '/gh8461-001.inc');
print "OK";
?>
--EXPECT--
OK

View File

@ -26,5 +26,6 @@ for ($i = 0; $i < 10; $i++) {
touch(__DIR__ . '/gh8461-002.inc');
print "OK";
?>
--EXPECT--
OK

View File

@ -34,5 +34,6 @@ for ($i = 0; $i < 10; $i++) {
touch(__DIR__ . '/gh8461-003.inc');
print "OK";
?>
--EXPECT--
OK

View File

@ -55,6 +55,7 @@ for ($i = 0; $i < 10; $i++) {
var_dump($initialRequest ? $x : $y);
print "OK";
?>
--EXPECT--
int(10)
OK

View File

@ -32,6 +32,7 @@ for ($i = 0; $i < 10; $i++) {
var_dump($initialRequest ? $x : $y);
print "OK";
?>
--EXPECT--
int(10)
OK

View File

@ -44,6 +44,7 @@ namespace test {
var_dump($initialRequest ? $x : $y);
print "OK";
}
?>
--EXPECT--
int(10)
OK

View File

@ -31,5 +31,6 @@ for ($i = 0; $i < 10; $i++) {
}
print "OK";
?>
--EXPECT--
OK

View File

@ -67,5 +67,6 @@ for ($i = 0; $i < 10; $i++) {
}
print "OK";
?>
--EXPECT--
OK

View File

@ -44,6 +44,7 @@ touch(__DIR__ . '/gh8591-001.inc');
var_dump($x);
print "OK";
?>
--EXPECT--
int(1)
OK

View File

@ -47,6 +47,7 @@ new Model();
var_dump($x);
print "OK";
?>
--EXPECT--
int(1)
OK

View File

@ -40,6 +40,7 @@ new Model();
var_dump($x);
print "OK";
?>
--EXPECT--
int(1)
OK

View File

@ -46,6 +46,7 @@ touch(__DIR__ . '/gh8591-004.inc');
var_dump($x);
print "OK";
?>
--EXPECT--
int(1)
OK

View File

@ -36,6 +36,7 @@ touch(__DIR__ . '/gh8591-005.inc');
var_dump($x);
print "OK";
?>
--EXPECT--
int(1)
OK

View File

@ -33,6 +33,7 @@ new Model();
var_dump($x);
print "OK";
?>
--EXPECT--
int(1)
OK

View File

@ -31,11 +31,12 @@ class Loop {
Loop::test();
Loop::test2();
Loop::test3();
?>
--EXPECTF--
$_main:
; (lines=7, args=0, vars=0, tmps=0)
; (after optimizer)
; %sdce_009.php:1-23
; %sdce_009.php:1-24
0000 INIT_STATIC_METHOD_CALL 0 string("Loop") string("test")
0001 DO_UCALL
0002 INIT_STATIC_METHOD_CALL 0 string("Loop") string("test2")

View File

@ -10,6 +10,7 @@ opcache.preload={PWD}/preload_enum.inc
--SKIPIF--
<?php
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
?>
--FILE--
<?php

View File

@ -20,6 +20,7 @@ class Foo {
var_dump(class_exists("Test"));
var_dump(Test::X);
var_dump(Test::Y);
?>
--EXPECT--
bool(true)
int(1)

View File

@ -5,6 +5,7 @@ Check for JIT enablement status
if (ini_get("pcre.jit") === FALSE) {
die("skip no jit built");
}
?>
--FILE--
<?php

View File

@ -13,6 +13,7 @@ var_dump(preg_replace_callback_array(
"/a/" => 'b',
"/b/" => 'invalid callable'), 'a'));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: preg_replace_callback_array(): Argument #1 ($pattern) must contain only valid callbacks in %spreg_replace_callback_array_fatal_error.php:%d
Stack trace:

View File

@ -20,6 +20,7 @@ $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 41000)
die(sprintf("skip Need MySQL Server 4.1.0+, found %d.%02d.%02d (%d)\n",
$matches[1], $matches[2], $matches[3], $version));
?>
--FILE--
<?php
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');

View File

@ -85,6 +85,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
}
print "done!";
?>
--CLEAN--
<?php
require __DIR__ . '/mysql_pdo_test.inc';

View File

@ -78,6 +78,7 @@ MySQLPDOTest::skip();
}
print "done!";
?>
--CLEAN--
<?php
require __DIR__ . '/mysql_pdo_test.inc';

View File

@ -10,6 +10,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN' &&
!extension_loaded('com_dotnet')) {
die('skip - either PDOTEST_DSN or com_dotnet extension is needed to setup the connection');
}
?>
--REDIRECTTEST--
# magic auto-configuration

View File

@ -20,6 +20,7 @@ $db = PDOTest::test_factory('ext/pdo_odbc/tests/common.phpt');
// PDO::ATTR_SERVER_VERSION: 07.02.0015
var_dump($db->getAttribute(PDO::ATTR_SERVER_INFO));
var_dump($db->getAttribute(PDO::ATTR_SERVER_VERSION));
?>
--EXPECTF--
string(%d) "%s"
string(%d) "%s"

View File

@ -23,3 +23,4 @@ int(0)
@unlink(__DIR__ . '/bug69279a/2.txt');
@unlink(__DIR__ . '/bug69279a/3.txt');
@rmdir(__DIR__ . '/bug69279a');
?>

View File

@ -15,6 +15,7 @@ $p['some/file'] = "<?php const MAXPATHLEN = 4096, OVERFLOW = 1, PATH = 'path'; s
$p->setStub("<?php Phar::mapPhar('sample.phar'); __HALT_COMPILER();");
// execute the phar code:
require('phar://sample.phar/some/file');
?>
--CLEAN--
<?php
unlink('path/needle.php');

View File

@ -6,6 +6,7 @@ phar
<?php
$arr = Phar::getSupportedSignatures();
if (!in_array("OpenSSL", $arr)) die("skip openssl support required");
?>
--INI--
phar.require_hash=0
phar.readonly=0

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