We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

gdonald on 09/27/06


Tagged

function create


Versions (?)


php create function


Published in: PHP 


  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 

You need to login to post a comment.