3v4l.org

run code in 300+ PHP versions simultaneously
<?php class strtoupper_filter extends php_user_filter { 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; } } stream_filter_register("strtoupper", "strtoupper_filter") or die("Failed to register filter"); define('FD', fopen('/dev/null','rw')); stream_filter_append(FD, "strtoupper");
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4iYJC
function name:  (null)
number of ops:  21
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  15     0  E >   INIT_FCALL                                               'stream_filter_register'
         1        SEND_VAL                                                 'strtoupper'
         2        SEND_VAL                                                 'strtoupper_filter'
         3        DO_ICALL                                         $0      
         4      > JMPNZ_EX                                         ~1      $0, ->7
  16     5    > > EXIT                                                     'Failed+to+register+filter'
         6*       BOOL                                             ~1      <true>
  18     7    >   INIT_FCALL                                               'define'
         8        SEND_VAL                                                 'FD'
         9        INIT_FCALL                                               'fopen'
        10        SEND_VAL                                                 '%2Fdev%2Fnull'
        11        SEND_VAL                                                 'rw'
        12        DO_ICALL                                         $2      
        13        SEND_VAR                                                 $2
        14        DO_ICALL                                                 
  19    15        INIT_FCALL                                               'stream_filter_append'
        16        FETCH_CONSTANT                                   ~4      'FD'
        17        SEND_VAL                                                 ~4
        18        SEND_VAL                                                 'strtoupper'
        19        DO_ICALL                                                 
        20      > 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/4iYJC
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
-------------------------------------------------------------------------------------
   4     0  E >   RECV                                             !0      
         1        RECV                                             !1      
         2        RECV                                             !2      
         3        RECV                                             !3      
   6     4      > JMP                                                      ->17
   7     5    >   INIT_FCALL                                               'strtoupper'
         6        FETCH_OBJ_R                                      ~6      !4, 'data'
         7        SEND_VAL                                                 ~6
         8        DO_ICALL                                         $7      
         9        ASSIGN_SUB                                    0          !4, 'data'
        10        OP_DATA                                                  $7
   8    11        FETCH_OBJ_R                                      ~8      !4, 'datalen'
        12        ASSIGN_DIV                                    1          !2, ~8
   9    13        INIT_FCALL                                               'stream_bucket_append'
        14        SEND_VAR                                                 !1
        15        SEND_VAR                                                 !4
        16        DO_ICALL                                                 
   6    17    >   INIT_FCALL                                               'stream_bucket_make_writeable'
        18        SEND_VAR                                                 !0
        19        DO_ICALL                                         $11     
        20        QM_ASSIGN                                        $12     !4
        21      > JMPNZ                                                    $12, ->5
  11    22    > > RETURN                                                   2
  12    23*     > RETURN                                                   null

End of function filter

End of class strtoupper_filter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
11.95 ms | 416 KiB | 7 Q