3v4l.org

run code in 300+ PHP versions simultaneously
<?php $username = "w3resource"; $feed = "http://search.twitter.com/search.atom?q=from:".$username."&rpp=2"; // $prefix = '<h3>corePHP</h3>'; // $suffix = '<p><a href="http://twitter.com/'.$username.'">Follow us on Twitter</a></p>'; function parse_feed($feed) { $stepOne = explode('<content type="html">', $feed); $stepTwo = explode('</content>', $stepOne[1]); $tweet = $stepTwo[0]; $tweet = str_replace("&lt;", "<", $tweet); $tweet = str_replace("&gt;", ">", $tweet); return $tweet; } $latest_tweet = file_get_contents($feed); // echo stripslashes($prefix) . parse_feed($latest_tweet) . stripslashes($suffix); echo parse_feed($latest_tweet);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uu0pU
function name:  (null)
number of ops:  13
compiled vars:  !0 = $username, !1 = $feed, !2 = $latest_tweet
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'w3resource'
    3     1        CONCAT                                           ~4      'http%3A%2F%2Fsearch.twitter.com%2Fsearch.atom%3Fq%3Dfrom%3A', !0
          2        CONCAT                                           ~5      ~4, '%26rpp%3D2'
          3        ASSIGN                                                   !1, ~5
   14     4        INIT_FCALL                                               'file_get_contents'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !2, $7
   16     8        INIT_FCALL                                               'parse_feed'
          9        SEND_VAR                                                 !2
         10        DO_FCALL                                      0  $9      
         11        ECHO                                                     $9
         12      > RETURN                                                   1

Function parse_feed:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uu0pU
function name:  parse_feed
number of ops:  28
compiled vars:  !0 = $feed, !1 = $stepOne, !2 = $stepTwo, !3 = $tweet
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%3Ccontent+type%3D%22html%22%3E'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    8     6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%3C%2Fcontent%3E'
          8        FETCH_DIM_R                                      ~6      !1, 1
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
    9    12        FETCH_DIM_R                                      ~9      !2, 0
         13        ASSIGN                                                   !3, ~9
   10    14        INIT_FCALL                                               'str_replace'
         15        SEND_VAL                                                 '%26lt%3B'
         16        SEND_VAL                                                 '%3C'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $11     
         19        ASSIGN                                                   !3, $11
   11    20        INIT_FCALL                                               'str_replace'
         21        SEND_VAL                                                 '%26gt%3B'
         22        SEND_VAL                                                 '%3E'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $13     
         25        ASSIGN                                                   !3, $13
   12    26      > RETURN                                                   !3
   13    27*     > RETURN                                                   null

End of function parse_feed

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.48 ms | 1403 KiB | 20 Q