3v4l.org

run code in 300+ PHP versions simultaneously
<?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>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hOU8Q
function name:  (null)
number of ops:  33
compiled vars:  !0 = $grab
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'grab'
          1        SEND_VAL                                                 'https%3A%2F%2Fmobile.twitter.com%2FDhikiSianipar%2Fstatus%2F651449390301773824'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   12     4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAL                                                 '%7C%3Cdiv+id%3D%22brand_bar%22%3E%28.%2A%3F%29%3C%2Fdiv%3E%7Cis'
          6        SEND_VAL                                                 ''
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9        ASSIGN                                                   !0, $3
   13    10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%7C%3Cspan+class%3D%22w-button-common+w-button-follow%22%3E%28.%2A%3F%29%3C%2Fspan%3E%7Cis'
         12        SEND_VAL                                                 ''
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $5      
         15        ASSIGN                                                   !0, $5
   14    16        INIT_FCALL                                               'preg_replace'
         17        SEND_VAL                                                 '%7C%3Ctable+class%3D%22main-tweet-actions+four%22%3E%28.%2A%3F%29%3C%2Ftable%3E%7Cis'
         18        SEND_VAL                                                 ''
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $7      
         21        ASSIGN                                                   !0, $7
   15    22        INIT_FCALL                                               'preg_replace'
         23        SEND_VAL                                                 '%7C%3Cdiv+id%3D%22footer%22%3E%28.%2A%3F%29%3Cimg+src%3D%22https%3A%2F%2Ftwitter.com%2Frobots.txt%22+height%3D%220%22+width%3D%220%22%3E%7Cis'
         24        SEND_VAL                                                 ''
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $9      
         27        ASSIGN                                                   !0, $9
   16    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                                 
   22    31        ECHO                                                     '%3Cbutton+id%3D%22ular%22%3E%3C%2Fbutton%3E%0A%3Ctextarea+id%3D%22debugConsole%22+rows%3D%2210%22+cols%3D%2260%22%3EData%3C%2Ftextarea%3E%0A%3Cscript+type%3D%22text%2Fjavascript%22+src%3D%22.%2Fdist%2Fhtml2canvas.js%22%3E%3C%2Fscript%3E%0A%3Cscript+type%3D%22text%2Fjavascript%22%3E%0A%09html2canvas%28document.querySelector%28%22%23main-content%22%29%29.then%28function%28canvas%29+%7B%0A%09%09document.body.appendChild%28canvas%29%3B%0A%09%7D%29%3B%0A%09width%3A+520%0A%3C%2Fscript%3E%0A%3Cscript%3E%0Adocument.querySelector%28%22button%22%29.addEventListener%28%22click%22%2C+function%28%29+%7B%0Avar+canvas+%3D+document.querySelector%28%22canvas%22%29%3B%0Avar+image+%3D+canvas.toDataURL%28%22image%2Fpng%22%29%3B+%2F%2FConvert+image+to+%27octet-stream%27+%28Just+a+download%2C+really%29%0Avar+debugConsole%3D+document.getElementById%28%22debugConsole%22%29%3B++%0AdebugConsole.value%3Dimage%3B%0A%7D%2C+false%29%3B%0A%3C%2Fscript%3E%0A%3Cscript%3E%0A++window.onload+%3D+function%28%29+%7B%0A++++++setTimeout%28%22document.querySelector%28%27button%27%29.click%28%29%22%2C+300%29%3B%0A++%7D%0A%3C%2Fscript%3E'
   43    32      > RETURN                                                   1

Function grab:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hOU8Q
function name:  grab
number of ops:  31
compiled vars:  !0 = $url, !1 = $data, !2 = $hasil
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL_BY_NAME                                       'curl_init'
          2        DO_FCALL                                      0  $3      
          3        ASSIGN                                                   !1, $3
    4     4        INIT_FCALL_BY_NAME                                       'curl_setopt'
          5        SEND_VAR_EX                                              !1
          6        FETCH_CONSTANT                                   ~5      'CURLOPT_URL'
          7        SEND_VAL_EX                                              ~5
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
    5    10        INIT_FCALL_BY_NAME                                       'curl_setopt'
         11        SEND_VAR_EX                                              !1
         12        FETCH_CONSTANT                                   ~7      'CURLOPT_RETURNTRANSFER'
         13        SEND_VAL_EX                                              ~7
         14        SEND_VAL_EX                                              <true>
         15        DO_FCALL                                      0          
    6    16        INIT_FCALL_BY_NAME                                       'curl_setopt'
         17        SEND_VAR_EX                                              !1
         18        FETCH_CONSTANT                                   ~9      'CURLOPT_SSL_VERIFYPEER'
         19        SEND_VAL_EX                                              ~9
         20        SEND_VAL_EX                                              <false>
         21        DO_FCALL                                      0          
    7    22        INIT_FCALL_BY_NAME                                       'curl_exec'
         23        SEND_VAR_EX                                              !1
         24        DO_FCALL                                      0  $11     
         25        ASSIGN                                                   !2, $11
    8    26        INIT_FCALL_BY_NAME                                       'curl_close'
         27        SEND_VAR_EX                                              !1
         28        DO_FCALL                                      0          
    9    29      > RETURN                                                   !2
   10    30*     > RETURN                                                   null

End of function grab

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.79 ms | 1403 KiB | 18 Q