From 6a2ec07c2c4f196dca33da3f4119019afa445e63 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 23 Feb 2026 15:44:00 +0100 Subject: [PATCH] PHP/RestrictedPHPFunctions: rephrase error message Follow up on the conversation about this phrasing in https://github.com/WordPress/WordPress-Coding-Standards/pull/2491#discussion_r1775744625 and https://github.com/WordPress/WordPress-Coding-Standards/pull/2693#discussion_r2841053023 Also related to: https://github.com/WordPress/wpcs-docs/pull/158 --- WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php b/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php index f3102e33d5..f4c47c85e7 100644 --- a/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php +++ b/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php @@ -35,7 +35,7 @@ public function getGroups() { return array( 'create_function' => array( 'type' => 'error', - 'message' => '%s() is deprecated as of PHP 7.2 and removed in PHP 8.0. Please use declared named or anonymous functions instead.', + 'message' => '%s() internally performs an eval(), which makes this a very dangerous function. For this reason, it was deprecated as of PHP 7.2 and removed in PHP 8.0. Please use anonymous functions, or declare a named function instead.', 'functions' => array( 'create_function', ),