3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fileHandle = fopen("php://memory", "w+"); $params = array('level' => 6, 'window' => 15, 'memory' => 9); //stream_filter_append($fileHandle, "string.rot13", STREAM_FILTER_WRITE, $params); stream_filter_append($fileHandle, 'zlib.deflate', STREAM_FILTER_WRITE, $params); $string = "Each of these code fragments is very simple, and easy to read and understand. One produces a character at a time by calling emit(); the other consumes a character at a time by calling getchar(). If only the calls to emit() and the calls to getchar() could be made to feed data to each other, it would be simple to connect the two fragments together so that the output from the decompressor went straight to the parser. In many modern operating systems, you could do this using pipes between two processes or two threads. emit() in the decompressor writes to a pipe, and getchar() in the parser reads from the other end of the same pipe. Simple and robust, but also heavyweight and not portable. Typically you don't want to have to divide your program into threads for a task this simple."; fwrite($fileHandle, $string); echo "Current position is: ".ftell($fileHandle)."\n"; rewind($fileHandle); //fseek($fileHandle, 0); //echo stream_get_contents($fileHandle); //echo "file position: ".filesize($fileHandle)."\n"; //echo "strlen = : ".strlen($string); fpassthru($fileHandle);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MttZV
function name:  (null)
number of ops:  30
compiled vars:  !0 = $fileHandle, !1 = $params, !2 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'fopen'
          1        SEND_VAL                                                 'php%3A%2F%2Fmemory'
          2        SEND_VAL                                                 'w%2B'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    6     5        ASSIGN                                                   !1, <array>
    9     6        INIT_FCALL                                               'stream_filter_append'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 'zlib.deflate'
          9        SEND_VAL                                                 2
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   11    12        ASSIGN                                                   !2, 'Each+of+these+code+fragments+is+very+simple%2C+and+easy+to+read+and+understand.+One+produces+a+character+at+a+time+by+calling+emit%28%29%3B+the+other+consumes+a+character+at+a+time+by+calling+getchar%28%29.+If+only+the+calls+to+emit%28%29+and+the+calls+to+getchar%28%29+could+be+made+to+feed+data+to+each+other%2C+it+would+be+simple+to+connect+the+two+fragments+together+so+that+the+output+from+the+decompressor+went+straight+to+the+parser.%0A%0AIn+many+modern+operating+systems%2C+you+could+do+this+using+pipes+between+two+processes+or+two+threads.+emit%28%29+in+the+decompressor+writes+to+a+pipe%2C+and+getchar%28%29+in+the+parser+reads+from+the+other+end+of+the+same+pipe.+Simple+and+robust%2C+but+also+heavyweight+and+not+portable.+Typically+you+don%27t+want+to+have+to+divide+your+program+into+threads+for+a+task+this+simple.'
   15    13        INIT_FCALL                                               'fwrite'
         14        SEND_VAR                                                 !0
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
   17    17        INIT_FCALL                                               'ftell'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $9      
         20        CONCAT                                           ~10     'Current+position+is%3A+', $9
         21        CONCAT                                           ~11     ~10, '%0A'
         22        ECHO                                                     ~11
   19    23        INIT_FCALL                                               'rewind'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                                 
   26    26        INIT_FCALL                                               'fpassthru'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.87 ms | 1006 KiB | 19 Q