|
Project Information
Members
Links
|
I've written that language to make you awesome.-- the author PHP.reboot is a reboot of PHP, each Hollywood movie has its own reboot, why not doing the same for one of the most popular programming language. The aim is to keep the philosophy of PHP but adapt it to be more in sync with the Web of 2010. Quick links: Highlights:
PHP.reboot works this latest beta release of jdk7. Or with any java6 jdks thanks to the jsr292-backport. But because some samples are better than long a speech:
<html>
<title>hello PHP.reboot</title>
<body>
<h1>
{
echo "Hello World !"
}
</h1>
</body>
</html>
function fibo(a) {
if (a == 0)
return 1
elseif (a == 1)
return 1
else
return fibo(a - 1) + fibo(a - 2)
}
echo fibo(7)
create table foo ( id integer not null, name varchar(64), primary key(id) ) insert into foo (id, name) values (4, 'hooooooa');
n = 3
a = select name from foo where id < $n
foreach(a as key: value) {
echo "row: " + key + " name: " + value.name
}
<html>
<body>
<ol>
{
resultset = select * from foo where name = 'bar'
foreach(resultset as value)
{
echo <li>$(value.name)</li>
}
}
</ol>
</body>
</html>
persons = [
{
"name": "Smith",
"age": 20,
"color": "blue"
},
{
"name": "Wesson",
"age": 17,
"color": "red"
}
]
foreach(persons as person) {
echo "Name:" + person.name
echo "Color:" + person.color
}
result = document(http://search.twitter.com/search.atom?lang=en&q=Java)
titles = for node in result//entry/title
return node
<news>
{
foreach(titles as title) {
title.name = "description"
echo title
}
}
</news>
ducks = []
add(ducks, "quack") // non empty string
add(ducks, []) // empty array
foreach(ducks as duck) {
echo isEmpty(duck)
}
// prints false
// prints trueMore samples ... The main grammar is available here and the SQL DSL is available here. What's missing ?
|