PHP Function Reference

PHP php_user_filter onCreate() Method



The PHP php_user_filter::onCreate() method is called when creating the filter. This method is called during instantiation of the filter class object. If the filter allocates or initializes any other resources (such as a buffer), this is the place to do it.

When the filter is first instantiated, and myfilter->onCreate() is called, a number of properties are available as shown in the table below:

PropertyContents
FilterClass->filternameA string containing the name the filter was instantiated with. Filters may be registered under multiple names or under wildcards. This property is used to determine which name was used.
FilterClass->paramsThe contents of the params parameter passed to stream_filter_append() or stream_filter_prepend().
FilterClass->streamThe stream resource being filtered. Maybe available only during filter() calls when the closing parameter is set to false.

Syntax

public php_user_filter::onCreate()

Parameters

No parameter is required.

Return Value

Returns true on success, or false on failure.


❮ PHP Streams Reference