文件名称:php-struct:PHP7的简单结构
文件大小:4KB
文件格式:ZIP
更新时间:2024-06-13 16:10:21
PHP
PHP结构 受golang启发PHP7结构 用法 struct ( 'User' , [ 'name' => 'string' , 'age' => 'int' , 'active' => 'bool' , ]); $ user = new User (); $ user [ 'name' ] = 'Andy' ; $ user [ 'age' ] = 13 ; $ user [ 'active' ] = true ; $ user [ 'email' ] = 'andybaird@gmail.com' ; // Fatal error: Uncaught InvalidArgumentException: Struct does not contain property `email` $ user [ 'age' ] = '2
【文件预览】:
php-struct-master
----src()
--------Struct()
----example.php(946B)
----README.md(2KB)
----.gitignore(21B)
----composer.json(369B)