View Single Post
Old 09-12-2010, 08:45 AM  
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
Quote:
Originally Posted by borked View Post
can't help really as I'm on 5.2.x, so all this isn't available, but according to http://php.net/manual/en/migration53.incompatible.php


goto http://php.net/manual/en/function.call-user-func.php
scroll down to user comment by
chris at NOSPAM dot panospheric dot com
23-Sep-2007 02:37

this looks like what you are trying to do?

hope it helps
Close but it's not quite it. The problem am having is more when I declare the dynamic function then when I call it.

Ultimately what I would like to do is something like this :
Quote:
$code = 'print ($f->msg);';
$f->bar = function () use($f) { $code };
So the code of the function to be would be contain is $code as a string. But of course this returns an error...
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote