diff --git a/meta/argument_specs.yml b/meta/argument_specs.yml
index d58b0fdcce4ad290b6b3dd421d2147e08aef5d9f..548e027e8f6fc994a9d54afa8e7d9efbf091b9a8 100644
--- a/meta/argument_specs.yml
+++ b/meta/argument_specs.yml
@@ -258,6 +258,10 @@ argument_specs:
         elements: str
         required: false
         description: A generated list of PHP versions which should be present.
+      php_verify:
+        type: bool
+        required: false
+        description: Varify all variables starting with php_ using the argument spec.
       php_versions:
         type: list
         elements: dict
diff --git a/tasks/main.yml b/tasks/main.yml
index ff354f599df902eff6c6067f0081ea928166a596..e4f441f878b517cbbe2d1b6d3950a9bca75bb051 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -11,20 +11,13 @@
 - name: PHP
   block:
 
-    - name: Debug the hostvars variable names that start with php_
-      ansible.builtin.debug:
-        var: phpvarnames
-        verbosity: "{% if ansible_check_mode | bool %}3{% else %}4{% endif %}"
-
-    - name: Debug the hostvars variable names that start with php_
-      ansible.builtin.debug:
-        var: phphostvars
-        verbosity: "{% if ansible_check_mode | bool %}3{% else %}4{% endif %}"
-
-    - name: Check php_ variables using meta/argument_specs.yml
-      ansible.builtin.validate_argument_spec:
-        argument_spec: "{{ (lookup('ansible.builtin.file', 'meta/argument_specs.yml') | from_yaml )['argument_specs']['main']['options'] }}"
-        provided_arguments: "{{ phphostvars }}"
+    - name: Include PHP verify variables tasks
+      ansible.builtin.include_tasks: verify.yml
+      when:
+        - php_verify is defined
+        - php_verify | bool
+      tags:
+        - php_verify
 
     - name: Include apt role local fact tasks
       ansible.builtin.include_role:
diff --git a/tasks/verify.yml b/tasks/verify.yml
new file mode 100644
index 0000000000000000000000000000000000000000..99212a38eedbb03a30c5c26956f6f445f147bf01
--- /dev/null
+++ b/tasks/verify.yml
@@ -0,0 +1,35 @@
+# Copyright 2019-2023 Chris Croome
+#
+# This file is part of the Webarchitects PHP Ansible role.
+#
+# The Webarchitects PHP Ansible role is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+#
+# The Webarchitects PHP Ansible role is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with the Webarchitects PHP Ansible role. If not, see <https://www.gnu.org/licenses/>.
+---
+- name: Verify PHP variables
+  block:
+
+    - name: Debug the hostvars variable names that start with php_
+      ansible.builtin.debug:
+        var: phpvarnames
+        verbosity: "{% if ansible_check_mode | bool %}3{% else %}4{% endif %}"
+
+    - name: Debug the hostvars variable names that start with php_
+      ansible.builtin.debug:
+        var: phphostvars
+        verbosity: "{% if ansible_check_mode | bool %}3{% else %}4{% endif %}"
+
+    - name: Check php_ variables using meta/argument_specs.yml
+      ansible.builtin.validate_argument_spec:
+        argument_spec: "{{ (lookup('ansible.builtin.file', 'meta/argument_specs.yml') | from_yaml )['argument_specs']['main']['options'] }}"
+        provided_arguments: "{{ phphostvars }}"
+
+  when:
+    - php_verify is defined
+    - php_verify | bool
+  tags:
+    - php
+    - pgp_verify
+...