#44523 [NEW]: trying to add a valuable user note, but can't. Line too long after wordwrap??

From: Date: Mon, 24 Mar 2008 20:42:10 +0000
Subject: #44523 [NEW]: trying to add a valuable user note, but can't. Line too long after wordwrap??
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123582@lists.php.net to get a copy of this message
From:             michel at gopro-tec dot com
Operating system: Vista
PHP version:      4.4.8
PHP Bug Type:     Unknown/Other Function
Bug description:  trying to add a valuable user note, but can't. Line too long after wordwrap??

Description:
------------
Can't post following code-example

Reproduce code:
---------------
Following example takes placeholders formatted like this:
[[name,parameter1,parameter2]] and replaces it with the
 results for function calls: name(parameter1,parameter2).

This enabled me to make websites in a very convenient way.
The @ symbol before the function call surpresses the
 warnings you'd otherwise see on your screen if you'd not 
provide the number of parameters that the function(s) expect.
Let me know what you think. 


<?php

function test($a,$b)
{
  $c=$a*$b;
  if(!$a)$a="NULL";
  if(!$b)$b="NULL";
  return("function <b>test()</b> says if you multiply $a and $b you might
end up with $c");
}

function testtwo($a,$b)
{
  $c=$a." ".$b;
  return("function <b>testtwo()</b> says that: ".$c."!");
}

$template="<html><body>[[test]]<br />[[test,17]]<br
/>[[test,18,3]]<p>[[testtwo,textpad,rocks]]</body></html>";


$template=preg_replace('/\[\[([a-z]+)\,?([0-9a-zA-Z]*)(\,?)([0-9a-zA-Z]*)]]/e','@$1($2
$3 $4)',$template);

print $template;

?>

Expected result:
----------------
post note.

Actual result:
--------------
your text is to long even after wordwrap... ??

-- 
Edit bug report at http://bugs.php.net/?id=44523&edit=1
-- 
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44523&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44523&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44523&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44523&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=44523&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44523&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44523&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44523&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44523&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44523&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=44523&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=44523&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44523&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44523&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44523&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44523&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44523&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44523&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44523&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44523&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#123582) next »