3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo ob_start('ob_gzip'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> </head> <body> </body> </html> <?php ob_end_flush(); //压缩函数 function ob_gzip($content){ if(!headers_sent()&&extension_loaded("zlib")&&strstr($_SERVER["HTTP_ACCEPT_ENCODING"],"gzip")){ $content = gzencode($content,9); header("Content-Encoding: gzip"); header("Vary: Accept-Encoding"); header("Content-Length: ".strlen($content)); } return $content; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tIoQk
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   INIT_FCALL                                               'ob_start'
          1        SEND_VAL                                                 'ob_gzip'
          2        DO_ICALL                                         $0      
          3        ECHO                                                     $0
          4        ECHO                                                     '+%0A%0A%3C%21DOCTYPE+html+PUBLIC+%22-%2F%2FW3C%2F%2FDTD+XHTML+1.0+Transitional%2F%2FEN%22+%22http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-transitional.dtd%22%3E+%0A%3Chtml+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%3E+%0A%3Chead%3E+%0A%3Cmeta+http-equiv%3D%22Content-Type%22+content%3D%22text%2Fhtml%3B+charset%3Dgb2312%22+%2F%3E+%0A%3Ctitle%3E%E6%97%A0%E6%A0%87%E9%A2%98%E6%96%87%E6%A1%A3%3C%2Ftitle%3E+%0A%3C%2Fhead%3E+%0A%0A%3Cbody%3E+%0A%3C%2Fbody%3E+%0A%3C%2Fhtml%3E+%0A%0A'
   15     5        INIT_FCALL                                               'ob_end_flush'
          6        DO_ICALL                                                 
   26     7      > RETURN                                                   1

Function ob_gzip:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 34
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
Branch analysis from position: 17
Branch analysis from position: 9
filename:       /in/tIoQk
function name:  ob_gzip
number of ops:  36
compiled vars:  !0 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'headers_sent'
          2        DO_ICALL                                         $1      
          3        BOOL_NOT                                         ~2      $1
          4      > JMPZ_EX                                          ~2      ~2, ->9
          5    >   INIT_FCALL                                               'extension_loaded'
          6        SEND_VAL                                                 'zlib'
          7        DO_ICALL                                         $3      
          8        BOOL                                             ~2      $3
          9    > > JMPZ_EX                                          ~2      ~2, ->17
         10    >   INIT_FCALL                                               'strstr'
         11        FETCH_R                      global              ~4      '_SERVER'
         12        FETCH_DIM_R                                      ~5      ~4, 'HTTP_ACCEPT_ENCODING'
         13        SEND_VAL                                                 ~5
         14        SEND_VAL                                                 'gzip'
         15        DO_ICALL                                         $6      
         16        BOOL                                             ~2      $6
         17    > > JMPZ                                                     ~2, ->34
   19    18    >   INIT_FCALL                                               'gzencode'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 9
         21        DO_ICALL                                         $7      
         22        ASSIGN                                                   !0, $7
   20    23        INIT_FCALL                                               'header'
         24        SEND_VAL                                                 'Content-Encoding%3A+gzip'
         25        DO_ICALL                                                 
   21    26        INIT_FCALL                                               'header'
         27        SEND_VAL                                                 'Vary%3A+Accept-Encoding'
         28        DO_ICALL                                                 
   22    29        INIT_FCALL                                               'header'
         30        STRLEN                                           ~11     !0
         31        CONCAT                                           ~12     'Content-Length%3A+', ~11
         32        SEND_VAL                                                 ~12
         33        DO_ICALL                                                 
   24    34    > > RETURN                                                   !0
   25    35*     > RETURN                                                   null

End of function ob_gzip

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.88 ms | 1400 KiB | 27 Q