php create function


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. class Obj
  2. {
  3. public $test;
  4.  
  5. function cf()
  6. {
  7. $this->test = create_function( '', 'echo "Testing";' );
  8. }
  9. }
  10.  
  11. $o = new Obj;
  12.  
  13. $o->cf();
  14.  
  15. $o->{$test};

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.