File: examples/onAfter/round.php

Recommend this page to a friend!
  Classes of Nicola Covolo  >  Decorate  >  examples/onAfter/round.php  >  Download  
File: examples/onAfter/round.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Decorate
Alter functions running code before and after
Author: By
Last change:
Date: 6 years ago
Size: 225 bytes
 

Contents

Class file image Download
<?php

require "../../Decorate.php";

$operation = function ($a, $b)
{
    return
$a * $b;
}
;

$round = function ($a)
{
    return
round($a);
}
;

$operation = Decorate::onAfter($operation, $round);
echo
$operation(3, 5.2);


For more information send a message to info at phpclasses dot org.