PHP is fairly majestic anyway... kind of.. maybe.
No, I completely agree with everything this site says. But, there is nothing quite like it, at least nothing that is as easy to deploy. I prefer JavaScript, and wouldn't mind writing web software in JavaScript (I.E., NodeJS), but we use PHP in work so I'm stuck with it.
http://eev.ee/blog/2...-of-bad-design/
I don't mind the naming inconsistencies and annoying variable scope issues, but I would like to see stuff like:
$string = "string";
var_dump($string->length());
And:
<?php
// hopes for future:
for($i in 3 to 20) { // easier and more readable loop
first {
// this line will execute on the first iteration
}
alternate(2) {
// this line will execute on every two iterations
}
alternate(2, 1) {
// this line will execute on every two iterations starting at 1
}
alternate(3) {
// this line will execute on every three iterations
}
last {
// this line will execute on the last iteration
}
}
// current:
for($i = 3; $i <= 20; $i++) {
if($i == 3) {
// this line will execute on the first iteration
}
if($i % 2 == 0) {
// this line will execute on every two iterations
}
if($i % 2 == 1) {
// this line will execute on every two iterations starting at 1
}
if($i % 3 == 0) {
// this line will execute on every three iterations
}
if($i == 20) {
// this line will execute on the last iteration
}
}
// hope for the future:
for($i in 10) {
for($n in $i) {
if(condition) {
break(2); // break loops to a variable depth
// continue(2) - should be able to do the same with other keywords...
}
}
}
// current:
for($i = 0; $i < 10; $i++) {
$break = false;
for($n = 0; $n < $i; $n++) {
if(condition) {
$break = true;
break;
}
}
if($break) {
break;
}
}
Anyway, I digress...