3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * This PHP file is a sample request for initiating the payment request through Next-Web. * In this file, the assumtion is that the business knows his Next-Web user, pass, product and amount as minimum requirements * The business will then send a post request with the information to this file and it will do the redirection to the payment page automatically. * Business can optionally provide some comments about the product which will not be displayed to the users but will be stored in our database for referencing. */ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://www.nextkw.com/api/getid"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "user=" . "kuwaityogaeventweb" . "&pass=" . "0f40a650f77de192076d88c70cb7ebd3dd3cf4187dd897e13d6b80a0ef2c832a"); // yourNextWebUser is the NextWeb user and yourNextWebPass is the NextWeb password. Replace them with your actual user and pass curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $ReturnValue = curl_exec($ch); curl_close ($ch); if($ReturnValue == "Error"){//An Error has occured generating the URL for payment. This can happen due to invalid credentials or any other errors. echo " An Error Occured"; } else { ?> <!DOCTYPE html> <html> <head></head> <body> <form id="PaymentForm" action= "<?php echo $ReturnValue; ?>" method="POST"> <!-- $ReturnValue will be the URL for payment --> <input type="hidden" id="amount" name="NWAMNT" value="10"> <!-- This is the Amount for payment --> <input type="hidden" id="tracking"name="TrackingID" value="0"> <!-- This is an optional ID for the businesses and will be returned at the end of payment. NOTE: This piece of information will not be stored in the transactions. --> <input type="hidden" id="Product" name="Product" value="yoga event"> <!-- This is the product that is being sold. This will be displayed to the user and is a necessary input. --> <input type="hidden" id="Comment" name="comment" value="test"> <!-- This is an optional input and will be shown in the dashboard for next web as comment. a useful piece of information for checking details from the dashboard. --> </form> <script> /* This will make sure that the form for payment is submitted automatically */ document.getElementById("PaymentForm").submit(); document.write(""); </script> </body> </html> <?php }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/E7tnL:8 Stack trace: #0 {main} thrown in /in/E7tnL on line 8
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/E7tnL:8 Stack trace: #0 {main} thrown in /in/E7tnL on line 8
Process exited with code 255.
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/E7tnL on line 8
Process exited with code 255.

preferences:
184.63 ms | 402 KiB | 226 Q