To use this website fully, you first need to accept the use of cookies. By agreeing to the use of cookies you consent to the user of functional cookies. For more information read this page.

Test ZPE live

Run your own sandboxed ZPE commands here! Note that commands cannot contain an apostrophe as this will prevent the execution! Also note that commands can only run for a maximum of 1 second of execution time.

You can also find out the exact version information of this version by typing version into the command box.

Test ZPE
Output

	

Here are some examples of code you can run (click Execute to insert them into the textbox above and then run them):

YASS
print("Hello world")
YASS
print(5 + 5)
YASS
$v =
function()
 print("Hi")
end function

//Lambda call
$v()

$v = ($x) => print($x) end function
$v("Hello world")
YASS
//Get the number of hours between now and 25-10-2015 14:00:24
$now = get_time()
$then = string_to_date("25-10-2015 14:00:24", "dd-MM-yyyy hh:mm:ss")
print($now->date_diff($then, "hours"))
YASS
for($i = 0; $i < 10; $i++){
  print($i)
}
YASS
$x = function($m){print($m + 2)}
for($i = 0; $i < 10; $i++){
  $x(10 * $i)
}
YASS
structure person

  public $first = "Jamie"
  public $surname = "Balfour"

  public function getFirst()
    return this->$first
  end function

  public function getSecond()
    return this->$surname
  end function

end structure
function main()

  $a = new person()
  print($a->getFirst())
  print($a->getSecond())

end function
			
YASS
public function fibonacci_generator($n)

    $x = 1
    $y = 2
    $results = [1, 1, 2]
    $i = 0
    while($i < $n - 3)
        $t = fibonacci_inner($x, $y)
        $results = $results.put($t)
        $x = $y
        $y = $t
        $i++
    end while

    return $results

end function

function fibonacci_inner($i, $j)

    return $i + $j

end function

function main()

	print(fibonacci_generator(10))

end function