bubu Posted April 6, 2008 Report Share Posted April 6, 2008 Bah, tu nesaprati, ko marrtins saka. Viņš tev saka šādi: class Size { private $width; private $height; public __construct($w, $h) { $this->width = $w; $this->height = $h; } public function blah($capture) { return checkimgsize2($this->w, $this->h, $capture); } } preg_replace_callback('/(\[img\])(.+?)(\[\/img\])/i', array(new Size(550, 880), 'blah'), $data); Vai arī lieto to manis doto curry veidu. Link to comment Share on other sites More sharing options...
DMG Posted April 7, 2008 Author Report Share Posted April 7, 2008 Bubu man tak viss tagad sk un es neko nesūdzos ;) Es iepriekš tikai martinam paskaidroju domu vēl reiz un pajautāju tev vai nevēlies paskaidrot kas notiek tava koda "curry($func)" funkcijā :) Bet ja nevēlies, tad viss ok un thanks par visu. Link to comment Share on other sites More sharing options...
bubu Posted April 7, 2008 Report Share Posted April 7, 2008 Izlasi tai linkā aprakstu. Curry atgriež funkciju objektu, kuram pirmie N argumenti tiks padoti ar fiksētām vērtībam - tām, kas tika padotas curry funkcijai. Link to comment Share on other sites More sharing options...
Recommended Posts