Fep is a new programming language that uses PHP as its virtual machine. Fep aims to provide a less noisy syntax, a more consistent programming API (based on Microsoft's .NET framework), and interop with existing PHP code.

For more information on specific aspects of Fep, see the relevant subsections:

Fep code will be parsed and compiled into PHP code in a predictable manner. For example, consider the following Fep code.

// Fep
var list = [ "apple", "orange", "pineapple" ];
println list.length;

var dict = { "apple": "juicy", 0: "zero" };
println dict.keys()[0];

// Compiled Fep (PHP code)
// NList and NDict are part of Olivine, the PHP library that
// Fep wraps for most of its functionality.
require "Olivine/Framework.php";
Olivine::import("System");
Olivine::import("System.Collections");
use \System\Console;

$list = _list( "apple", "orange", "pineapple" );
Console::writeLine( $list->length );

$dict = _dict( "apple", "juicy", 0, "zero" );
Console::writeLine( $dict->keys()[0] );

Olivine

The Olivine PHP Framework is the foundation of Fep. Olivine is a Java/.NET inspired PHP library that Fep wraps to implement its data structures and standard API.

Interop

Since Fep translates into PHP in a predictable manner, you can call PHP libraries seamlessly. For example, consider this code:

// ExampleLibrary/Ex.php
function add( $x, $y, $z )
{
    return $x + $y + $z;
}

// ExUser.fep
require ExampleLibrary.Ex;
var (x, y, z) = [1, 2, 3];
var result = PHP::add( x, y, z );
println result;

// Compiled Fep
require "Olivine/Framework.php";
require "ExampleLibrary/Ex.php";
Olivine::import("System");
use \System\Console;

list($x, $y, $z) = array(1, 2, 3);
$result = add( $x, $y, $z );
Console::writeLine( $result );