One single binary for macOS, Linux, Android and iOS. Native UI or a web frontend in PHP 8.3+, with zero C extensions and ext-ffi.
use MyPHP\{App, Window, WindowOptions};
use MyPHP\UI\{Content, Context};
$count = 0;
App::whenReady(function () use (&$count) {
new Window(new WindowOptions(
title: 'Counter',
width: 360,
height: 240,
content: Content::view(function (Context $c) use (&$count) {
$c->column(pad: 24, gap: 12, align: 1);
$c->text("Tapped $count times", size: 22);
if ($c->clicked($c->button('Increment'))) {
$count++;
}
$c->end();
})
));
});
App::run();
The view is a PHP function of your app's state. MyPHP calls it to build each frame and draws it on the GPU, with Metal, OpenGL or Direct3D: no HTML, no JavaScript, no bindings.
Its windows open at once, and an app of native UI alone needs only PHP to build and no webview to run.
$ myphp init my-app
$ cd my-app && myphp run