3v4l.org

run code in 300+ PHP versions simultaneously
<?php class strtoupper_filter extends php_user_filter { #[\ReturnTypeWillChange] function filter($in, $out, &$consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { $bucket->data = strtoupper($bucket->data); $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } } $stdout = fopen('php://stdout', 'wb'); stream_filter_register('capture', strtoupper_filter::class); stream_filter_append($stdout, 'capture'); var_export(stream_isatty($stdout));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0EHT4
function name:  (null)
number of ops:  20
compiled vars:  !0 = $stdout
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'fopen'
          1        SEND_VAL                                                 'php%3A%2F%2Fstdout'
          2        SEND_VAL                                                 'wb'
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   17     5        INIT_FCALL                                               'stream_filter_register'
          6        SEND_VAL                                                 'capture'
          7        SEND_VAL                                                 'strtoupper_filter'
          8        DO_ICALL                                                 
   18     9        INIT_FCALL                                               'stream_filter_append'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 'capture'
         12        DO_ICALL                                                 
   19    13        INIT_FCALL                                               'var_export'
         14        INIT_FCALL                                               'stream_isatty'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $5      
         17        SEND_VAR                                                 $5
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class strtoupper_filter:
Function filter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 5
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 5
Branch analysis from position: 22
Branch analysis from position: 5
filename:       /in/0EHT4
function name:  filter
number of ops:  24
compiled vars:  !0 = $in, !1 = $out, !2 = $consumed, !3 = $closing, !4 = $bucket
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    7     4      > JMP                                                      ->17
    8     5    >   INIT_FCALL                                               'strtoupper'
          6        FETCH_OBJ_R                                      ~6      !4, 'data'
          7        SEND_VAL                                                 ~6
          8        DO_ICALL                                         $7      
          9        ASSIGN_OBJ                                               !4, 'data'
         10        OP_DATA                                                  $7
    9    11        FETCH_OBJ_R                                      ~8      !4, 'datalen'
         12        ASSIGN_OP                                     1          !2, ~8
   10    13        INIT_FCALL                                               'stream_bucket_append'
         14        SEND_VAR                                                 !1
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                                 
    7    17    >   INIT_FCALL                                               'stream_bucket_make_writeable'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $11     
         20        ASSIGN                                           ~12     !4, $11
         21      > JMPNZ                                                    ~12, ->5
   12    22    > > RETURN                                                   2
   13    23*     > RETURN                                                   null

End of function filter

End of class strtoupper_filter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.17 ms | 1400 KiB | 29 Q