3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_title($url){ $fp = file_get_contents($url); if (!$fp) return null; $res = preg_match("/<title>(.*)<\/title>/siU", $fp, $title_matches); if (!$res) return null; $title = preg_replace('/\s+/', ' ', $title_matches[1]); $title = trim($title); return $title; } get_title("http://google.com");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PDVMA
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'get_title'
          1        SEND_VAL                                                 'http%3A%2F%2Fgoogle.com'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function get_title:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PDVMA
function name:  get_title
number of ops:  30
compiled vars:  !0 = $url, !1 = $fp, !2 = $res, !3 = $title_matches, !4 = $title
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'file_get_contents'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    5     5        BOOL_NOT                                         ~7      !1
          6      > JMPZ                                                     ~7, ->8
    6     7    > > RETURN                                                   null
    8     8    >   INIT_FCALL                                               'preg_match'
          9        SEND_VAL                                                 '%2F%3Ctitle%3E%28.%2A%29%3C%5C%2Ftitle%3E%2FsiU'
         10        SEND_VAR                                                 !1
         11        SEND_REF                                                 !3
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
    9    14        BOOL_NOT                                         ~10     !2
         15      > JMPZ                                                     ~10, ->17
   10    16    > > RETURN                                                   null
   12    17    >   INIT_FCALL                                               'preg_replace'
         18        SEND_VAL                                                 '%2F%5Cs%2B%2F'
         19        SEND_VAL                                                 '+'
         20        FETCH_DIM_R                                      ~11     !3, 1
         21        SEND_VAL                                                 ~11
         22        DO_ICALL                                         $12     
         23        ASSIGN                                                   !4, $12
   13    24        INIT_FCALL                                               'trim'
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                         $14     
         27        ASSIGN                                                   !4, $14
   14    28      > RETURN                                                   !4
   15    29*     > RETURN                                                   null

End of function get_title

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.67 ms | 1399 KiB | 22 Q