3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getFBLikes($page) { $pageinfo = ""; #$pageinfo = trim(file_get_contents("http://graph.facebook.com/".$page)); // CURL initialisieren $ch = curl_init(); if( $ch ) { // HTTP-URL setzen curl_setopt($ch, CURLOPT_URL, "https://graph.facebook.com/".$page); // CURL sagen, wir wollen den Inhalt der Seite haben curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Einen User-Agent vorgaukeln curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0'); // Request ausführen $pageinfo = curl_exec($ch); // if( $pageinfo === false ) { die ( curl_error( $ch ) ); } // CURL beenden curl_close( $ch ); } if( $pageinfo === false ) { $pageinfo = trim(file_get_contents("http://graph.facebook.com/".$page)); } // print_r($pageinfo); $pageinfo = json_decode($pageinfo); return $pageinfo->likes; } echo getFBLikes("werpasstauf");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LfWmE
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_FCALL                                               'getfblikes'
          1        SEND_VAL                                                 'werpasstauf'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function getfblikes:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 32
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 42
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 32
filename:       /in/LfWmE
function name:  getFBLikes
number of ops:  49
compiled vars:  !0 = $page, !1 = $pageinfo, !2 = $ch
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, ''
    8     2        INIT_FCALL_BY_NAME                                       'curl_init'
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !2, $4
    9     5      > JMPZ                                                     !2, ->32
   12     6    >   INIT_FCALL_BY_NAME                                       'curl_setopt'
          7        SEND_VAR_EX                                              !2
          8        FETCH_CONSTANT                                   ~6      'CURLOPT_URL'
          9        SEND_VAL_EX                                              ~6
         10        CONCAT                                           ~7      'https%3A%2F%2Fgraph.facebook.com%2F', !0
         11        SEND_VAL_EX                                              ~7
         12        DO_FCALL                                      0          
   14    13        INIT_FCALL_BY_NAME                                       'curl_setopt'
         14        SEND_VAR_EX                                              !2
         15        FETCH_CONSTANT                                   ~9      'CURLOPT_RETURNTRANSFER'
         16        SEND_VAL_EX                                              ~9
         17        SEND_VAL_EX                                              1
         18        DO_FCALL                                      0          
   16    19        INIT_FCALL_BY_NAME                                       'curl_setopt'
         20        SEND_VAR_EX                                              !2
         21        FETCH_CONSTANT                                   ~11     'CURLOPT_USERAGENT'
         22        SEND_VAL_EX                                              ~11
         23        SEND_VAL_EX                                              'Mozilla%2F5.0+%28Windows+NT+6.1%3B+WOW64%3B+rv%3A18.0%29+Gecko%2F20100101+Firefox%2F18.0'
         24        DO_FCALL                                      0          
   18    25        INIT_FCALL_BY_NAME                                       'curl_exec'
         26        SEND_VAR_EX                                              !2
         27        DO_FCALL                                      0  $13     
         28        ASSIGN                                                   !1, $13
   23    29        INIT_FCALL_BY_NAME                                       'curl_close'
         30        SEND_VAR_EX                                              !2
         31        DO_FCALL                                      0          
   27    32    >   TYPE_CHECK                                    4          !1
         33      > JMPZ                                                     ~16, ->42
   28    34    >   INIT_FCALL                                               'trim'
         35        INIT_FCALL                                               'file_get_contents'
         36        CONCAT                                           ~17     'http%3A%2F%2Fgraph.facebook.com%2F', !0
         37        SEND_VAL                                                 ~17
         38        DO_ICALL                                         $18     
         39        SEND_VAR                                                 $18
         40        DO_ICALL                                         $19     
         41        ASSIGN                                                   !1, $19
   32    42    >   INIT_FCALL                                               'json_decode'
         43        SEND_VAR                                                 !1
         44        DO_ICALL                                         $21     
         45        ASSIGN                                                   !1, $21
   33    46        FETCH_OBJ_R                                      ~23     !1, 'likes'
         47      > RETURN                                                   ~23
   34    48*     > RETURN                                                   null

End of function getfblikes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.32 ms | 1407 KiB | 20 Q