diff --git a/core/modules/php/lib/Drupal/php/Plugin/Condition/Php.php b/core/modules/php/lib/Drupal/php/Plugin/Condition/Php.php
index ca097e5..485d400 100644
--- a/core/modules/php/lib/Drupal/php/Plugin/Condition/Php.php
+++ b/core/modules/php/lib/Drupal/php/Plugin/Condition/Php.php
@@ -35,7 +35,7 @@ public function buildForm(array $form, array &$form_state) {
       '#title' => t('When the following PHP return TRUE (experts only)'),
       '#default_value' => $this->configuration['php'],
       '#description' => t('Enter PHP code between <?php ?>. Note that executing incorrect PHP code can break your Drupal site. Return TRUE in order for this condition to evaluate as TRUE.'),
-      '#access' => user_access('use PHP for settings')
+      '#access' => Drupal::currentUser()->hasPermission('use PHP for settings')
     );
     return $form;
   }
diff --git a/core/modules/php/lib/Drupal/php/Plugin/views/argument_default/Php.php b/core/modules/php/lib/Drupal/php/Plugin/views/argument_default/Php.php
index 491d001..03a2b2e 100644
--- a/core/modules/php/lib/Drupal/php/Plugin/views/argument_default/Php.php
+++ b/core/modules/php/lib/Drupal/php/Plugin/views/argument_default/Php.php
@@ -48,7 +48,7 @@ public function buildOptionsForm(&$form, &$form_state) {
    * default plugin.
    */
   public function access() {
-    return user_access('use PHP for settings');
+    return Drupal::currentUser()->hasPermission('use PHP for settings');
   }
 
   public function getArgument() {
diff --git a/core/modules/php/lib/Drupal/php/Plugin/views/argument_validator/Php.php b/core/modules/php/lib/Drupal/php/Plugin/views/argument_validator/Php.php
index c352cdc..f9e40c4 100644
--- a/core/modules/php/lib/Drupal/php/Plugin/views/argument_validator/Php.php
+++ b/core/modules/php/lib/Drupal/php/Plugin/views/argument_validator/Php.php
@@ -47,7 +47,7 @@ public function buildOptionsForm(&$form, &$form_state) {
    * validate plugin.
    */
   public function access() {
-    return user_access('use PHP for settings');
+    return Drupal::currentUser()->hasPermission('use PHP for settings');
   }
 
   public function validateArgument($argument) {
