Skip to content

Cleanup of remaning E_STRICT #4401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Zend/tests/bug33771.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bug #33771 (error_reporting falls to 0 when @ was used inside try/catch block)
--FILE--
<?php

error_reporting(E_ALL | E_STRICT);
error_reporting(E_ALL);

var_dump(error_reporting());

Expand All @@ -14,7 +14,7 @@ function make_exception()

function make_exception_and_change_err_reporting()
{
error_reporting(E_ALL & ~E_STRICT);
error_reporting(E_ALL & ~E_NOTICE);
throw new Exception();
}

Expand All @@ -36,5 +36,5 @@ echo "Done\n";
--EXPECT--
int(32767)
int(32767)
int(30719)
int(32759)
Done
2 changes: 1 addition & 1 deletion Zend/tests/bug52160.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Bug #52160 (Invalid E_STRICT redefined constructor error)
Bug #52160 (Invalid E_DEPRECATED redefined constructor error)
--FILE--
<?php

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug62956.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Bug #62956: "incompatible" signatures for private methods should not cause E_STRICT
Bug #62956: "incompatible" signatures for private methods should not cause E_WARNING
--FILE--
<?php
class Base
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug64988.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Bug #64988 (Class loading order affects E_STRICT warning)
Bug #64988 (Class loading order affects E_WARNING warning)
--FILE--
<?php
abstract class Base1 {
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug67436/bug67436_nohandler.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
bug67436: E_STRICT instead of custom error handler
bug67436: E_WARNING instead of custom error handler
--FILE--
<?php

Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/error_reporting02.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ testing @ and error_reporting - 2
--FILE--
<?php

error_reporting(E_ALL);
error_reporting(E_ALL & ~E_DEPRECATED);

function foo($arg) {
}

function bar() {
error_reporting(E_ALL|E_STRICT);
error_reporting(E_ALL);
throw new Exception("test");
}

Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/error_reporting03.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ testing @ and error_reporting - 3
--FILE--
<?php

error_reporting(E_ALL);
error_reporting(E_ALL & ~E_DEPRECATED);

function foo($arg) {
echo @$nonex_foo;
Expand All @@ -16,7 +16,7 @@ function bar() {

function foo1() {
echo $undef1;
error_reporting(E_ALL|E_STRICT);
error_reporting(E_ALL);
echo $undef2;
}

Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/error_reporting04.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ testing @ and error_reporting - 4
--FILE--
<?php

error_reporting(E_ALL);
error_reporting(E_ALL & ~E_DEPRECATED);

function foo() {
echo $undef;
error_reporting(E_ALL|E_STRICT);
error_reporting(E_ALL);
}


Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/error_reporting08.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ testing @ and error_reporting - 8
--FILE--
<?php

error_reporting(E_ALL);
error_reporting(E_ALL & ~E_DEPRECATED);

function foo1($arg) {
}
Expand All @@ -12,7 +12,7 @@ function foo2($arg) {
}

function foo3() {
error_reporting(E_ALL|E_STRICT);
error_reporting(E_ALL);
echo $undef3;
throw new Exception("test");
}
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/error_reporting09.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ testing @ and error_reporting - 9
--FILE--
<?php

error_reporting(E_ALL);
error_reporting(E_ALL & ~E_DEPRECATED);

function bar() {
echo @$blah;
Expand All @@ -12,7 +12,7 @@ function bar() {

function foo() {
echo @$undef;
error_reporting(E_ALL|E_STRICT);
error_reporting(E_ALL);
echo $blah;
return bar();
}
Expand Down
2 changes: 0 additions & 2 deletions Zend/tests/exception_004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ Throwing exception using a class that isn't derived from the Exception base clas
--FILE--
<?php

error_reporting(E_ALL|E_STRICT);

class Foo { }

try {
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo/pdo_stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info *
return 0;
}
if (is_callable_error) {
/* Possible E_STRICT error message */
/* Possible error message */
efree(is_callable_error);
}

Expand Down
8 changes: 2 additions & 6 deletions ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ MySQLPDOTest::skip();
<?php
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');

// No silly strict mode warnings, please!
error_reporting(E_ALL^E_STRICT);
ini_set('display_errors', false);

try {

class MyPDO extends PDO {
Expand All @@ -23,9 +19,9 @@ MySQLPDOTest::skip();
return call_user_func_array(array($this, 'parent::__construct'), func_get_args());
}

public function exec() {
public function exec($statement) {
$this->protocol();
return call_user_func_array(array($this, 'parent::exec'), func_get_args());
return parent::exec($statement);
}

public function query() {
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_pgsql/tests/bug72294.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class PHPUnit_Framework_TestResult

$oldErrorHandler = set_error_handler(
'handleError',
E_ALL | E_STRICT
E_ALL
);

try {
Expand Down
2 changes: 1 addition & 1 deletion ext/phar/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ int phar_free_alias(phar_archive_data *phar, char *alias, size_t alias_len) /* {
return FAILURE;
}

/* this archive has no open references, so emit an E_STRICT and remove it */
/* this archive has no open references, so emit a notice and remove it */
if (zend_hash_str_del(&(PHAR_G(phar_fname_map)), phar->fname, phar->fname_len) != SUCCESS) {
return FAILURE;
}
Expand Down
1 change: 0 additions & 1 deletion ext/soap/tests/bugs/bug46427.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Bug #46427 (SoapClient() stumbles over its "stream_context" parameter)
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
error_reporting(E_ALL|E_STRICT);

function getSoapClient_1() {
$ctx = stream_context_create();
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/tests/general_functions/parse_ini_booleans.data
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ foo = E_ALL E_NOTICE
error_reporting = E_ALL
error_reporting1 = E_COMPILE_ERROR|E_RECOVERABLE_ERROR |E_ERROR|E_CORE_ERROR
error_reporting2 = E_ALL&~E_NOTICE
error_reporting3 = E_ALL & ~E_NOTICE
error_reporting4 = E_ALL & ~E_NOTICE | E_STRICT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be kept with E_STRICT replaced with something else, I think. Possibly just a dummy value (if hex is supported, something like 0x100000), as this is a parsing test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a bunch of whitespaces after are those part of the test too?

error_reporting3 = E_ALL & ~E_NOTICE
error_reporting4 = E_ALL & ~E_NOTICE | E_PARSE

['true or false']
bool_true = true
Expand Down
1 change: 0 additions & 1 deletion ext/standard/tests/mail/mail_basic_alt1-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ max_execution_time = 120
* Alias to functions:
*/

error_reporting(E_ALL & ~E_STRICT);
ini_set("SMTP", "localhost");
ini_set("smtp_port", 25);
ini_set("sendmail_from", "user@example.com");
Expand Down
2 changes: 0 additions & 2 deletions ext/standard/tests/mail/mail_basic_alt2-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ max_execution_time = 120
* Alias to functions:
*/

error_reporting(E_ALL & ~E_STRICT);

echo "*** Testing mail() : basic functionality ***\n";
require_once(__DIR__.'/mail_include.inc');
$subject_prefix = "!**PHPT**!";
Expand Down
2 changes: 0 additions & 2 deletions ext/standard/tests/mail/mail_basic_alt3-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ max_execution_time = 120
* Alias to functions:
*/

error_reporting(E_ALL & ~E_STRICT);

echo "*** Testing mail() : basic functionality ***\n";
require_once(__DIR__.'/mail_include.inc');
$subject_prefix = "!**PHPT**!";
Expand Down
2 changes: 0 additions & 2 deletions ext/standard/tests/mail/mail_basic_alt4-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ max_execution_time = 120
* Alias to functions:
*/

error_reporting(E_ALL & ~E_STRICT);

echo "*** Testing mail() : basic functionality ***\n";
require_once(__DIR__.'/mail_include.inc');
$subject_prefix = "!**PHPT**!";
Expand Down
1 change: 0 additions & 1 deletion ext/standard/tests/mail/mail_variation_alt1-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ max_execution_time = 120
* Alias to functions:
*/

error_reporting(E_ALL & ~E_STRICT);
ini_set("SMTP", "localhost");
ini_set("smtp_port", 2525);
ini_set("sendmail_from", "user@example.com");
Expand Down
1 change: 0 additions & 1 deletion ext/standard/tests/mail/mail_variation_alt2-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ max_execution_time = 120
* Alias to functions:
*/

error_reporting(E_ALL & ~E_STRICT);
ini_set("SMTP", "localplace");
ini_set("smtp_port", 25);
ini_set("sendmail_from", "user@example.com");
Expand Down
1 change: 0 additions & 1 deletion ext/standard/tests/mail/mail_variation_alt3-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ max_execution_time = 120
* Alias to functions:
*/

error_reporting(E_ALL & ~E_STRICT);
ini_set("SMTP", "localhost");
ini_set("smtp_port", 25);

Expand Down
1 change: 0 additions & 1 deletion ext/zip/examples/get_set_comments.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
error_reporting(E_ALL|E_STRICT);

copy('test_with_comment.zip', 't.zip');
$z = new ZipArchive;
Expand Down
4 changes: 2 additions & 2 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function main()
'open_basedir=',
'disable_functions=',
'output_buffering=Off',
'error_reporting=' . (E_ALL | E_STRICT),
'error_reporting=' . E_ALL,
'display_errors=1',
'display_startup_errors=1',
'log_errors=0',
Expand Down Expand Up @@ -1623,7 +1623,7 @@ function run_all_tests_parallel($test_files, $env, $redir_tested) {
'E_USER_ERROR',
'E_USER_WARNING',
'E_USER_NOTICE',
'E_STRICT',
'E_STRICT', // TODO Cleanup when removed from Zend Engine.
'E_RECOVERABLE_ERROR',
'E_USER_DEPRECATED'
];
Expand Down
4 changes: 2 additions & 2 deletions tests/func/011.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
--TEST--
Test bitwise AND, OR, XOR, NOT and logical NOT in INI via error_reporting
--INI--
error_reporting = E_ALL & E_NOTICE | E_STRICT ^ E_DEPRECATED & ~E_WARNING | !E_ERROR
error_reporting = E_ALL & E_NOTICE | E_PARSE ^ E_DEPRECATED & ~E_WARNING | !E_ERROR
--FILE--
<?php
echo ini_get('error_reporting');
?>
--EXPECT--
10248
8204
4 changes: 2 additions & 2 deletions tests/func/bug64523.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
--TEST--
Bug #64523: XOR not parsed in INI
--INI--
error_reporting = E_ALL ^ E_NOTICE ^ E_STRICT ^ E_DEPRECATED
error_reporting = E_ALL ^ E_NOTICE ^ E_WARNING ^ E_DEPRECATED
--FILE--
<?php
echo ini_get('error_reporting');
?>
--EXPECT--
22519
24565