3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function grab($url){ $data = curl_init(); curl_setopt($data, CURLOPT_URL, $url); curl_setopt($data, CURLOPT_RETURNTRANSFER, true); curl_setopt($data, CURLOPT_SSL_VERIFYPEER, false); $hasil = curl_exec($data); curl_close($data); return $hasil; } $grab = grab('https://mobile.twitter.com/DhikiSianipar/status/651449390301773824'); $grab = preg_replace('|<div id="brand_bar">(.*?)</div>|is','',$grab); $grab = preg_replace('|<span class="w-button-common w-button-follow">(.*?)</span>|is','',$grab); $grab = preg_replace('|<table class="main-tweet-actions four">(.*?)</table>|is','',$grab); $grab = preg_replace('|<div id="footer">(.*?)<img src="https://twitter.com/robots.txt" height="0" width="0">|is','',$grab); print_r($grab); //echo $grab; //$pecah = explode('<div class="dir-ltr" dir="ltr">',$grab); //$pecah2 = explode('</div>',$pecah[19]); //echo $pecah2[0]; ?> <button id="ular"></button> <textarea id="debugConsole" rows="10" cols="60">Data</textarea> <script type="text/javascript" src="./dist/html2canvas.js"></script> <script type="text/javascript"> html2canvas(document.querySelector("#main-content")).then(function(canvas) { document.body.appendChild(canvas); }); width: 520 </script> <script> document.querySelector("button").addEventListener("click", function() { var canvas = document.querySelector("canvas"); var image = canvas.toDataURL("image/png"); //Convert image to 'octet-stream' (Just a download, really) var debugConsole= document.getElementById("debugConsole"); debugConsole.value=image; }, false); </script> <script> window.onload = function() { setTimeout("document.querySelector('button').click()", 300); } </script>
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/hOU8Q:3 Stack trace: #0 /in/hOU8Q(11): grab('https://mobile....') #1 {main} thrown in /in/hOU8Q on line 3
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/hOU8Q on line 3
Process exited with code 255.