(no title)
kemo | 14 years ago
str = 'foo'.replace('#', '').substr(1).as_array();
int = 5.something();
would translate to $str = 'foo';
$str = str_replace('#', '', $str);
$str = substr($str, 1);
$str = (array) $str;
$int = 5;
$int = something($int);
This would allow us to do things that aren't native to PHP but still have something much easier. Having strings, integers and other types used as objects (with a solid proxy syntax to the native functions) would be the first (and best) step forward.Class definitions as well:
Foo {
// constants
BAR = 'fubar',
BAR2 = 'foo';
// properties
protected _bar, _fubar;
// public properties / methods
public
bar() {
return ._bar;
},
fubar() {
return ._bar + ._fubar;
}
}
No comments yet.