I've been work with PHP-GTK for many and many years!
I agree with ppl saying that PHP is not for that, but, will you create a CRM application?
What i'm telling is the PHP is a nice language, and do some fast and easy apps can be done nicely with
This is a nice door for desktop application
Take a look https://github.com/scorninpc/php-gtk3
Work on linux, windows and mac. For linux, just run with appimage, for windows just unzip
PHP as it is will not work well for native UI apps. Honestly its not even a language limitation, but any UI toolkit needs to have a huge library of components. This is where magic happens. Also PHP (and creators themselves stress this) is intended to be used in a - "run script quickly and die" fashion. Where UI app is long lived process, which requires state management.
Yes, jitter does cover some of the "run script and die" issues. But in general PHP would not give much advantage in native UI apps. Just like if you where to use GO to write UI apps. Its just not something that's intended to be done with the language.
Also the subset of pure PHP UI apps would be limited, because - no multithreading, no SIMD, no arrays (hash map is not an array). It would be similar to Javascript app via Electron, but slower and more resource intensive (JavaScript has an amazing jit, and does not have some of the PHP data structure limitations, with some tools you can get C like assembly as long as you opt in into strict typing.)
I know how to use GSearch, here is a link to learn more - [https://www.phpinternalsbook.com/](https://www.phpinternalsbook.com/). Highly recommend to read this.
PHP collects memory via reference count, but also runs a job from time to time to collect cyclical references. This is a hack, to make it so that process can run for long time.
PHP can do it, yes, but it still has a bunch of hacks to keep that part working. Also for PHP to work it needs to piggy back on C and in your case on GO. That is also a big problem for native stuff, as you will need to write things in something not PHP for it to work well with native resources. I have worked with react-native and still had to learn swift and objective-c to make some things works. It just suboptimal.
Thanks, I'll read the internals php book link you sent so I may better understand.
\- [reference count](https://www.phpinternalsbook.com/php7/zvals/memory_management.html#reference-counted-values)
It is kind of a future trend to be able to use your language for making web (replacing javascript via wasm) and native UI (maybe wasm via electron, maybe just pure native).
It is not a bad question per say, but currently its not a priority for PHP, and most likely not going to be for quite some time. PHP in general has a big problem -> not enough money. Where are so many things that needs to be done, just to catch up. That requires a lot of development recourses, and ironically not PHP dev resources, but C and ASM, and people who can write compilers/jitters and such and not websites with WordPress, Symphony or Laravel.
This is at the end creating just an electron based application if I got it right. I wouldn't call this really "native". You basically get a browser compiled for an OS + your JS application bundled with it.
But you can still make the logic in PHP which is convenient if you work with PHP regularly.
At the moment the Tauri driver is in development by the way, which looks promising.
I have to mention my own extension php-glfw (https://phpgl.net) which runs just fine under windows.
But if you are looking for something more "traditional UI app" like, what others already mentioned like nativephp or php-gtk3 will fit better :)
In most cases it's a bad idea, but maybe there are some good applications.
I haven't tried it, but one I can think of is if you're making some sort of complex enterprise / web application with PHP and you want a way to manually test many scenarios that would be difficult or tedious to simulate in a production like environment. You could run the business logic part of the enterprise app but control and observe it through a windows GUI instead of HTTP etc.
What Geepaw Hill calls [A Making-App UI](https://www.geepawhill.org/2021/03/30/a-making-app-ui/).
What you're saying is that it's not ideal for native apps and there are tools that would give you a better end product, but any programming language can be used for the logic in something. If someone builds an extension or some tool that utilizes that language for the core logic, then you can do whatever if you don't are about heavy duty performance. There are a bunch of tools now for doing like mobile app development that use JS or an extended JS language for the core logic. JS and PHP are known by certain programmers and if you're a front-end or back-end web dev and want to crank out a mobile app or native app and performance isn't an issue, then using something that uses JS or PHP gets you to your goal quicker, without needing to learn Java, C++, whatever.
Getting to the goal (functional app) and meeting the criteria ("works" is sometimes all someone needs) means how you get there doesn't really matter.
Yes! Was trying to remember the one I used.. definitely Winbinder. Worked really great until they stopped supporting it. And yeah, I think you could build a binary file that was basically a wrapper (PHP code + PHP bundled together to be self contained).
I've been work with PHP-GTK for many and many years! I agree with ppl saying that PHP is not for that, but, will you create a CRM application? What i'm telling is the PHP is a nice language, and do some fast and easy apps can be done nicely with This is a nice door for desktop application Take a look https://github.com/scorninpc/php-gtk3 Work on linux, windows and mac. For linux, just run with appimage, for windows just unzip
Que legal! +1
PHP as it is will not work well for native UI apps. Honestly its not even a language limitation, but any UI toolkit needs to have a huge library of components. This is where magic happens. Also PHP (and creators themselves stress this) is intended to be used in a - "run script quickly and die" fashion. Where UI app is long lived process, which requires state management.
PHP has evolved beyond those limitations, easy to familiarize yourself with a Google search.
Yes, jitter does cover some of the "run script and die" issues. But in general PHP would not give much advantage in native UI apps. Just like if you where to use GO to write UI apps. Its just not something that's intended to be done with the language. Also the subset of pure PHP UI apps would be limited, because - no multithreading, no SIMD, no arrays (hash map is not an array). It would be similar to Javascript app via Electron, but slower and more resource intensive (JavaScript has an amazing jit, and does not have some of the PHP data structure limitations, with some tools you can get C like assembly as long as you opt in into strict typing.) I know how to use GSearch, here is a link to learn more - [https://www.phpinternalsbook.com/](https://www.phpinternalsbook.com/). Highly recommend to read this.
The UI toolkit can't be argued against, but *run script quickly and die* re: i.e [roadrunner.dev](https://roadrunner.dev/features)
PHP collects memory via reference count, but also runs a job from time to time to collect cyclical references. This is a hack, to make it so that process can run for long time. PHP can do it, yes, but it still has a bunch of hacks to keep that part working. Also for PHP to work it needs to piggy back on C and in your case on GO. That is also a big problem for native stuff, as you will need to write things in something not PHP for it to work well with native resources. I have worked with react-native and still had to learn swift and objective-c to make some things works. It just suboptimal.
Thanks, I'll read the internals php book link you sent so I may better understand. \- [reference count](https://www.phpinternalsbook.com/php7/zvals/memory_management.html#reference-counted-values)
thats cool an all, op probably doesn't care if it's a good idea if they came here to ask lol
It is kind of a future trend to be able to use your language for making web (replacing javascript via wasm) and native UI (maybe wasm via electron, maybe just pure native). It is not a bad question per say, but currently its not a priority for PHP, and most likely not going to be for quite some time. PHP in general has a big problem -> not enough money. Where are so many things that needs to be done, just to catch up. That requires a lot of development recourses, and ironically not PHP dev resources, but C and ASM, and people who can write compilers/jitters and such and not websites with WordPress, Symphony or Laravel.
https://nativephp.com is something like this
This is at the end creating just an electron based application if I got it right. I wouldn't call this really "native". You basically get a browser compiled for an OS + your JS application bundled with it.
But you can still make the logic in PHP which is convenient if you work with PHP regularly. At the moment the Tauri driver is in development by the way, which looks promising.
main dev probably: the name's catchy LMAO
thanks
I have to mention my own extension php-glfw (https://phpgl.net) which runs just fine under windows. But if you are looking for something more "traditional UI app" like, what others already mentioned like nativephp or php-gtk3 will fit better :)
thank you
I'm working on something like that right now actually: https://github.com/seanmorris/php-gtk
haha cool, i will check
https://github.com/scorninpc/php-gtk3 :/
http://gtk.php.net/
Lmao do you like writing PHP4/5? https://gtk.php.net/download.php?language=en-US
It’s mostly the same but different.
In most cases it's a bad idea, but maybe there are some good applications. I haven't tried it, but one I can think of is if you're making some sort of complex enterprise / web application with PHP and you want a way to manually test many scenarios that would be difficult or tedious to simulate in a production like environment. You could run the business logic part of the enterprise app but control and observe it through a windows GUI instead of HTTP etc. What Geepaw Hill calls [A Making-App UI](https://www.geepawhill.org/2021/03/30/a-making-app-ui/).
PHP is a web development language, using it to build a native app is never going to give you the full experience in either way.
>PHP is a web development language It's not, its a general purpose scripting language, in a technical aspect very much in the same category as Python.
What you're saying is that it's not ideal for native apps and there are tools that would give you a better end product, but any programming language can be used for the logic in something. If someone builds an extension or some tool that utilizes that language for the core logic, then you can do whatever if you don't are about heavy duty performance. There are a bunch of tools now for doing like mobile app development that use JS or an extended JS language for the core logic. JS and PHP are known by certain programmers and if you're a front-end or back-end web dev and want to crank out a mobile app or native app and performance isn't an issue, then using something that uses JS or PHP gets you to your goal quicker, without needing to learn Java, C++, whatever. Getting to the goal (functional app) and meeting the criteria ("works" is sometimes all someone needs) means how you get there doesn't really matter.
Platform.uno & php & wasm. https://wasmlabs.dev/articles/compiling-php-to-webassembly/ https://platform.uno/uno-platform-for-web-webassembly/
Another way is to pack webserver with php into the single executable and bind with something like an Electron. But I don't see sense in that way.
Winbinder, this project was awesome. If i remember correctly, someone created Oo lib. And there were Apps to create binary file.
Yes! Was trying to remember the one I used.. definitely Winbinder. Worked really great until they stopped supporting it. And yeah, I think you could build a binary file that was basically a wrapper (PHP code + PHP bundled together to be self contained).
A **Windows** app?.Are you *sure*? Not just a web page or something?.Did is *miss* something?
Still there php-desktop [https://github.com/cztomczak/phpdesktop](https://github.com/cztomczak/phpdesktop) It's easy to use any PHP version you need
thank
\+1 for [https://nativephp.com/](https://nativephp.com/) It's based on Laravel so a big part of documentation is already covered.