Since: 8.0

class Pure (View source)

The attribute marks the function that has no impact on the program state or passed parameters used after the function execution.

This means that a function call that resolves to such a function can be safely removed if the execution result is not used in code afterwards.

Methods

__construct(bool $mayDependOnGlobalScope = false)

No description

Details

__construct(bool $mayDependOnGlobalScope = false)

No description

Parameters

bool $mayDependOnGlobalScope

Whether the function result may be dependendent on anything except passed variables