3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Source: https://bugs.php.net/bug.php?id=66182 class before_body_foo_filter extends php_user_filter { function filter($in, $out, &$consumed, $closing) { // this exit; causes a segfault exit; } } stream_filter_register('before_body_foo', 'before_body_foo_filter'); $fp = fopen('php://output', 'w'); stream_filter_append($fp, 'before_body_foo', STREAM_FILTER_WRITE, 'YES'); fwrite($fp, 'hello');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c57Ls
function name:  (null)
number of ops:  20
compiled vars:  !0 = $fp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'stream_filter_register'
          1        SEND_VAL                                                 'before_body_foo'
          2        SEND_VAL                                                 'before_body_foo_filter'
          3        DO_ICALL                                                 
   15     4        INIT_FCALL                                               'fopen'
          5        SEND_VAL                                                 'php%3A%2F%2Foutput'
          6        SEND_VAL                                                 'w'
          7        DO_ICALL                                         $2      
          8        ASSIGN                                                   !0, $2
   16     9        INIT_FCALL                                               'stream_filter_append'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 'before_body_foo'
         12        SEND_VAL                                                 2
         13        SEND_VAL                                                 'YES'
         14        DO_ICALL                                                 
   17    15        INIT_FCALL                                               'fwrite'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 'hello'
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class before_body_foo_filter:
Function filter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/c57Ls
function name:  filter
number of ops:  6
compiled vars:  !0 = $in, !1 = $out, !2 = $consumed, !3 = $closing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    9     4      > EXIT                                                     
   10     5*     > RETURN                                                   null

End of function filter

End of class before_body_foo_filter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.03 ms | 1395 KiB | 21 Q