Comments

These are comments left by visitors. Leave a comment if you want to say hi, found something on the website that needs some adjustment, or want to tell everyone how your day is going.

Authentication required

You need to log in to post a comment

Log in
Grzegorz Pietrzak Avatar
Grzegorz Pietrzak - 2 months ago
Hmm just an idea, maybe not useful but I want to share. What if we click (ctrl + left mouse click) on some function (for example substr) then php docs will be opened in new tab with docs to the function?

Jeroen Avatar
Jeroen - 2 months ago
At the moment you can do ctrl +space for autocompletion, or enable autocomplete in the options. It will show "some" docs. I can link this to the actual docs on the website if you thinks it's useful?

Alan Kmiecik Avatar
Alan Kmiecik - 2 months ago
Is there a way to get easterdate() to work? I get the message: Uncaught Error: Call to undefined function easter_date() in /home/user/scripts/code.php:2 thanks

Jeroen Avatar
Jeroen - 2 months ago
I went ahead and compiled the calendar extension on the latest PHP versions. At the moment the compiler is running to install it on older versions as well, hopefully by the end of the day all versions have the calendar extension installed and easter_days() will work on all of them. Thank you for the suggestion!

Hà Lê Avatar
Hà Lê - 2 months ago
Like can we have some auto save into local storage for the code pls? Its really annoying me when i code a really long function and then f5 the page then all the code i have done its completely lost? Can you fix this pls.

Jeroen Avatar
Jeroen - 2 months ago
Yes, enable "autoload" in the options. I think "Autosave" is a better name though, I'll change that and enable it by default. When you enable the option and you haven't pressed "execute" yet, your code should be still in your local storage.

Huush Avatar
Huush - 3 months ago
Hi, I'm a very new user to the site. Very happy to have found this as I'm new to PHP and having this compiler/exec has made my PHP coding life so much better in just 24 hours! So, thank you! An issue I'm encountering - and not surprised to do so - is that network access is disabled. I completely understand why(s). However, I'm needing to test some functionality around the curl_* set of functions. For exampe, in my current test I'm needing to return/evaluate the getinfo results of whether a page can be accessed or a file exists, codes, size, etc and then process based upon the results. When I attempt any curl action, there is NO result. This is different to a failure which would be a component of what I also need to account for. There's no search function on the comments section so I'm not sure if this has been requested/resolved/rejected in the past. Is there an internal sandbox address or single external address (ideally with some basic read only files) that is or can be enabled for such testing? Such would be very handy as attempting to build a manual attribute list for comparison is time consuming and has the chance to introduce errors.

Jeroen Avatar
Jeroen - 3 months ago
Thank you for your comment! To avoid abuse of the service, network access is disabled, and curl functions won't work for that reason. It should show you an error when it doesn't return within time. Abuse of network would be something like a loop to ddos a website or a script could be used as a proxy. I'd suggest setting up something local, like a docker container or mamp/wamp. I like the idea of an internal way to do this and would be reasonably easy to implement, but has to be documented. Maybe I can reroute all traffic to some internal files instead.

Huush Avatar
Huush - 3 months ago
Just for clarity, the current behaviour for the curl_exec function doesn't return any response and there's no timeout. It executes quickly but returns empty results. e.g. HTTP_RESPONSE_CODE is null. The only attributes that are set are the time attributes and these are very small values.

Jeroen Avatar
Jeroen - 3 months ago
Ahh, thank you for that! The error is in curl_error(), but that might not be very clear for people using it.

Huush Avatar
Huush - 3 months ago
Thanks Jeroen. And especially for the fast response. That's one of the reasons I expected it was disabled. The internal reroute to a location & set known files with some local onlinephp.io documentation (happy to help if I can) detailing expected response is exactly what I was thinking. I'm not certain what the failure response would be like, but may get lucky and failures (e.g. HTTP_RESPONSECODE) might just work if the top level address is accessible. Alternately, just cater for success cases and failure conditions remain outside of scope of what's available. I'm not sure if you've created local versions of the pages detailing the PHP functions but would be great to link that doco into those curl* pages as they don't indicate at all that network access is disabled. I spent a fair bit of time debugging and trying different urls before I finally came across the note confirming that network access was disabled. :)

Jeroen Avatar
Jeroen - 3 months ago
Hi Huush! I just finished the behavior. All network access in the sandbox is now rerouted to an internal webserver that catches all traffic to all websites. When someone uses a network function, a warning is shown that can be dismissed with some info: https://onlinephp.io/faq/curl_network. I adde a bunch of test files for some common types, added a basic authentication page and a route to request status errors. Hope this clears things up and is useful to people. Thanks!

Matej Avatar
Matej - 3 months ago
Thanks: First of all, thank you. I'm using your services for years now, and I appreciate your site immensely. Intro: Since PHP 7.4 there is a null coalescing assignment operator (??=). It sets the variable on the left with the value of the expression on the right if and only if the variable is undefined or null, to begin with. Issue: I'm using PHP 8.1 and while the code where I use this operator works great, I would like to point out that the editor shows there's an error in my code. Example: public function test($var = null) { $var ??= 0; // PHP Code Editor: Syntax error, unexpected '=' return $var + 1; }

Jeroen Avatar
Jeroen - 3 months ago
I spent most of the day updating the ACE editor code to support PHP 8.1 and updated it on the website. You can see a demo with most new functionality here: https://onlinephp.io/c/php8.1-aceeditor-demo. I submitted my code to the ACE repo on github so other people using this editor will benefit too. Thanks again!

Jeroen Avatar
Jeroen - 3 months ago
Thank you for this! I use the ace editor on this website. It a seems they don't support the safe null operator yet. When I have some time I'll look into this and contribute a fix or wait for an update

webtrekker UK Avatar
webtrekker UK - 3 months ago
Excellent work! Well done! This is a very useful PHP editor and previewer, available everywhere too rather than only as a dedicated installation. Only one thing I would like to see implemented and that would be the option to view the editor full screen. I know the panes can be dragged to size but a fullscreen button would be a nice addition IMHO.

Jeroen Avatar
Jeroen - 3 months ago
That is a great idea! I'll implement this soon. Thank you!

webtrekker UK Avatar
webtrekker UK - 3 months ago
Much appreciated, and thank you for such a quick response.

Jeroen Avatar
Jeroen - 3 months ago
I implemented a better full sized editor today. It's not 100% full-screen, but I think this should do the trick. Thanks again for the suggestion!

Tobias Schrull Avatar
Tobias Schrull - 4 months ago
I really like how this page has evolved over the last few weeks. Thank you! I really like it!

Kylychbek Turdakunov Avatar
Kylychbek Turdakunov - 4 months ago
[like]

Juuso Turunen Avatar
Juuso Turunen - 4 months ago
Cool!

Jeroen Avatar
Jeroen - 4 months ago
Hi, welcome to the new comment system. It needs some work, but it works for now.

MouseZver Avatar
MouseZver - 4 months ago
test test test

Jeroen Avatar
Jeroen - 4 months ago
That worked :)

     Duy Thiện Avatar
Duy Thiện - 4 months ago
:D

Archived comments

Facebook comments (April 2018 - April 2022)
Discuss comments (February 2009 - April 2018)

Archived comments

Facebook (April 2018 - April 2022)
Discuss (February 2009 - April 2018)

Most used PHP functions

Last used PHP functions