note 99725 added to function.create-function

From: Date: Wed, 01 Sep 2010 16:27:42 +0000
Subject: note 99725 added to function.create-function
Groups: php.notes 
Request: Send a blank email to php-notes+get-172245@lists.php.net to get a copy of this message
Here's the bug-free version, finally!: <? if(!function_exists('ob_lambda_func')){ function ob_lambda_func($method, $args) { if((phpversion()+0)<5.1 || (substr(phpversion(),2)+0)<1.1) die("\nError: This script requires PHP v5.1.1+!\n"); $bt=debug_backtrace(); foreach($bt as $xsp) { if(isset($xsp['object'])) { if(!method_exists($xsp['object'], $method)) continue; return call_user_func_array(array($xsp['object'], $method), $args); } } if(!function_exists($method)) die("\nOB: Internal Error! ($method)"); return call_user_func_array($method, $args); }} if(!function_exists('ob_lambda')){ function ob_lambda($method) { return create_function('','$args=func_get_args(); return ob_lambda_func('.var_export($method, true).',$args);'); }} ?> ---- Server IP: 92.48.74.199 Probable Submitter: 94.7.193.174 ---- Manual Page -- http://www.php.net/manual/en/function.create-function.php Edit -- https://master.php.net/note/edit/99725 Del: integrated -- https://master.php.net/note/delete/99725/integrated Del: useless -- https://master.php.net/note/delete/99725/useless Del: bad code -- https://master.php.net/note/delete/99725/bad+code Del: spam -- https://master.php.net/note/delete/99725/spam Del: non-english -- https://master.php.net/note/delete/99725/non-english Del: in docs -- https://master.php.net/note/delete/99725/in+docs Del: other reasons-- https://master.php.net/note/delete/99725 Reject -- https://master.php.net/note/reject/99725 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#172245) next »