PHP Classes

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: Update of examples/onAfter/round.php
Date: 3 months 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);