PHP 基础
hefengbao 发布于 2023.06.13 ,最后更新于 2025.03.11
文档:https://www.php.net/manual/zh/
魔术方法
__construct()
,类的构造函数
__destruct()
,类的析构函数
__call()
,在对象中调用一个不可访问方法时调用
__callStatic()
,用静态方式中调用一个不可访问方法时调用
__get()
,获得一个类的成员变量时调用
__set()
,设置一个类的成员变量时调用
__isset()
,当对不可访问属性调用isset()或empty()时调用
__unset()
,当对不可访问属性调用unset()时被调用。
__sleep()
,执行serialize()时,先会调用这个函数
__wakeup()
,执行unserialize()时,先会调用这个函数
__toString()
,类被当成字符串时的回应方法
__invoke()
,调用函数的方式调用一个对象时的回应方法
__set_state()
,调用var_export()导出类时,此静态方法会被调用。
__clone()
,当对象复制完成时调用
__autoload()
,尝试加载未定义的类
__debugInfo()
,打印所需调试信息
https://segmentfault.com/a/1190000007250604
PHP 8.1: Enums
https://stitcher.io/blog/php-enums
日期
https://www.cnblogs.com/guliang/p/11730721.html
获取 IP
https://learnku.com/laravel/t/3905/do-you-really-know-ip-how-do-php-get-the-real-user-ip
PHP Coding Standards Fixer
PHP 之道:https://phptherightway.com/
wesome-php:https://github.com/JingwenTian/awesome-php | https://github.com/ziadoz/awesome-php
oci8: http://pecl.php.net/package/oci8
Laminas:https://getlaminas.org/
Casbin:https://github.com/php-casbin/php-casbin
Hashids:https://github.com/vinkla/hashids | https://hashids.org/php/
Carbon:https://carbon.nesbot.com/docs/
有 0 条评论
发表评论
您的电子邮箱地址不会被公开。 必填项已用 * 标注