First of all sorry If this is being discussed somewhere else in the form. But I really search for this and couldn't find any.
I just need to make my code more readable by adding extra spaces. So I need to know if the following cases ( numbered ) would the be legal ? if I put what will happen with PHP engine - what will the PHP do for these cases.
I have seen some places like Joomla use these styles;
eg. in Joomla, includes/database.php there are extra spaces just after start bracket and just before end bracket.
Code: Select all
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once( dirname(__FILE__) .'/../libraries/loader.php' );
jimport( 'joomla.database.database' );
Code: Select all
function myFunction( $username = '', $password = '' )Code: Select all
public function login($username='', $password='')Code: Select all
define( '__DBHOST' , 'localhost' );
define( '__DATABASE' , 'table_name' );
define( '__DBUSER' , 'root' );
define( '__DBPASS' , 'pass' );
Code: Select all
define('__DBHOST', 'localhost');
define('__DATABASE', 'table_name');
define('__DBUSER', 'root');
define('__DBPASS', 'pass');
Code: Select all
$_SESSION[ 'username' ] = $user[ 0 ][ 'username' ];
$_SESSION[ 'userId' ] = $user[ 0 ][ 'id'];
Code: Select all
$_SESSION['username'] = $user[0]['username'];
$_SESSION['userId'] = $user[0]['id'];
Thanks
Viraj