Posts
Understanding Traits in PHP
- Get link
- X
- Other Apps
Traits is the mechanism implemented to reuse code in PHP. Traits are mainly introduced to reduce limitations that caused by single inheritance. PHP does not support multiple inheritances. In traits, we can use methods from traits in different classes, which compensate multiple inheritance features. From above example, If we want to use class C functionality to both D and E classes it is not possible that is the reason in PHP 5.4 traits concepts are introduced. Let see an example by using traits
Important LINUX Commands & related Info
- Get link
- X
- Other Apps
Command that lists the last certain number of commands. history history -E {all commands sort by date and time} history [x] { List of last x number of commands by using a number } Command line shortcuts: Shortcut Description CTRL + R search for command that we entered on terminal CTRL + P shows the previously run command Copy files and Directories: cp [ NAME OF FILE 1 ] [ NAME OF FILE 2 ] {copy a file into another file} cp [ NAME OF FILE ] [ NAME OF DIRECTORY ] {copy files into directories} Move files and directories: mv [ NAME OF FILE 1 ] [ NAME OF FILE 2 ] { if the second file doesn’t exist, the first file is renamed as the second file } mv [ NAME OF DIRECTORY 1 ] [ NAME OF DIRECTORY 2 ] { f the second directory does not exist then the first directory is simply renamed } Command to select command from history ! <command number> Remo...