PHP
Write solid PHP avoiding type juggling traps, array quirks, and common security pitfalls.
Why use this skill?
Enhance your PHP development with the OpenClaw PHP skill. Learn to write secure, strict-typed, and robust code by avoiding common pitfalls like type juggling and SQL injection.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ivangdavila/phpWhat This Skill Does
The PHP skill for OpenClaw provides a robust framework for generating, auditing, and refactoring PHP code. It is designed to mitigate the specific linguistic quirks of PHP, such as loose typing, unexpected array behavior, and historical security vulnerabilities. By enforcing modern coding standards and strict typing, this skill ensures that generated code is production-ready, readable, and resilient against common exploits like SQL injection and XSS.
Installation
To integrate this skill into your OpenClaw environment, execute the following command in your terminal:
clawhub install openclaw/skills/skills/ivangdavila/php
Use Cases
This skill is ideal for:
- Refactoring legacy codebases to enforce
strict_typesand replace unsafe type-juggling patterns. - Generating secure boilerplate for web services, ensuring PDO is used for database interactions instead of concatenation.
- Implementing modern object-oriented architectures using traits, interfaces, and late static binding.
- Troubleshooting complex array manipulation issues where loose comparison behavior often causes logic errors.
- Enforcing security best practices by automatically applying
htmlspecialcharsto outputs and validating user inputs.
Example Prompts
- "Refactor this legacy user authentication module to use PDO prepared statements and enable strict type checking."
- "Explain why
in_arrayis returning unexpected results in my validation logic and provide the strict comparison fix." - "Write a PHP 8+ class that uses constructor property promotion and attributes to validate an email address input."
Tips & Limitations
To maximize the utility of this skill, always include declare(strict_types=1); at the top of your scripts. Remember that while this skill assists in generating secure code, it is not a replacement for security audits; always use static analysis tools like PHPStan or Psalm in your CI/CD pipeline. Be aware that the skill prioritizes multibyte string functions (mb_*) over standard functions; ensure your environment has the mbstring extension enabled. Avoid using the error suppression operator @ at all costs, as the skill will flag it as a code-quality violation that hinders debugging.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ivangdavila-php": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: code-execution
Related Skills
Animations
Create performant web animations with proper accessibility and timing.
Arduino
Develop Arduino projects avoiding common wiring, power, and code pitfalls.
Bulgarian
Write Bulgarian that sounds human. Not formal, not robotic, not AI-generated.
Arabic
Write Arabic that sounds human. Not formal, not robotic, not AI-generated.
Assistant
Manage tasks, communications, and scheduling with proactive and organized support.