$variable_name
First and foremost, and of course this is the most important change of all that will allow to achieve PHP elegance - is the removal of a character so beloved in the USA and replacing it with something more appropriate. More persistent and ... more reliable (word of lane. There is a play on words, since sterling is both pound sterling and reliable).£variable_name
str_replace()
is_int()
var_dump()
preg_match()
json_encode()
mysql_connect()
The following changes should improve the situation:string_replace()
is_integer()
variable_dump()
perform_a_regular_expression_match()
javascript_object_notation_encode()
my_structured_query_language_connect()
if ($condition) {
// Code here
} else {
// Code here
}
Shakespeare would have burned with shame if he had learned how to twist his tongue, turning it into such deformity. Brevity is welcomed only in the right context, i.e. somewhere far away where it will not be seen, but not in our case. The if ... else block is the most commonly used code in PHP, so we must make it as harmless as possible. Options for replacing the dark-darkness, but I suggest this:perchance (£condition) { (. )
// Code here
} otherwise { (. )
// Code here
}
imagecolorallocate()
serialize()
newt_centered_window()
connection_status()
Here I just have no words. What self-respecting gentleman would expect him to understand if he says so. It is hard to believe that someone can so distort the words used in the programming language. They will be corrected for the following options, along with countless similar errors:imagecolourallocate()
serialise()
newt_centred_window()
connexion_status()
try {
// Code here
} catch (Exception $e) {
// Handle exception
die( 'Message' );
}
A good example of the absence of any manners in PHP is the try ... catch block. Too straightforward for the new PHP. In addition to everything, the word "die" is too depressive. The new bloc is, although unduly verbose, but still more polite and optimistic:would_you_mind { (. )
// Code here
} actually_i_do_mind (Exception £e) { (. - )
// Politely move on
cheerio( 'Message' ); (. )
}
class Republic {
public $a;
private $b;
protected $c;
}
$example = new Republic;
To begin with, the current system is not intended for a class hierarchy, and this is unacceptable. Therefore, we will begin to allocate classes to specific levels: upper, middle, working, and no class will be able to access higher-level methods without special permission from this class (and, although it will have this permission, it will not level them thus denying the right to transfer these rights to any other lower classes). “Public” and “Private” in the British class system are most often synonymous (see, for example, the nomenclature of school education), because they must be changed, as well as “Protected”. The word "new" (the lane is new), although it is valid, must still be replaced by a more appropriate one for class questions:upper_class Empire { (. _)
state £a; (. )
private £b; (. )
hereditary £c; (. )
}
£example = nouveau Empire; (. )
Source: https://habr.com/ru/post/126737/
All Articles