स्निपेट·मुफ़्त
PHP स्निपेट
20 PHP 8 स्निपेट: strict types, enum, readonly क्लास, कंस्ट्रक्टर प्रमोशन, match, prepared statement वाला PDO, JSON, सेशन, इनपुट वैलिडेशन, HTML एस्केपिंग और PHPUnit टेस्ट। कुछ के लिए PHP 8.1 या 8.2 चाहिए।
मुफ़्त में इंस्टॉल करें।
अगर आपके Android डिवाइस पर PocketCode इंस्टॉल है, तो यह पेज ऐप में खुलेगा।
प्रीव्यू
20 में से 5
Strict file headerstrict
Start a file with strict types and a namespace
<?php
declare(strict_types=1);
namespace ${1:App};
$0Interfaceiface
Interface with one typed method
interface ${1:Repository}
{
public function ${2:all}(): array;
}Backed enumenumb
Enum whose cases map to strings (PHP 8.1+)
enum ${1:Status}: string
{
case ${2:Active} = '${3:active}';
case ${4:Inactive} = '${5:inactive}';
}Composer autoloadautoload
Load the classes installed with Composer
require __DIR__ . '/vendor/autoload.php';Traittraitb
Reusable methods to mix into several classes
trait ${1:HasTimestamps}
{
$0
}1.0.0 में बदलाव
पहला संस्करण।