|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-01-29 12:37 UTC] thomas at pixtur dot de
Description:
------------
The warning only occurs on very few plattforms. I probably could fix it in my code, if I could only understand it's meaning. If you google for the error-message you will find tons of broken pages with the same error but no explanation.
Reproduce code:
---------------
/* NOT reproducable */
class ListBlockColHtml extends ListBlockCol
{
function render_tr(&$obj, $style="") {
if(!isset($obj) || !is_object($obj)) {
trigger_error("ListBlockColHtml->render_tr() called without valid object",E_USER_WARNING);
return;
}
$key= $this->key;
$format= $this->format;
$rest=$this->format;
$style= $this->style
? "class='$this->style'"
: '';
while( ereg("{\?([a-z_]*)}(.*)",$rest, $matches) ) { ### causes error
$key=$matches[1];
$rest=$matches[2];
$value= isset($obj->$key) ? $obj->$key : "??$key";
$format=ereg_replace("{\?$key}",$value,$format);
}
print "<td $style>$format</td>";
}
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 14 02:00:02 2025 UTC |
Thanks vrana@php.net. Good hint. After trying a little bit I discoverd, that writing the regex as... ereg("\{\?([a-z_]*)\}(.*)",$rest, $matches) ... escapting the {} brackets fixes the problem. This also clarifies my problem: {} is the length parameter for the "preceding" match, which does not exists. So this was my fault. It's still strange that different PHP-installations behave differently... thanks for your help