[PHP-DEV] PHP 4.0 Bug #9836: php unexpectedly ends on too long scripts

2001-03-19 Thread jack

From: [EMAIL PROTECTED]
Operating system: linux 2.2.18
PHP version:  4.0.4pl1
PHP Bug Type: Scripting Engine problem
Bug description:  php unexpectedly ends on too long scripts

we have some long computer generated scripts on our system. when we run such a long 
script, php suddenly ends without producing any output and reports exit status 1.

I think php exits while parsing the script.

(I can provide an example of such script on demand)


-- 
Edit Bug report at: http://bugs.php.net/?id=9836&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #9836 Updated: php unexpectedly ends on too long scripts

2001-03-19 Thread jack

ID: 9836
User Update by: [EMAIL PROTECTED]
Status: Bogus
Bug Type: Scripting Engine problem
Description: php unexpectedly ends on too long scripts

I know of time limit, smart guy.

But I don't have it set to 1 sec -- that is approximately the time in which php 
terminates.

(I hope you mark this problem as closed now -- THAT YOU'VE SOLVED IT).

Damn.

Previous Comments:
---

[2001-03-19 11:55:37] [EMAIL PROTECTED]
RTFM:

http://www.php.net/manual/en/function.set-time-limit.php



---

[2001-03-19 08:35:04] [EMAIL PROTECTED]
we have some long computer generated scripts on our system. when we run such a long 
script, php suddenly ends without producing any output and reports exit status 1.

I think php exits while parsing the script.

(I can provide an example of such script on demand)

---


Full Bug description available at: http://bugs.php.net/?id=9836


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #9920: clearing sun_family when binding to AF_UNIX socket

2001-03-22 Thread jack

From: [EMAIL PROTECTED]
Operating system: All
PHP version:  4.0.4pl1
PHP Bug Type: Sockets related
Bug description:  clearing sun_family when binding to AF_UNIX socket

patch is as easy as this:

diff -uNr php-4.0.4pl1/ext/sockets/sockets.c php-4.0.4pl1-patched/ext/sockets/sockets.c
--- php-4.0.4pl1/ext/sockets/sockets.c  Tue Dec 12 18:09:40 2000
+++ php-4.0.4pl1-patched/ext/sockets/sockets.c  Mon Jan 22 14:01:47 2001
@@ -1119,6 +1119,7 @@
if (sock_type->sa_family == AF_UNIX) {
struct sockaddr_un *sa = (struct sockaddr_un *) sock_type;
memset(sa, 0, sizeof(sa_storage)); /* This is safe -> sock_type = 
&sa_storage -> sa = sock_type */
+   sa->sun_family = AF_UNIX;
snprintf(sa->sun_path, 108, "%s", Z_STRVAL_PP(arg1));
ret = bind(Z_LVAL_PP(arg0), (struct sockaddr *) sa, SUN_LEN(sa));
} else if (sock_type->sa_family == AF_INET) {



-- 
Edit Bug report at: http://bugs.php.net/?id=9920&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #9928: Feature rqst: timeout in readline

2001-03-22 Thread jack

From: [EMAIL PROTECTED]
Operating system: All
PHP version:  4.0.4pl1
PHP Bug Type: HTTP related
Bug description:  Feature rqst: timeout in readline

Will timeout ever be added in functions like readline or fopen, fgets etc. ? They can 
work with URL's but you never know how long you'll wait for results.

Thanks


-- 
Edit Bug report at: http://bugs.php.net/?id=9928&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10203: foreach weakness

2001-04-06 Thread jack

From: [EMAIL PROTECTED]
Operating system: all
PHP version:  4.0.4pl1
PHP Bug Type: Scripting Engine problem
Bug description:  foreach weakness

hello

foreach ($array as list($a, $b))
;

won't work. is there any hope this will change in future?


-- 
Edit Bug report at: http://bugs.php.net/?id=10203&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10203 Updated: foreach weakness

2001-04-06 Thread jack

ID: 10203
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: Feature/Change Request
Description: foreach weakness

no, 'list' should assign an array to a list of variables.

$arr = array(array(1, 2), array(3, 4));

foreach ($arr as list($a, $b))
echo "$a $b\n";


Previous Comments:
---

[2001-04-06 07:19:30] [EMAIL PROTECTED]
and what should it do?

i guess you want to have key and value in one step?

this is done by the foreach($array as $key => $value)
construct, does that satisfy your needs?

---

[2001-04-06 06:53:12] [EMAIL PROTECTED]
hello

foreach ($array as list($a, $b))
;

won't work. is there any hope this will change in future?

---


Full Bug description available at: http://bugs.php.net/?id=10203


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10203 Updated: foreach weakness

2001-04-11 Thread jack

ID: 10203
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: Feature/Change Request
Description: foreach weakness

sure, I know I could use this way but I don't find it nice at all.

Previous Comments:
---

[2001-04-06 14:42:55] [EMAIL PROTECTED]
It's for someone else to decide whether to add this to 
the language, but until they do you can achieve the same
effect with:

$arr = array(array(1, 2), array(3, 4)); 
foreach ($arr as $narr) {
list($a, $b) = array_values($narr);
echo "$a, $bn";
}

BTW--it would have helped if you had explained what 
results you were after and not just the syntax you wanted. ;)

---

[2001-04-06 07:54:29] [EMAIL PROTECTED]
no, 'list' should assign an array to a list of variables.

$arr = array(array(1, 2), array(3, 4));

foreach ($arr as list($a, $b))
echo "$a $bn";


---

[2001-04-06 07:19:30] [EMAIL PROTECTED]
and what should it do?

i guess you want to have key and value in one step?

this is done by the foreach($array as $key => $value)
construct, does that satisfy your needs?

---

[2001-04-06 06:53:12] [EMAIL PROTECTED]
hello

foreach ($array as list($a, $b))
;

won't work. is there any hope this will change in future?

---


Full Bug description available at: http://bugs.php.net/?id=10203


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #12277: in PHP4 constructors still seem to behave like in PHP3

2001-07-20 Thread jack

From: [EMAIL PROTECTED]
Operating system: All
PHP version:  4.0.5
PHP Bug Type: Class/Object related
Bug description:  in PHP4 constructors still seem to behave like in PHP3

the following code:
\n";
}
}

class B extends A {
function C() {
echo "I am a regular function C.\n";
}
}

class C extends B {
}

$b = new C();
?> 
in PHP 4.0.5 prints:
I am a regular function C.

is this correct?


-- 
Edit bug report at: http://bugs.php.net/?id=12277&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #12316: Have to increase memory_limit to be able to upload big files

2001-07-23 Thread jack

From: [EMAIL PROTECTED]
Operating system: Linux
PHP version:  4.0.5
PHP Bug Type: Feature/Change Request
Bug description:  Have to increase memory_limit to be able to upload big files

If you want to use file upload, you have to correctly set upload_max_size
and post_max_size. That's o.k. But you also have to set memory_limit and
max_execution_time to values high enough.

The former seems to be result of very poor design (I admit I haven't
checked the source code closely but as far as I can tell from a quick look
at main/rfc1867.c, the whole form is first read and stored in memory and
only then parsed and divided into files instead of being parsed on the
run).

I am not sure about the second issue since I don't know how exactly
max_exec*_time works. Is it counted from the very start of request or from
the moment script starts being executed? (that is -- if I set
max_execution_time to 30 secs and the upload takes 55 secs, will PHP die?
or will the upload finish and script will get 30secs to run?). I know I can
get around this limit -- I just wonder.
-- 
Edit bug report at: http://bugs.php.net/?id=12316&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #12596: Definition of array using constants in array doesn't work

2001-08-06 Thread jack

From: [EMAIL PROTECTED]
Operating system: Linux
PHP version:  4.0.5
PHP Bug Type: Class/Object related
Bug description:  Definition of array using constants in array doesn't work

The following piece of code doesn't work:

 10);
}

$b = new B();
var_dump($b);
?>

It produces:

object(b)(1) {
  ["a"]=>
  array(1) {
["A"]=>
int(10)
  }
}

which is unexpected (at least for me).
-- 
Edit bug report at: http://bugs.php.net/?id=12596&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #10203 Updated: foreach weakness

2002-01-29 Thread jack

ID: 10203
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Status: Closed
Status: Open
Bug Type: Feature/Change Request
Operating System: all
PHP Version: 4.0.4pl1
New Comment:

you haven't read the previous posts, have you?

I think it's a general problem with list() construct, that you cannot
use it everywhere you can use an L-value (or however you guys call it
in PHP)


Previous Comments:


[2002-01-28 20:45:41] [EMAIL PROTECTED]

foreach ($arr as $key => $val)




[2001-04-11 11:17:31] [EMAIL PROTECTED]

sure, I know I could use this way but I don't find it nice at all.



[2001-04-06 14:42:55] [EMAIL PROTECTED]

It's for someone else to decide whether to add this to 
the language, but until they do you can achieve the same
effect with:

$arr = array(array(1, 2), array(3, 4)); 
foreach ($arr as $narr) {
list($a, $b) = array_values($narr);
echo "$a, $b\n";
}

BTW--it would have helped if you had explained what 
results you were after and not just the syntax you wanted. ;)



[2001-04-06 07:54:29] [EMAIL PROTECTED]

no, 'list' should assign an array to a list of variables.

$arr = array(array(1, 2), array(3, 4));

foreach ($arr as list($a, $b))
echo "$a $b\n";




[2001-04-06 07:19:30] [EMAIL PROTECTED]

and what should it do?

i guess you want to have key and value in one step?

this is done by the foreach($array as $key => $value)
construct, does that satisfy your needs?



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/?id=10203


Edit this bug report at http://bugs.php.net/?id=10203&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #9836 Updated: php unexpectedly ends on too long scripts

2001-08-07 Thread jack

ID: 9836
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: Scripting Engine problem
Old Operating System: linux 2.2.18
Operating System: linux
Old PHP Version: 4.0.4pl1
PHP Version: 4.0.5
New Comment:

so it has happened again.

I again offer to provide the script so that you can see where the problem is.  I won't 
paste it here because it has 730K.

The script cannot really run because it is supposed to have many includes and it 
itself should be included by other script -- but it should fail with some reason (like 
unknown function).

Instead it just dies with return code 1.

Previous Comments:


[2001-05-10 05:57:58] [EMAIL PROTECTED]

No feedback. If problem exists with PHP 4.0.5, reopen.




[2001-04-19 09:35:10] [EMAIL PROTECTED]

Does this happen with latest CVS from http://snaps.php.net/ ?

--Jani




[2001-03-19 13:57:54] [EMAIL PROTECTED]

With that limited information you gave in the first
comments I couldn't know that.

Ok, so it doesn't crash? Just stops?
Computer generated scripts? How big?
And what do they do? 

Could you check that it doesn't crash, ie. run the php
script which 'ends' within gdb:

# gdb php
(gdb) run -f thisscriptendstoosoon.php

--Jani




[2001-03-19 12:13:53] [EMAIL PROTECTED]

I know of time limit, smart guy.

But I don't have it set to 1 sec -- that is approximately the time in which php 
terminates.

(I hope you mark this problem as closed now -- THAT YOU'VE SOLVED IT).

Damn.



[2001-03-19 11:55:37] [EMAIL PROTECTED]

RTFM:

http://www.php.net/manual/en/function.set-time-limit.php





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/?id=9836


Edit this bug report at http://bugs.php.net/?id=9836&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #13138: constants behave weird in static hash arrays

2001-09-04 Thread jack

From: [EMAIL PROTECTED]
Operating system: linux
PHP version:  4.0.4pl1
PHP Bug Type: Scripting Engine problem
Bug description:  constants behave weird in static hash arrays

I think the following piece of code behaves sort of weird:

 true);
static $stat_a = array(A => true);

var_dump($a);
var_dump($stat_a);
}
test();
?>

result is:
array(1) {
  [1]=>
  bool(true)
}
array(1) {
  ["A"]=>
  bool(true)
}

I'm not sure whether static variables are supposed to evaluate expressions
but even if they were not, the engine should at least issue a warning.

-- 
Edit bug report at: http://bugs.php.net/?id=13138&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10134: Using Zend Optimiser: including by URL fails

2001-04-03 Thread bobby . jack

From: [EMAIL PROTECTED]
Operating system: sparc-sun-solaris2.6
PHP version:  4.0.4pl1
PHP Bug Type: Reproduceable crash
Bug description:  Using Zend Optimiser: including by URL fails

Zend Optimiser version 1.0.0 is installed.

PHP running on Apache-1.3.19

Including a file with an absolute reference to a URL fails to load the file completely 
- only part of the file loads resulting in incomplete HTML source.

Example: 
--
http://www.example.com/foo.php";
?>
--

Example code attempting to be included:
--
Hello World
--

Example of PHP output (HTML source) when including this file:
--
TABL
--

As you can see, only a small portion of the file is actually included.

Removing the optimiser from our PHP install solves the problem; the file is included 
correctly.

This bug should be very easy to reproduce using the setup described here.

allow_url_open has been set to 1.

Please advise on either a workaround or when this bug is likely to be fixed; we are 
developing an intranet using PHP and this bug is quite an inconvenience.

Thanks,
- Bobby.



-- 
Edit Bug report at: http://bugs.php.net/?id=10134&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10141: $HTTP_USER_AGENT 'breaks' in a URL-included file

2001-04-03 Thread bobby . jack

From: [EMAIL PROTECTED]
Operating system: sparc-sun-solaris2.6
PHP version:  4.0.4pl1
PHP Bug Type: Reproduceable crash
Bug description:  $HTTP_USER_AGENT 'breaks' in a URL-included file

$HTTP_USER_AGENT reports an unexpected value when inlcuded via a URL-reference:

e.g. 

test1.php
--

--

test2.php
--
http://servername.com/test1.php"; ?>
--

http://servername.com/test1.php displays (example):
  Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)

http://servername.com/test2.php displays:
  PHP/4.0.4pl1

I can understand why this happens: when including a URL-referenced file, PHP obviously 
acts as the HOST that makes the request. However, is there a workaround for this?

- Bobby.


-- 
Edit Bug report at: http://bugs.php.net/?id=10141&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10142: $HTTP_USER_AGENT 'breaks' in a URL-included file

2001-04-03 Thread bobby . jack

From: [EMAIL PROTECTED]
Operating system: sparc-sun-solaris2.6
PHP version:  4.0.4pl1
PHP Bug Type: Reproduceable crash
Bug description:  $HTTP_USER_AGENT 'breaks' in a URL-included file

$HTTP_USER_AGENT reports an unexpected value when inlcuded via a URL-reference:

e.g. 

test1.php
--

--

test2.php
--
http://servername.com/test1.php"; ?>
--

http://servername.com/test1.php displays (example):
  Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)

http://servername.com/test2.php displays:
  PHP/4.0.4pl1

I can understand why this happens: when including a URL-referenced file, PHP obviously 
acts as the HOST that makes the request. However, is there a workaround for this?

- Bobby.


-- 
Edit Bug report at: http://bugs.php.net/?id=10142&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #10142 Updated: $HTTP_USER_AGENT 'breaks' in a URL-included file

2001-04-03 Thread bobby . jack

ID: 10142
User Update by: [EMAIL PROTECTED]
Old-Status: Open
Status: Duplicate
Bug Type: Reproduceable crash
Description: $HTTP_USER_AGENT 'breaks' in a URL-included file



Previous Comments:
---

[2001-04-03 12:30:47] [EMAIL PROTECTED]
$HTTP_USER_AGENT reports an unexpected value when inlcuded via a URL-reference:

e.g. 

test1.php
--

--

test2.php
--
http://servername.com/test1.php"; ?>
--

http://servername.com/test1.php displays (example):
  Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)

http://servername.com/test2.php displays:
  PHP/4.0.4pl1

I can understand why this happens: when including a URL-referenced file, PHP obviously 
acts as the HOST that makes the request. However, is there a workaround for this?

- Bobby.

---


Full Bug description available at: http://bugs.php.net/?id=10142


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] function similar to get_html_translation_table

2001-07-19 Thread Jack Dempsey

Hi there,

I've recently had a need for a function that can translate html code
such as  and œ, etc...I've found the trick of flipping the
resulting array from get_html_translation_table and using strtr to
translate characters, but I've found nothing to deal with these other
html quantities. I know I could make a big array myself and make my own
function, but it seems to me that something like this would be useful
for others as well. 
Has anything like this been considered? Is it possible to write code for
it and see if others find it useful?
Any help and thoughts are much appreciated.

Jack Dempsey

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] RE: [PHP] New feature suggestion: array in string substitution

2001-08-29 Thread Jack Dempsey

have you looked at the eval function? it will let you do something similar:

$string = 'this is a $variable';

$variable = 'template';

eval("\$string = $string");

echo $string; -> this is a template

(haven't checked it, but syntax should be ok)

jack

-Original Message-
From: --- [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 29, 2001 9:53 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] New feature suggestion: array in string substitution


The feature i suggest for inclusion in the php core is described below,
especially in my first post.
I think that is a really good idea and i ask you to spend a moment and
read my suggestion.

If you think that this feature could be useful, reply to this message and
say that you agree
(don't repeat all the text written below, i don't want to overload the news
server)

(my english is not very good, i'm sorry:)

--
Federico Marani ([EMAIL PROTECTED])
--

MY OLD POSTS:
THE FIRST
I have seen that in php there isn't nothing similar to dictionary
substitution in python.
(a dictionary is an array with string keys, like hash in perl)

This change consist in adding two functions ("a" stay for "array"):
aprintf(string format, array dict) -- like printf, print the result
saprintf(string format, array dict) -- like sprintf, return the result

It works like this (written in php-like language):

format -> "my name is %(name)s and i'm %(age)s"
dict -> array( name=>"tom", age=> "eighteen" );

(in php, unlike python, is possible to make an array with both string and
number indices, so the format can be also %(2)s,...)

aprintf(format,dict) -- print "my name is tom and i'm eighteen"
saprintf(format,dict) -- return "my name is tom and i'm eighteen"

in python, these substitutions are very useful, especially in cgi
programming, for making templates from text files, in php could be
useful in, for example, language customisation, or message formatting,
etc...

An example:
if ($lang == "it")
  define("MESSAGE","il %(animal)s %(color)s sta %(action)s %(target)s");
else
  define("MESSAGE","the %(color)s %(animal)s is %(action)s");

aprintf(MESSAGE,array(animal=>"cobra",color=>"green",action=>"eating",target
=>"mouse"));
// if the %(target)s isn't found, is ignored.


(the "s" terminator could be substituted with other letters, like d for
numbers, etc...)

This approach has several advantages over something like this:
"the $color $animal is $action"
because in this phrase, variables are substituted when the parser execute
it, and in this case:
"the %(color)s %(animal)s is %(action)s"
parameters are substituted only when the phrase is parsed with a specialized
function like aprintf


I think that this is a good idea and could save a lot of time when the
program need to be as modular as possible.


Federico Marani
[EMAIL PROTECTED]

---END FIRST POST---

---THE SECOND POST---
Yes, the function you have written below make the same thing but i think
that a function written in c, inside the php module, can be faster and more
elegant than this php-function.

Again, i think that the final user will be happy to have an already written
function
instead of think and code a personalized function.

I think it's more elegant because it follow the same approach of printf-like
functions
and a user who already known these functions or known python will not have
headaches
in finding a solution for his problem

Also prinf, sprinf, etc... can be written as php functions and separated
from php core, but it will not happen... why? too important and too useful,
they requires speed
and their functionality
is required in many programs.

The same thing happen in python with dictionary substitution, and now,
nobody think to remove
it.

I think that this type of function could be useful for a lot of people...

Let me know what do you (also zeev and others) think about

-
Federico Marani
[EMAIL PROTECTED]
--

Jo Giraerts <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]
> This is already possible in php, though with the following simple
> function..
>
>// function to read a file with php-vars in as a string
>// $predefined_vars: an array ("varname" => "value"). all the
>// variablenames defined in this array can be used in the bodyfile.
>// They will receive the respective values. This makes personalising
>// the mailes easier..
>function file_as_body($filename, $predefined_vars)
>{
>   $ar = file($filename);
>

[PHP-DEV] CVS Account Request: ef651100

2002-06-11 Thread Jack Lam

Help the translation of PHP Manuel.

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php