3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $get_string = "TOKEN=EC%2d09F245458F168291J&TIMESTAMP=2015%2d08%2d29T08%3a22%3a55Z&CORRELATIONID=bf30a7057eaa1&ACK=Success&VERSION=78&BUILD=000000"; parse_str($get_string, $get_array); //print_r($get_array); // echo $get_array['ACK']; $params=['name'=>'John', 'surname'=>'Doe', 'age'=>36]; $defaults = array( CURLOPT_URL => 'http://myremoteservice/', CURLOPT_POST => true, CURLOPT_POSTFIELDS => $params, ); $ch = curl_init(); curl_setopt_array($ch, ($options + $defaults));
based on jp769
Output for 7.2.0
Warning: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' (this will throw an Error in a future version of PHP) in /in/Y03BZ on line 22 Warning: Use of undefined constant CURLOPT_POST - assumed 'CURLOPT_POST' (this will throw an Error in a future version of PHP) in /in/Y03BZ on line 23 Warning: Use of undefined constant CURLOPT_POSTFIELDS - assumed 'CURLOPT_POSTFIELDS' (this will throw an Error in a future version of PHP) in /in/Y03BZ on line 24 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/Y03BZ:26 Stack trace: #0 {main} thrown in /in/Y03BZ on line 26
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' in /in/Y03BZ on line 22 Notice: Use of undefined constant CURLOPT_POST - assumed 'CURLOPT_POST' in /in/Y03BZ on line 23 Notice: Use of undefined constant CURLOPT_POSTFIELDS - assumed 'CURLOPT_POSTFIELDS' in /in/Y03BZ on line 24 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/Y03BZ:26 Stack trace: #0 {main} thrown in /in/Y03BZ on line 26
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Notice: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' in /in/Y03BZ on line 22 Notice: Use of undefined constant CURLOPT_POST - assumed 'CURLOPT_POST' in /in/Y03BZ on line 23 Notice: Use of undefined constant CURLOPT_POSTFIELDS - assumed 'CURLOPT_POSTFIELDS' in /in/Y03BZ on line 24 Fatal error: Call to undefined function curl_init() in /in/Y03BZ on line 26
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Y03BZ on line 20
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/Y03BZ on line 20
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/Y03BZ on line 20
Process exited with code 255.