[PHP] Re: Bug?

2011-09-15 Thread Igor Escobar
Thank you guys.


Regards,
Igor Escobar
*Software Engineer
*
+ http://blog.igorescobar.com
+ http://www.igorescobar.com
+ @igorescobar 





On Thu, Sep 15, 2011 at 6:32 PM, Shawn McKenzie wrote:

> On 09/15/2011 04:07 PM, Igor Escobar wrote:
> > Anyone can explain this?
> >
> > https://gist.github.com/1220404
> >
> > Part of the code are in portuguese so...
> > iguais = equal
> > diferentes = different
> >
> > Regards,
> > Igor Escobar
> > *Software Engineer
> > *
> > + http://blog.igorescobar.com
> > + http://www.igorescobar.com
> > + @igorescobar 
> >
>
> 1. Obviously because of the issues with floating point precision these
> are stored as the same float, a la your next example.
>
> 2. Using bc math for binary calculations on string representations of a
> number overcomes the problems in 1.
>
> 3. This one is peculiar, but it seems that since they are numeric
> strings that they are being juggled to float for the comparison since
> using == there is no type checking.  Using === yields a different
> result, presumably because forcing a type check compares them as
> strings.  Use strcmp() to overcome this.
>
> 4. Do I need to explain this one?
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>


[PHP] Re: Bug?

2011-09-15 Thread Shawn McKenzie
On 09/15/2011 04:07 PM, Igor Escobar wrote:
> Anyone can explain this?
> 
> https://gist.github.com/1220404
> 
> Part of the code are in portuguese so...
> iguais = equal
> diferentes = different
> 
> Regards,
> Igor Escobar
> *Software Engineer
> *
> + http://blog.igorescobar.com
> + http://www.igorescobar.com
> + @igorescobar 
> 

1. Obviously because of the issues with floating point precision these
are stored as the same float, a la your next example.

2. Using bc math for binary calculations on string representations of a
number overcomes the problems in 1.

3. This one is peculiar, but it seems that since they are numeric
strings that they are being juggled to float for the comparison since
using == there is no type checking.  Using === yields a different
result, presumably because forcing a type check compares them as
strings.  Use strcmp() to overcome this.

4. Do I need to explain this one?

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Re: Bug #51739 tricky string to float conversion

2011-09-01 Thread magic-php
Am Mittwoch, 31. August 2011, 20:48:37 schrieb Shawn McKenzie:
> On 08/31/2011 09:03 AM, magic-...@damage.devloop.de wrote:
> > Hi,
> > I have opend Bug #51739 in 2010. It was closed as bogus before my last
> > question was answered. It would be fine to know what you think about
> > that bug.
> > In short:
> > var_dump((float)"8315e839da08e2a7afe6dd12ec58245d");
> > results in float(INF)
> > This is because "8315" is treated as base and
> > "e839da08e2a7afe6dd12ec58245d" is treated as an exponent. My hint that
> > "e839da08e2a7afe6dd12ec58245d" is not a valid exponent was not answered.
> > What do you think about?
> > cheers
> > Daniel
> 
> The cast to float is truncating the invalid characters and since your
> string contains a float that is INF (8315e839) before the truncation at
> the "d", then it returns INF.  Makes perfect sense.

This is what drives me crazy.

If I use a string in PHP I don't want PHP to cut this string. Either it uses 
this string as it is or it gives me an error/warning/false (what ever...). But 
silently(!!!) using a small piece of a string is not understandable.

cheers
Daniel

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



[PHP] Re: Bug #51739 tricky string to float conversion

2011-08-31 Thread Shawn McKenzie
On 08/31/2011 01:48 PM, Shawn McKenzie wrote:
> 
> The cast to float is truncating the invalid characters and since your
> string contains a float that is INF (8315e839) before the truncation at
> the "d", then it returns INF.  Makes perfect sense.
> 

Just FYI...  Don't post your troubles or misunderstandings as bug
reports.  The PHP developers sift through too many reports as it is and
many or maybe the majority are "support" tickets like yours that are not
"bugs".  The people assigned to bugs are not going to explain why your
issue is not a bug in detail.  They are tasked with fixing bugs, and
they have many bug reports (mostly like yours).  The appropriate place
for you to post would be here on this list first.  If the consensus of
the veteran folks on this list is "wow, that's a bug" or some such, then
we will tell you to post a bug report.

-- 
Thanks!
-Shawn
http://www.spidean.com

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



[PHP] Re: Bug #51739 tricky string to float conversion

2011-08-31 Thread Shawn McKenzie
On 08/31/2011 09:03 AM, magic-...@damage.devloop.de wrote:
> Hi,
> I have opend Bug #51739 in 2010. It was closed as bogus before my last
> question was answered. It would be fine to know what you think about
> that bug.
> In short:
> var_dump((float)"8315e839da08e2a7afe6dd12ec58245d");
> results in float(INF)
> This is because "8315" is treated as base and
> "e839da08e2a7afe6dd12ec58245d" is treated as an exponent. My hint that
> "e839da08e2a7afe6dd12ec58245d" is not a valid exponent was not answered.
> What do you think about?
> cheers
> Daniel

The cast to float is truncating the invalid characters and since your
string contains a float that is INF (8315e839) before the truncation at
the "d", then it returns INF.  Makes perfect sense.

-- 
Thanks!
-Shawn
http://www.spidean.com

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



[PHP] Re: Bug in array_key_exist?

2008-08-26 Thread Korgan

Error reporting is set on E_ALL

notice: it change value if I add the item which isnt in array

Lupus Michaelis wrote:

Korgan a écrit :


public function addXXX($id, $count)
{
   $count = (int)$cout;


  Try to work with error_reporting set to E_ALL ;)



 session_start();
 var_dump($_SESSION['XX']); /** A **/


  If XX is a right value for a variable name, they are no problem.



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



[PHP] Re: Bug in array_key_exist?

2008-08-26 Thread Lupus Michaelis

Korgan a écrit :


public function addXXX($id, $count)
{
   $count = (int)$cout;


  Try to work with error_reporting set to E_ALL ;)



 session_start();
 var_dump($_SESSION['XX']); /** A **/


  If XX is a right value for a variable name, they are no problem.

--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org

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



[PHP] Re: Bug in stream_socket_server()?

2007-12-11 Thread Nathan Rixham

Would this class as a test?

\n";
} else {
while (is_resource($conn = stream_socket_accept($socket, 30))) {
while (is_resource($conn) && $pkt = stream_get_line($conn, 100, "\n")) {
fwrite($conn, '');
sleep(10);
echo $pkt;
}
}
}
?>

I then sent 2*384kb loads per second through a terminal to it without 
problems, 10 minutes since i stopped writing data to it and it's still 
echoing out 1 line every 10 secs!


Nathan

René Fournier wrote:
"If you want a high speed socket server, use the low-level sockets 
instead (socket_create/bind/listen). The stream_socket_server version 
appears to have internal fixed 8k buffers that will overflow if you 
don't keep up by reading.


This is a serious problem if you an application that reads the socket 
for messages and then, say, saves the result in a database. The delay 
while it is busy processing means you can't read the data in time unless 
you get involved in muti-threading.


With the the low-level functions, the OS quietly buffers TCP/IP packets 
so there is no problem (tested on Windows XP Professional)."


( 
http://php.oregonstate.edu/manual/en/function.stream-socket-server.php#67837 
)



Has anyone confirmed this? I am doing tests with a stripped-down 
multi-client socket server, wonder if this issue is causing some of the 
problems I've seen.


...Rene


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



[PHP] Re: Bug in == comparison?

2006-07-21 Thread Jeffrey Sambells

hrm..

It just seemed strange as the script I was working on is 3 years old  
and had worked flawlessly until today.


Thanks.

- Jeff

~~
Jeffrey Sambells
Director of Research and Development
Zend Certified Engineer (ZCE)

We-Create Inc.
[EMAIL PROTECTED] email
519.745.7374 x103 office
519.897.2552 mobile

~~
Get Mozilla Firefox at
http://spreadfirefox.com

On 21-Jul-06, at 12:45 PM, Adam Zey wrote:


Jeffrey Sambells wrote:

OK I have a very strange bug:
In the middle of my script I have these two lines:
var_dump($test,$test2);
echo "'$test'=='$test2' is ".($test==$test2);
which is giving:
int(0) string(6) "Points"
'0'=='Points' is 1
I understand that PHP is loose typed and automatically does type  
conversion but in the many years I've been using PHP (mostly v4)  
the comparison had always converted to 'string' and in the case  
above returned FALSE, not TRUE. It seems here they are comparing  
as integers thus 'Points' evaluates to 0 and the comparison is TRUE.
I tried comparing in the  reverse sequence ($test2==$test) and the  
same occurred. It does work as expected if I have === but the rest  
of the scirpt isn't type sensitive so I want NULL, 0, and empty  
string to still maintain equality.
Any ideas why this is suddenly happening? I'm using PHP 5.1, and I  
realize I could use other functions such as strval() in the  
comparison however I've used similar logic in the past without  
problems.

Any help would be great.
Thanks
Jeff


No, the opposite is true; strings are always converted to integers  
in such comparisons, as stated in TFM:


http://www.php.net/manual/en/language.operators.comparison.php

I'll quote it here:

"If you compare an integer with a string, the string is converted  
to a number. If you compare two numerical strings, they are  
compared as integers. These rules also apply to the switch statement."


In your case, it's a bug in your code; you should be using === to  
also verify type, or casting $var1 to a string in your comparison.


Regards, Adam Zey.


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



[PHP] Re: Bug in == comparison?

2006-07-21 Thread Adam Zey

Jeffrey Sambells wrote:

hrm..

It just seemed strange as the script I was working on is 3 years old 
and had worked flawlessly until today.


Thanks.

- Jeff

~~
Jeffrey Sambells
Director of Research and Development
Zend Certified Engineer (ZCE)

We-Create Inc.
[EMAIL PROTECTED] email
519.745.7374 x103 office
519.897.2552 mobile

~~
Get Mozilla Firefox at
http://spreadfirefox.com

On 21-Jul-06, at 12:45 PM, Adam Zey wrote:


Jeffrey Sambells wrote:

OK I have a very strange bug:
In the middle of my script I have these two lines:
var_dump($test,$test2);
echo "'$test'=='$test2' is ".($test==$test2);
which is giving:
int(0) string(6) "Points"
'0'=='Points' is 1
I understand that PHP is loose typed and automatically does type 
conversion but in the many years I've been using PHP (mostly v4) the 
comparison had always converted to 'string' and in the case above 
returned FALSE, not TRUE. It seems here they are comparing as 
integers thus 'Points' evaluates to 0 and the comparison is TRUE.
I tried comparing in the  reverse sequence ($test2==$test) and the 
same occurred. It does work as expected if I have === but the rest 
of the scirpt isn't type sensitive so I want NULL, 0, and empty 
string to still maintain equality.
Any ideas why this is suddenly happening? I'm using PHP 5.1, and I 
realize I could use other functions such as strval() in the 
comparison however I've used similar logic in the past without 
problems.

Any help would be great.
Thanks
Jeff


No, the opposite is true; strings are always converted to integers in 
such comparisons, as stated in TFM:


http://www.php.net/manual/en/language.operators.comparison.php

I'll quote it here:

"If you compare an integer with a string, the string is converted to 
a number. If you compare two numerical strings, they are compared as 
integers. These rules also apply to the switch statement."


In your case, it's a bug in your code; you should be using === to 
also verify type, or casting $var1 to a string in your comparison.


Regards, Adam Zey.


Since my other reply might have been overlooked as a double-reply, it 
bears repeating here; the empty() function is designed to do what you 
want (check empty strings, int(0), null, etc).


Regards, Adam.

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



[PHP] Re: Bug in == comparison?

2006-07-21 Thread Adam Zey


I tried comparing in the  reverse sequence ($test2==$test) and the same 
occurred. It does work as expected if I have === but the rest of the 
scirpt isn't type sensitive so I want NULL, 0, and empty string to still 
maintain equality.


Wups, I missed the last part there. You want the empty() function:

http://www.php.net/manual/en/function.empty.php

It can do exactly what you want.

Regards, Adam.

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



[PHP] Re: Bug in == comparison?

2006-07-21 Thread Adam Zey

Jeffrey Sambells wrote:


OK I have a very strange bug:

In the middle of my script I have these two lines:

var_dump($test,$test2);
echo "'$test'=='$test2' is ".($test==$test2);

which is giving:

int(0) string(6) "Points"
'0'=='Points' is 1

I understand that PHP is loose typed and automatically does type 
conversion but in the many years I've been using PHP (mostly v4) the 
comparison had always converted to 'string' and in the case above 
returned FALSE, not TRUE. It seems here they are comparing as integers 
thus 'Points' evaluates to 0 and the comparison is TRUE.


I tried comparing in the  reverse sequence ($test2==$test) and the same 
occurred. It does work as expected if I have === but the rest of the 
scirpt isn't type sensitive so I want NULL, 0, and empty string to still 
maintain equality.


Any ideas why this is suddenly happening? I'm using PHP 5.1, and I 
realize I could use other functions such as strval() in the comparison 
however I've used similar logic in the past without problems.


Any help would be great.

Thanks

Jeff


No, the opposite is true; strings are always converted to integers in 
such comparisons, as stated in TFM:


http://www.php.net/manual/en/language.operators.comparison.php

I'll quote it here:

"If you compare an integer with a string, the string is converted to a 
number. If you compare two numerical strings, they are compared as 
integers. These rules also apply to the switch statement."


In your case, it's a bug in your code; you should be using === to also 
verify type, or casting $var1 to a string in your comparison.


Regards, Adam Zey.

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



Re: [PHP] Re: Bug in XMLWriter?

2006-05-19 Thread Rob Richards

D. Dante Lorenso wrote:

Rob Richards wrote:

Expected behavior. See comments within code snippet.

D. Dante Lorenso wrote:
I am using XMLWriter with PHP 5.1.4 and find that it doesn't behave 
as I expect.  I am under the impressing that until I call 
'endElement', I should be free to continue adding attributes to an 
opened element regardless of whether I have already added elements 
or text below it. Look at this sample code:


openMemory();

// start new element and add 1 attribute
$XML->startElement("a");
$XML->writeAttribute("href", "http://www.google.com";);

// add a text node
$XML->text("Google");

Here you just closed the starting element tag and moved into content.


So adding a text node closes the starting tag?  That shouldn't happen.

Uhm, so where's the text supposed to go?


Seems to me that this is non-intuitive.  I would expect that until I 
call 'endElement' that the node is still constructible.  Internally it 
should work something like DOM where the node is not 'serialized' to 
xml tag form until the endElement is called.  That way, attributes 
could still be defined even after 'text' nodes were appended.


You are missing the point of xmlWriter. It should happen. It provides a 
forward only, non-cached means of writing to a stream. There are no 
"nodes" or "trees" here. Calling endElement simply instructs the writer 
to close any open content or attributes and finally the currently opened 
element.


For your example code, just write all attributes prior to adding any 
element content; otherwise you really want a tree based API like DOM or 
SimpleXML where you can move backwards.


In any case, the behavior will not change. The behavior is defined in 
the XMLTextWriter class in C#, from which XMLWriter is based on.


Rob

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



Re: [PHP] Re: Bug in XMLWriter?

2006-05-19 Thread D. Dante Lorenso

Rob Richards wrote:

Expected behavior. See comments within code snippet.

D. Dante Lorenso wrote:
I am using XMLWriter with PHP 5.1.4 and find that it doesn't behave 
as I expect.  I am under the impressing that until I call 
'endElement', I should be free to continue adding attributes to an 
opened element regardless of whether I have already added elements or 
text below it. Look at this sample code:


openMemory();

// start new element and add 1 attribute
$XML->startElement("a");
$XML->writeAttribute("href", "http://www.google.com";);

// add a text node
$XML->text("Google");

Here you just closed the starting element tag and moved into content.


So adding a text node closes the starting tag?  That shouldn't happen.

Seems to me that this is non-intuitive.  I would expect that until I 
call 'endElement' that the node is still constructible.  Internally it 
should work something like DOM where the node is not 'serialized' to xml 
tag form until the endElement is called.  That way, attributes could 
still be defined even after 'text' nodes were appended.

// add another attribute (DOES NOT WORK)
$XML->writeAttribute("target", "_blank");

If you check the return value (FALSE), you will see it failed.
The writer is positioned within element content so cannot write an 
attribute. Attributes must be written while still positioned within 
the element's start tag.


If you look at XML as a tree, despite delving deeper into the tree 
(adding text node), as I walk back up, I should be positioned back on 
the element I opened with 'startElement'.  Turning the node into a 
string should not occur until the leaf nodes are closed.


I understand slightly more memory will be consumed the way I define it, 
but the object would certainly be more useful.  In the way I extend 
XMLWriter, I have a method like this:


startElement(array_shift($args));
  
   // we have a text node

   if (count($args) % 2) {
   $this->text(array_pop($args));
   }

   // add attributes
   for ($i = 0; $i < count($args); $i += 2) {
   $this->attr($args[$i], $args[$i +1]);
   }
}

//
...
}
?>

The way this works is as follows:

   * first argument is the tag name
   * last argument (if present and even number of arguments) is the
 text value inside the node
   * middle arguments are attribute = attribute_value pairs of 2

After this node is created, I still want to use $X->attr() to set more 
attributes.


push("a", "href", "http://www.php.net";, "Click Here");
if ($want_new_window) {
   $X->attr("target", "_blank");
}
print $X->to_string();
?>

I have an object like this already written on top of DOM, but found 
XMLWriter to be more attractive because of better memory utilization.  
But still, 'endElement' doesn't do what it sounds like it does if the 
element is closed long before it gets called.


Is it possible to change this behavior?

Dante


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



[PHP] Re: Bug in XMLWriter?

2006-05-19 Thread Rob Richards

Expected behavior. See comments within code snippet.

D. Dante Lorenso wrote:
I am using XMLWriter with PHP 5.1.4 and find that it doesn't behave as I 
expect.  I am under the impressing that until I call 'endElement', I 
should be free to continue adding attributes to an opened element 
regardless of whether I have already added elements or text below it. 
Look at this sample code:


openMemory();

// start new element and add 1 attribute
$XML->startElement("a");
$XML->writeAttribute("href", "http://www.google.com";);

// add a text node
$XML->text("Google");


Here you just closed the starting element tag and moved into content.



// add another attribute (DOES NOT WORK)
$XML->writeAttribute("target", "_blank");


If you check the return value (FALSE), you will see it failed.
The writer is positioned within element content so cannot write an 
attribute. Attributes must be written while still positioned within the 
element's start tag.


Rob

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



Re: [PHP] Re: Bug, erreurs ou non =?iso-8859-1?q?document=E9?=

2005-05-08 Thread Andy Pieters
On Wednesday 04 May 2005 22:47, Amir Mohammad Saied wrote:
Bonjour Amir

C'est liste est en Anglais.

Cependant, la réponse:

Il est necessaire de 'eschapper' le character '\' 
 
Au lieux d'ecrire '\', il faut ecrire '\\'

Donc si le chemin est

\\srvdfs00\partages\0-50\M7\05_APValidation\Forfait_Entreprise

Il faut le changer en 

srvdfs00\\partages\\0-50\\M7\\05_APValidation\\Forfait_Entreprise

Svp, repondéz en ANGLAIS


> [EMAIL PROTECTED] wrote:
> > Bonjour,
> >
> > J'utilise php en profondeur depuis peu.
> > Je viens d'utiliser les fonctions sur les fichier tel que is_file(),
> > is_dir() ou encore file_exists().
> >
> > J'obtiens des résultat qui ne correspondent pas à la documentation.
> > Apparement la longueur de chaîne influe sur le résultat obtenu.
> > En effet voici le test simple que j'ai effectuer :
> >
> > $file =
> > "\\\srvdfs00\\partages\\0-50\\M7\\05_APValidation\\Forfait_Entreprise
> >_Chaîne_de_Valeur"; echo "len : " . strlen($file) ."";
> > echo "file : " . $file . "";
> > if (is_dir($file)) {
> > echo "false";
> > } else {
> > echo "true";
> > }
> > echo "";
> >
> >
> > $file =
> > "\\\srvdfs00\\partages\\0-50\\M7\\05_APValidation\\Forfait_Entreprise
> >_Chaîne_de_Valeur\\Entreprise"; echo "len : " . strlen($file) ."";
> > echo "file : " . $file . "";
> > if (is_dir($file)) {
> > echo "false";
> > } else {
> > echo "true";
> > }
> > echo "";
> >
> > Voici le résultat :
> >
> > len : 83
> > file :
> > \\srvdfs00\partages\0-50\M7\05_APValidation\Forfait_Entreprise_Chaîne
> >_de_Valeur false
> >
> >
> > len : 94
> > file :
> > \\srvdfs00\partages\0-50\M7\05_APValidation\Forfait_Entreprise_Chaîne
> >_de_Valeur\Entreprise true
> >
> >
> >
> > Il est evident que j'ai tester les 2 repertoires dans un explorateur
> > windows et que les chemins sont les bons.
> > Je suis sous NT et le partage réseau doit surement être sous windows
> >
> > Merci de votre réponse.
> >
> > Jérémy Hennegrave (Pour Bouygues Telecom)
>
> Here is an english newsgroup, please ask your question in english, or go
> to your language sections

-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C$(+++) UL>$ P-(+)>++
L+++>$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>$@ h++(*) r-->++ y--()>
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

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



[PHP] Re: Bug, erreurs ou non =?ISO-8859-1?Q?document=E9?=

2005-05-04 Thread Amir Mohammad Saied
[EMAIL PROTECTED] wrote:
Bonjour,
J'utilise php en profondeur depuis peu.
Je viens d'utiliser les fonctions sur les fichier tel que is_file(), is_dir() ou
encore file_exists().
J'obtiens des résultat qui ne correspondent pas à la documentation.
Apparement la longueur de chaîne influe sur le résultat obtenu.
En effet voici le test simple que j'ai effectuer :
$file =
"\\\srvdfs00\\partages\\0-50\\M7\\05_APValidation\\Forfait_Entreprise_Chaîne_de_Valeur";
echo "len : " . strlen($file) ."";
echo "file : " . $file . "";
if (is_dir($file)) {
echo "false";
} else {
echo "true";
}
echo "";
$file =
"\\\srvdfs00\\partages\\0-50\\M7\\05_APValidation\\Forfait_Entreprise_Chaîne_de_Valeur\\Entreprise";
echo "len : " . strlen($file) ."";
echo "file : " . $file . "";
if (is_dir($file)) {
echo "false";
} else {
echo "true";
}
echo "";
Voici le résultat :
len : 83
file :
\\srvdfs00\partages\0-50\M7\05_APValidation\Forfait_Entreprise_Chaîne_de_Valeur
false
len : 94
file :
\\srvdfs00\partages\0-50\M7\05_APValidation\Forfait_Entreprise_Chaîne_de_Valeur\Entreprise
true

Il est evident que j'ai tester les 2 repertoires dans un explorateur windows et
que les chemins sont les bons.
Je suis sous NT et le partage réseau doit surement être sous windows
Merci de votre réponse.
Jérémy Hennegrave (Pour Bouygues Telecom)
Here is an english newsgroup, please ask your question in english, or go 
to your language sections

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


[PHP] Re: Bug or undocumented functionality of unset()?

2005-02-23 Thread Jason Barnett
[EMAIL PROTECTED] wrote:
> Hi All,
> 
> Does unset() create a copy of the array and then overwrite the 
> original
> somehow 
> destroying the reference?
...
> ---
>  $stuff = array(array('one','two'),
> array('one','two'),
> array('three','four'),
> array('five','six'),
> array('seven','eight'),
> array('nine','ten'));
> 
> print ''; print_r($stuff); print '';
> 
> foreach ($stuff as $key => &$values) {

This kind of array manipulation only works in PHP5... which I assume you
are using?

> print "on key:$key";
>   if(($key%2)==0){
>   print "Running unset for $key ";
>   unset ($stuff[$key]);

This works fine for me... again, using PHP5 here.

>   }else{
>   print "Running change for $key ";
>   $values[1]='foo';

Now this is an interesting problem.  It seems that $values[1] is not
being changed.  I don't know if this is a quirk or not, but since
$values should be a reference I would expect it to work for values that
are arrays (and not just scalars).  Check out bugs.php.net for this part
of the problem.

Seems the root issue here is that array references only work for scalar
values.  This is also a PHP5-only issue (since foreach references wasn't
a feature of PHP4).

> //$stuff[$key][1] = 'foo';

Using foreach in PHP4 you would have to do something like the line above
to change a value.  It appears that this is also the only way to do it
in PHP5? ... but IMO this shouldn't be the way it is...

>   }
> }
> print ''; print_r($stuff); print '';
> ?>


-- 
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


RE: [PHP] Re: Bug-Tracking-System in PHP ?

2004-10-30 Thread Reinhart Viane
Hmmm
No email support??

When a bug is posted, updated, a bug note is added, etc everyone who
subscribed to this 'topic' will receive a email on it
We use it in our firm and it works like a charm :)

-Original Message-
From: Michelle Konzack [mailto:[EMAIL PROTECTED] 
Sent: vrijdag 29 oktober 2004 16:51
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Bug-Tracking-System in PHP ?


Am 2004-10-29 09:48:32, schrieb Reinhart Viane:
> Dunno if this is ok:
> http://www.mantisbt.org/

Nice features and 1.0 support postgresql
(can not use MySQL because some tools conflicts with postgresql)

Unfortunatly no E-Mail support...
:-(

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/ 
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)

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



Re: [PHP] Re: Bug-Tracking-System in PHP ?

2004-10-29 Thread Greg Donald
On Fri, 29 Oct 2004 16:51:06 +0200, Michelle Konzack
<[EMAIL PROTECTED]> wrote:
> > http://www.mantisbt.org/
> 
> Nice features and 1.0 support postgresql
> (can not use MySQL because some tools conflicts with postgresql)

A database abstraction layer might be the solution to that.

ADOdb is very good.  adodb.sf.net

My favorite feature is the md5 bzip'd PHP sessions.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Re: Bug-Tracking-System in PHP ?

2004-10-29 Thread Robby Russell
On Fri, 2004-10-29 at 16:51 +0200, Michelle Konzack wrote:
> Am 2004-10-29 09:48:32, schrieb Reinhart Viane:
> > Dunno if this is ok:
> > http://www.mantisbt.org/
> 
> Nice features and 1.0 support postgresql
> (can not use MySQL because some tools conflicts with postgresql)


How do mysql and postgresql tools conflict? You should have no problem
running them side by side... or even several of each on the same
machine. They don't obsolete each other or cause dependancy issues.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


[PHP] Re: Bug-Tracking-System in PHP ?

2004-10-29 Thread Michelle Konzack
Am 2004-10-29 09:48:32, schrieb Reinhart Viane:
> Dunno if this is ok:
> http://www.mantisbt.org/

Nice features and 1.0 support postgresql
(can not use MySQL because some tools conflicts with postgresql)

Unfortunatly no E-Mail support...
:-(

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/ 
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PHP] Re: Bug with mktime??

2004-08-30 Thread Peter Brodersen
On Tue, 31 Aug 2004 09:53:01 +1200, in php.general
[EMAIL PROTECTED] (John Clegg) wrote:

>I have been using mktime() to determine the next 12 months for a 
>program, and i have discovered what seems a bug in the function.
>
>The following code...
>
>for($i=0;$i < 12;$i++){
>
>$currentDate = date("d m Y",mktime(0, 0, 0,date("m")+$i , date("d"), 
>date("Y")));

There is no bug.

Currently it is the 31. august.

For $i ==1, you are setting the date to 31. september => 1. october.
For $i ==2, you are setting the date to 31. october
For $i ==3, you are setting the date to 31. november => 1. december
For $i ==4, you are setting the date to 31. december

.. and so on.

Since you only look at the month, you would get october, october,
december, december, etc.

-- 
- Peter Brodersen

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



[PHP] Re: bug in PHP

2004-02-27 Thread Michael Kunze
Kyle Goetz wrote:

> hey so i've been struggling with an apparent bug in and older version of
> PHP but i wouldn't know where to look about this bug, as it concerns the
> include function and there is no mention of a bug that i can find...
> 
> version of php: 4.1.0
> i have a line of code
> include 'new_album.php';
> i keep getting a file not found error
> i KNOW the file is there
> i copy the code to a new file, and save it as 123.php and then change
> the line of code to
> include '123.php';
> and voile! it works!
> it seems there is something wrong with using the name 'new_album.php'
> with include but i dunno why...
> 
> anyone got any input on this? i don't wanna have to worry about
> filenames making errors...

i assume you use linux?
if so check if the file, the directory and all parent directories have
at least read rights for the user your webserver is running under and
the directories must have the execute bit set.

-- 
Michael Kunze
http://www.smrealms.de/

JABBA - EOL: End Of Lecture

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



[PHP] Re: Bug...

2003-08-28 Thread WebDevMagazine
Yes I can help you.please send me your OS , php version and what COM you are
triyng to use.



Regards
Bogomil

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



[PHP] Re: bug in addslashes command?

2003-07-22 Thread Kevin Stone

"Merlin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello there,
>
> I am running php 4.2.1 on a linux machine. Not sure, but I think there
might
> be a bug in there.
>
> While putting data into the db I do get an error in a verry rar case. All
> values are escaped by addslashes commands.
>
> This is the original string:
> the 'capitol-' of Kefalonia
>
> This is the string after addslashes:
> the \'capitol\-' of Kefalonia
>
> Which leaves the last ' unescaped.
>
> Am I wrong, or is this a bug? Anny suggestions?
>
> Thanx for any help,
>
> Merlin

That's strange.  Tested on PHP v4.2.3 on Linux and it seems to be working
okay..
output: \'capitol-\' of Kefalonia

- Kevin



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



[PHP] Re: Bug in PHP 4.22? (getimagesize problem)

2002-10-08 Thread nicos

It works fine with me on 4.2.3. Try it.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Pekka Saarinen" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]

Hi,

I have a very odd problem with PHP 4.22 (no acceleration) and Apache 1.3:

Getimagesize fails to see an image from URL randomly (1 out of 8 tries),
although the image is definitely there (trust me) and the server is under
zero load.

I tried also urlExists() from
http://www.php.net/manual/en/function.file-exists.php and it has the same
problem - but even worse. Apache seems to reject PHP's file function
queries in random basis. Clearstatcache() does not seem to make any
difference.

If I just show the photos without getimagesize it shows ok every time, so
it is apparently not Apache's problem. It seems that PHP does not
interprete Apache's responses properly.

On other physical server I have PHP 4.0.6¨/ Apache 1.3, and with identical
code when checking the same photos (from the "faulty" server) Getimagesize
gets them right every time.

Also, on Windows PHP 4.2 / Apache 1.3 all works perfectly.

I have not updated to 4.23 to see if there's anything fixed there because
4.23 has reportedly POST corruption problems, and changelog does not say
anything about image check function fixes.

Any clues?

Thanks,

Pekka




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




[PHP] Re: Bug in PHP?

2002-07-18 Thread Richard Lynch

>Hello,
>
>I'm trying to explode an associative array element in $HTTP_POST_VARS
>retrieved from submitting am html form.  The URL to the form is:
>http://www.funfry.com/form.html
>
>Now when I try to explode $HTTP_POST_VARS["domains"] it doesn't seem to have
>the desired effect. I use the syntax "$site = explode("
>",$HTTP_POST_VARS["domains"]);" and instead of the expected result of:
>
>$site[0] = "www.php.net";
>$site[1] = "www.jokaroo.com";
>$site[2] = "www.gnu.org";
>
>I get: $site[0] = "www.php.net www.jokaroo.com www.gnu.org";
>
>The value of $HTTP_POST_VARS["domains"] after submitting the form is
>"www.php.net www.jokaroo.com www.gnu.org".  Does anyone have an idea of how
>I can get each domain in a seperate array index?

var_dump($HTTP_POST_VARS['domains']);

I *suspect* that you actually have:





If so, then $HTTP_POST_VARS['domains'] is an *ARRAY* already, and doing an
explode on it is just silly.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Bug #17121 Updated: failed to make with OCI8 for oracle support

2002-05-10 Thread Markus Fischer

Hi,

this is not a bug issue, but an installation question. Either
as on php-general@ (CC'd) or php-install@ (don't recall the
exact name).

Can't find clntsh usually means you don't have passed the
right path to the oci PHP configure switch and/or the library
isn't in your library path (/etc/ld.so.conf)

- Markus

On Fri, May 10, 2002 at 09:05:08AM -, [EMAIL PROTECTED] wrote : 
>  ID:   17121
>  Updated by:   [EMAIL PROTECTED]
>  Reported By:  [EMAIL PROTECTED]
>  Status:   Closed
>  Bug Type: OCI8 related
>  Operating System: Redhat 7..2 &.7.3
>  PHP Version:  4.2.0
>  New Comment:
> 
> Ok, so i have oracle client installed but i did not do a administrativr
> install
> So I did that last night
> now we are getting past that problem
> What happens now is that it states that ld can't find -lclntsh
> 
> what now
> I'm just reinstalling maybe i'll get past this
>  but anay suggestion is welcome
> 
> 
> Previous Comments:
> 
> 
> [2002-05-09 11:49:34] [EMAIL PROTECTED]
> 
> You need at least Oracle client installed in order to compile PHP. For
> more info see http://www.php.net/manual/en/ref.oci8.php
> 
> 
> 
> [2002-05-09 11:19:30] [EMAIL PROTECTED]
> 
> Gee!! you responded quickly
> I'm using oracle9i
> And no i don't have it on my system
> 
> 
> 
> [2002-05-09 10:57:36] [EMAIL PROTECTED]
> 
> Which version of Oracle do you have installed?
> There shoud be oci.h in /home/oracle/OraHome1/rdbms/demo, if its not
> there could you try finding the file under $ORACLE_HOME
> (/home/oracle/OraHome1).
> 
> 
> 
> 
> [2002-05-09 10:48:45] [EMAIL PROTECTED]
> 
> Hi there we have tried with both Redhat 7.2 and 7.3 and php 4.1.1 and
> 4.2.0
> I extracted the sorce to /usr/local/php4.2.0/
> When doing a config(actualy config.nice) all works fine
> below my config.nice
> #! /bin/sh
> #
> # Created by configure
> './configure' \
> '--with-apxs2=/usr/local/apache/bin/apxs' \
> '--with-config-file-path=/usr/local/apache/conf' \
> '--enable-versioning' \
> '--with-mysql=/usr/local' \
> '--enable-ftp' \
> '--with-imap=/usr/local' \
> '--with-gd=/usr/local/gd1.3' \
> '--enable-bcmath' \
> '--disable-debug' \
> '--enable-memory-limit=yes' \
> '--enable-track-vars' \
> '--with-oci8=/home/oracle/OraHome1' \
> "$@"
> 
> when doing a make I get a failure in the php_oci8.h file
> Below is the last few lines of the terminal output
> I can't find anything that tels me what is going wrong everything looks
> right and in place please,,please can you help
> 
> -I/usr/local/gd1.3/ -I/usr/local/include -I/usr/local/include/mysql
> -I/home/oracle/OraHome1/rdbms/demo -I/home/oracle/OraHome1/plsql/public
> -I/usr/local/php-4.2.0/ext/xml/expat  -D_REENTRANT
> -I/usr/local/php-4.2.0/TSRM -g -O2 -pthread -DZTS -prefer-pic  -c
> internal_functions.c
> In file included from internal_functions.c:38:
> /usr/local/php-4.2.0/ext/oci8/php_oci8.h:52:17: oci.h: No such file or
> directorymake[2]: *** [internal_functions.lo] Error 1
> make[2]: Leaving directory `/usr/local/php-4.2.0/main'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/local/php-4.2.0/main'
> make: *** [all-recursive] Error 1
> 
> 
> 
> 
> -- 
> Edit this bug report at http://bugs.php.net/?id=17121&edit=1

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"I'm not stupid, you know? :)" - Jani Taskinen

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




[PHP] Re: BUG in recursion

2002-03-30 Thread David Johansen

No it's right. Because $count will equal 10 and it'll print it out, the test
will fail and then it'll trace the recursion back and print the j's. It
would be a bug if it printed an 11, but it's right the way it is.
Dave

"Uros Gruber" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!
>
> This is a code
>
> function Test()
> {
> static $count = 0;
>
> $count++;
> echo $count;
> if ($count < 10) {
> Test ();
> }
> echo "j";
> }
> test();
>
> Output is
>
> 12345678910jj
>
> Why is there 10 j at the and. If this would work it can be
> only one. If $count is grater than 10 it does not call itself
> but end. Is this maybe a bug or what.
>
>
> --
> lp,
>  Uros  mailto:[EMAIL PROTECTED]
>



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




[PHP] Re: Bug #14360: Script ends on >

2001-12-07 Thread Fred

Just out of curiosity, what makes you think the scripting engine stopped at
that particular spot?

Fred

Thomas Seuring <[EMAIL PROTECTED]> wrote in message
005744005865206102L412*@MHS">news:005744005865206102L412*@MHS...
Dear friends,

I've opened a Bug I think I've found on PHP, but there I was recommended to
ask
you.

Below you'll find the Mail I wrote and I hope, that you can help me.


[2001-12-06 06:30:32] [EMAIL PROTECTED]
I'm using a generated Script of the PHAKT-Software on a Windows 2000 and
Apache
Server.

The complete Script is:

 0) $KT_referrer .= "?" . $QUERY_STRING;
  $KT_authFailedURL = $KT_authFailedURL . $KT_qsChar . "accessdenied=" .
urlencode($KT_referrer);
  header("Location: $KT_authFailedURL");
  exit;
}
?>

On

if (strlen($QUERY_STRING) > 0) $KT_referrer .= "?" . $QUERY_STRING;

The PHP Engine ends after the > of (strlen($QUERY_STRING) > 0).

I think PHP interpretes the > as end of the Scripting Section.

I hope you could help me on this.

Yours

Tom


[2001-12-06 06:36:40] [EMAIL PROTECTED]
Ask for support questions at [EMAIL PROTECTED] .

This is most likely a programming error.

Bogus.

Thank you very much for your Feedback.

Yours,

Tom


Thomas W. Seuring
Senior Manager Corporate IT
DaimlerChrysler Capital Services
Europe & South Africa

HPC 0635
Epplestrasse 225
70546 Stuttgart
Germany

E-Mail: [EMAIL PROTECTED]

Phone: +49 (711) 17 94 783
Fax: +49 (711) 17 91 698

Mobile:+49 (171) 370 71 84
Mobile Fax: +49 (171) 37 48 158
- Forwarded by Thomas Seuring/DEBIS/debis/DCX on 07.12.2001 08:04 -

[EMAIL PROTECTED]
06.12.2001 15:14
Please respond to php-dev

To: Thomas Seuring/DEBIS/debis/DCX@WK-EMEA1
bcc:
Subject: Bug #14360: Script ends on >

From: [EMAIL PROTECTED]
Operating system: Windows 2000
PHP version:  4.0.6
PHP Bug Type: Scripting Engine problem
Bug description:  Script ends on >

I'm using a generated Script of the PHAKT-Software on a Windows 2000 and
Apache Server.

The complete Script is:

 0) $KT_referrer .= "?" . $QUERY_STRING;
  $KT_authFailedURL = $KT_authFailedURL . $KT_qsChar . "accessdenied=" .
urlencode($KT_referrer);
  header("Location: $KT_authFailedURL");
  exit;
}
?>

On

if (strlen($QUERY_STRING) > 0) $KT_referrer .= "?" . $QUERY_STRING;

The PHP Engine ends after the >.

I think PHP interpretes the > as end of the Scripting Section.

I hope you could help me on this.

Yours

Tom


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


=



-- 
PHP General 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] Re: Bug ? Script download problem if user abort download

2001-10-31 Thread Gianluca Morello

I retry using the following snuppet:

...
while (!connection_aborted() && !feof($fp) )
 {
  echo fread($fp, 1000);
  }

but nothing change.
I try also with connection_status() and ignore_user_abort(false) but nothign
change.
If the user abort the download progress, the php process hang.



"Gianluca Morello" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a download script on IIS 5 and Php 4.0.6 as cgi:
>
>  $filename=PDF_PATH.$codfile.".pdf";
>   $fp=fopen($filename,"rb");
>   if ($fp)
>   {
>header("Content-type: application/octet-stream\n" );
>header("Content-transfer-encoding: binary\n");
>header("Content-length: " . filesize($filename) . "\n");
>header("Content-disposition: attachment; filename=".$codfile.".pdf\n");
>$contents="";
>while (!feof($fp))
>{
> $contents .= fread($fp, 1000);
>}
>fclose($fp);
>print($contents);
>
>
> the script works very well.
> But if the user press the Cancel button in the browser download dialog,
the
> current php process stop working. If i try to load a new page another php
> process is spawned, but do nothing.
> If i look in the task manager i see my php processes running (without
doing
> nothing).
> When the timeout occurs the php engine continue wotking correctly.
>
> If i close the browser while php is hang, and i start a new browser
session
> the php pages are correctly processed.
>
>
> I try several other methods :
> readfile,fpassthru,fread($fp,filesize),read and print a small chunks of
> data, but nothing change, when the user abort the download operation the
php
> hang.
>
> This behaviour is very similar to the following bug:
> http://bugs.php.net/?id=8215 , that appears to be closed
>
>
>
>
>
> --
> Gianluca Morello
> Editek S.r.l.
> http://www.editek.it
> Via Vitruvio, 43 - Milano
> Mail: [EMAIL PROTECTED]
> Tel. : 02-671166208
> Fax : 02-67493766
>
>



-- 
PHP General 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] Re: bug in str_replace() ?

2001-10-21 Thread Christian Kuhtz

Martin Lindhe wrote:
> 
> Bug in str_replace(), PHP 4.0.6
> 
> $text = "hello   world";
> $out = str_replace("  "," ",$text);
> echo $out;
> 
> Expected output:
> "hello world"
> 
> Actual output:
> "hello  world"
> 
> Of course, this is what happens if str_replace() does replacements on input,
> but not on the soon-to-be output it is working on. Is this to be expected,
> or would it be ok to modify the functionality of str_replace()?

Huh?  It did exactly what you asked to do.  You had three spaces, and you
requested that two be replaced by one.  So, you went from three spaces to two
spaces, as two of the three were combined into one.  I don't understand why
you expected to end up with one space.  Can you elaborate please?

Thanks,
Chris

-- 
PHP General 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] Re: bug in str_replace() ?

2001-10-21 Thread Henrik Hansen

[EMAIL PROTECTED] (Martin Lindhe) wrote:

 > Bug in str_replace(), PHP 4.0.6
 > 
 >  $text = "hello   world";
 >  $out = str_replace("  "," ",$text);
 >  echo $out;
 > 
 > Expected output:
 >  "hello world"   
 > 
 > Actual output:
 >  "hello  world"
 > 
 > Of course, this is what happens if str_replace() does replacements on input,
 > but not on the soon-to-be output it is working on. Is this to be expected,
 > or would it be ok to modify the functionality of str_replace()?

you should put it in a loop or something to get what you want.

-- 
Henrik Hansen

-- 
PHP General 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] Re: Bug #13451 Updated: no images ;( (fwd)

2001-10-02 Thread Richard Lynch

Check the output from your configuration...

Various files such as config.log and config.cache and whatnot may have
specific info about GD and/or its failure to get included in your
compilation.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Marcin Liwinski <[EMAIL PROTECTED]>
Newsgroups: php.install,php.general
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, September 26, 2001 8:42 AM
Subject: Bug #13451 Updated: no images ;( (fwd)


>
> after upgrade from version 4.0.4pl1 to 4.0.6, i cannot generate images ;(
> i don't know why: maybe i've missed some install or configuration steps,
> but i don't thing so. under windows when i did: php.exe image.php >
> image.jpg,  i've got an image, but when the same script is run from under
apache
> - it doesn't work ;(
>


-- 
PHP General 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] RE: Bug IDs #8772, #9002, maybe #9724 - session write handler and register_globals

2001-03-16 Thread Jaime Bozza

Hello,
   (Using both 4.0.4pl1 and latest CVS as of today.)  I have been having
similar problems with defining my own session handling routings and
register_globals.  If register_globals is off, a new session doesn't seem to
call the "write" handler, thus the session never gets stored.  With
register_globals=on, the session gets stored correctly.

   I've done some testing and found out a fix to the problems which ends up
being better than keeping register_globals on.  Here's my code for my "read"
handler (PostgreSQL-based).


--
function sess_read($sid) {
global $SESS_DBH;

$qry = "SELECT value FROM sessions WHERE sid = '$sid'";
$qid = pg_exec($SESS_DBH, $qry);

if (pg_numrows($qid) > 0) {
list($value) = pg_fetch_row($qid, 0);
return $value;
}

return "";
}
---

   Originally (last line in function above)[EMAIL PROTECTED], I was
returning a FALSE instead of a blank string.  When I switched over to
returning a blank string (when there wasn't any data in the session
database), my "write" handler gets called correctly.


   I'm not sure if this will fix anybody else's problems, but if you change
your read handler to return a blank string instead of a FALSE condition, it
may start working for you as well!  (If it DOES help you out, please let me
know.)


Jaime Bozza


-- 
PHP General 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]