Home > Article > Backend Development > PHP member variable assignment uses connector to report error
<code><span><span>class</span><span>FileUploadController</span><span>extends</span><span>Controller</span>{</span><span>private</span><span>$path</span> = BASEDIR.<span>"/Public/Upload"</span>; <span>//<strong>上传文件</strong>保存你路径</span><span>private</span><span>$allowType</span> = <span>array</span>(<span>'jpg'</span>,<span>'png'</span>,<span>'gif'</span>); <span>//文件限制格式</span></code>
<code><span>public</span><span><span>function</span><span>__construct</span><span>()</span>{</span><span>$this</span>->path = <span>__DIR__</span>.<span>"/Public/Upload"</span>; }</code>
The above introduces the error reporting using connectors for PHP member variable assignment, including the content of uploading files. I hope it will be helpful to friends who are interested in PHP tutorials.