Execute a function before a signal is emitted.
| Parameters: |
|
|---|---|
| Return type: | object \XPSPL\Process |
<?php
xp_signal(XP_SIG('foo'), function(){
echo 'foo';
});
xp_before(XP_SIG('foo'), function(){
echo 'before foo';
});
// results when foo is emitted
The above code will output.
// before foo foo