Skip to content


Subversion checkout URL

You can clone with
Download ZIP
PHP preprocessor that makes your code look beautiful
PHP JavaScript
branch: master

LadyPHP makes your code look beautiful


Do you also hate all these dollars, arrows and $this everywhere in you PHP files? Well, PHP just isn't the sexiest one when compared to other languages. But still you're not going to switch language just because the syntax, right? Now you can switch syntax without leaving the language, meet LadyPHP!

LadyPHP is a preprocessor for PHP, that allows you to write code with cleaner syntax. It can do conversion in both ways, so you can start writing your current projects with lady syntax right away and save them back to PHP, your collaborators won't notice.

This software is still under heavy development, syntax and API can be changed.


You can try JavaScript version of LadyPHP right in your browser.


Syntax reference

public f()public function f()
[k: 'v']['k' => 'v']
x ~ yx . y

Semicolons at the end of lines are optional.

To write operators @ and ~, you have to escape them with \.

Usage from command line

ladyphp file.lady  # creates file.php
ladyphp file.php   # creates file.lady
ladyphp -r dir/    # converts all php files in directory to ladyphp
ladyphp -w dir/    # watches directory and converts updated lady files


LadyPHP is created by Honza Novák and it's licensed under a Creative Commons BY-SA.

Something went wrong with that request. Please try again.