<?php include_once "Core/Std.php"; $new = new Core_Std; $new->c = 3; $new->sum = function($a, $b) use ($new) { return $a + $b + $new->c; }; $total = $new->sum(1,2); echo $total; // This will print 6 ( 1 + 2 + 3)
info at phpclasses dot org