array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'php-user-filter.oncreate.php', 1 => 'php_user_filter::onCreate', 2 => 'Called when creating the filter', ), 'up' => array ( 0 => 'class.php-user-filter.php', 1 => 'php_user_filter', ), 'prev' => array ( 0 => 'php-user-filter.onclose.php', 1 => 'php_user_filter::onClose', ), 'next' => array ( 0 => 'class.streamwrapper.php', 1 => 'streamWrapper', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/stream/php_user_filter/oncreate.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

php_user_filter::onCreate

(PHP 5, PHP 7, PHP 8)

php_user_filter::onCreateCalled when creating the filter

Опис

public php_user_filter::onCreate(): bool

This method is called during instantiation of the filter class object. If your filter allocates or initializes any other resources (such as a buffer), this is the place to do it.

When your filter is first instantiated, and yourfilter->onCreate() is called, a number of properties will be available as shown in the table below.

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

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Your implementation of this method should return false on failure, or true on success.