3v4l.org

run code in 300+ PHP versions simultaneously
<?php class user_filter extends php_user_filter { function filter($in, $out, &$consumed, $closing) { while($bucket = stream_bucket_make_writeable($in)) { } fclose($this->stream); } } stream_filter_register('user_filter','user_filter'); $fd = fopen('php://memory','w'); $filter = stream_filter_append($fd, 'user_filter'); echo fwrite($fd, "foo");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bjaEh
function name:  (null)
number of ops:  20
compiled vars:  !0 = $fd, !1 = $filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'stream_filter_register'
          1        SEND_VAL                                                 'user_filter'
          2        SEND_VAL                                                 'user_filter'
          3        DO_ICALL                                                 
   10     4        INIT_FCALL                                               'fopen'
          5        SEND_VAL                                                 'php%3A%2F%2Fmemory'
          6        SEND_VAL                                                 'w'
          7        DO_ICALL                                         $3      
          8        ASSIGN                                                   !0, $3
   11     9        INIT_FCALL                                               'stream_filter_append'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 'user_filter'
         12        DO_ICALL                                         $5      
         13        ASSIGN                                                   !1, $5
   12    14        INIT_FCALL                                               'fwrite'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 'foo'
         17        DO_ICALL                                         $7      
         18        ECHO                                                     $7
         19      > RETURN                                                   1

Class user_filter:
Function filter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 5
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/bjaEh
function name:  filter
number of ops:  15
compiled vars:  !0 = $in, !1 = $out, !2 = $consumed, !3 = $closing, !4 = $bucket
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    4     4      > JMP                                                      ->5
          5    >   INIT_FCALL                                               'stream_bucket_make_writeable'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $5      
          8        ASSIGN                                           ~6      !4, $5
          9      > JMPNZ                                                    ~6, ->5
    6    10    >   INIT_FCALL                                               'fclose'
         11        FETCH_OBJ_R                                      ~7      'stream'
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                                 
    7    14      > RETURN                                                   null

End of function filter

End of class user_filter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.96 ms | 1388 KiB | 25 Q