3v4l.org

run code in 300+ PHP versions simultaneously
<?php $API_KEY = 'f313362ef4400dc313d57d573996a086a8db17697ebd6b8c0f77dcb178460406'; $PAGE_ID = 'kw9m35yq84vy'; $METRIC_ID = '8p5cf4zshp98'; $BASE_URI = 'https://api.statuspage.io/v1'; $ch = curl_init(sprintf("%s/pages/%s/metrics/%s/data.json", $BASE_URI, $PAGE_ID, $METRIC_ID)); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Authorization: OAuth " . $API_KEY, "Expect: 100-continue" ) ); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // need at least 1 data point for every 5 minutes // submit random data for the whole day $total_points = (60 / 5 * 24); for($i = 0; $i < $total_points; $i++) { $ts = time() - ($i * 5 * 60); $value = rand(0, 99); $postparams = array( "data[timestamp]" => $ts, "data[value]" => '1' ); curl_setopt($ch, CURLOPT_POSTFIELDS, $postparams); curl_exec($ch); printf("Submitted point %d of %d\n", ($i + 1), $total_points); } ?>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7, 7.2.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/OCmPE:7 Stack trace: #0 {main} thrown in /in/OCmPE on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.37, 5.6.0 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/OCmPE on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: curl_init() in /in/OCmPE on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: curl_init() in /in/OCmPE on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: curl_init() in /in/OCmPE on line 7

preferences:
163.46 ms | 401 KiB | 211 Q