3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = openssl_random_pseudo_bytes(65536); $params = array('level' => 6, 'window' => 15, 'memory' => 9); $fp = fopen('php://memory', 'wb+'); $filter = stream_filter_append($fp, 'zlib.deflate', STREAM_FILTER_WRITE, $params); fputs($fp, $data); stream_filter_remove($filter); rewind($fp); echo substr(bin2hex($streamA = stream_get_contents($fp)), 0, 32) . "\n"; echo substr(bin2hex($streamB = gzcompress($data)), 0, 32) . "\n"; var_dump($streamA === $streamB);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K1f3G
function name:  (null)
number of ops:  60
compiled vars:  !0 = $data, !1 = $params, !2 = $fp, !3 = $filter, !4 = $streamA, !5 = $streamB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'openssl_random_pseudo_bytes'
          1        SEND_VAL_EX                                              65536
          2        DO_FCALL                                      0  $6      
          3        ASSIGN                                                   !0, $6
    5     4        ASSIGN                                                   !1, <array>
    6     5        INIT_FCALL                                               'fopen'
          6        SEND_VAL                                                 'php%3A%2F%2Fmemory'
          7        SEND_VAL                                                 'wb%2B'
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !2, $9
    7    10        INIT_FCALL                                               'stream_filter_append'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 'zlib.deflate'
         13        SEND_VAL                                                 2
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !3, $11
    8    17        INIT_FCALL                                               'fputs'
         18        SEND_VAR                                                 !2
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
    9    21        INIT_FCALL                                               'stream_filter_remove'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                                 
   10    24        INIT_FCALL                                               'rewind'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                                 
   12    27        INIT_FCALL                                               'substr'
         28        INIT_FCALL                                               'bin2hex'
         29        INIT_FCALL                                               'stream_get_contents'
         30        SEND_VAR                                                 !2
         31        DO_ICALL                                         $16     
         32        ASSIGN                                           ~17     !4, $16
         33        SEND_VAL                                                 ~17
         34        DO_ICALL                                         $18     
         35        SEND_VAR                                                 $18
         36        SEND_VAL                                                 0
         37        SEND_VAL                                                 32
         38        DO_ICALL                                         $19     
         39        CONCAT                                           ~20     $19, '%0A'
         40        ECHO                                                     ~20
   13    41        INIT_FCALL                                               'substr'
         42        INIT_FCALL                                               'bin2hex'
         43        INIT_FCALL                                               'gzcompress'
         44        SEND_VAR                                                 !0
         45        DO_ICALL                                         $21     
         46        ASSIGN                                           ~22     !5, $21
         47        SEND_VAL                                                 ~22
         48        DO_ICALL                                         $23     
         49        SEND_VAR                                                 $23
         50        SEND_VAL                                                 0
         51        SEND_VAL                                                 32
         52        DO_ICALL                                         $24     
         53        CONCAT                                           ~25     $24, '%0A'
         54        ECHO                                                     ~25
   14    55        INIT_FCALL                                               'var_dump'
         56        IS_IDENTICAL                                     ~26     !4, !5
         57        SEND_VAL                                                 ~26
         58        DO_ICALL                                                 
         59      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.99 ms | 1015 KiB | 23 Q