17 sep 2012 kl. 10.50 skrev Camilo Sperberg:
Hello list, I have a little question with PHP's internal working. I've
managed to reduce the test to the following lines:
$globalVariable = 'i am a global variable';
function testFunction() {
global $globalVariable;
On 17/09/2012, at 8:50 PM, Camilo Sperberg unrea...@gmail.com wrote:
Hello list, I have a little question with PHP's internal working. I've
managed to reduce the test to the following lines:
$globalVariable = 'i am a global variable';
function testFunction() {
global
On 17 sep. 2012, at 10:55, Frank Arensmeier farensme...@gmail.com wrote:
17 sep 2012 kl. 10.50 skrev Camilo Sperberg:
Hello list, I have a little question with PHP's internal working. I've
managed to reduce the test to the following lines:
$globalVariable = 'i am a global variable';
On Mon, Sep 17, 2012 at 8:57 PM, Camilo Sperberg unrea...@gmail.com wrote:
On 17 sep. 2012, at 10:55, Frank Arensmeier farensme...@gmail.com wrote:
17 sep 2012 kl. 10.50 skrev Camilo Sperberg:
Hello list, I have a little question with PHP's internal working. I've
managed to reduce the test
-Original Message-
From: Gary [mailto:php-gene...@garydjones.name]
Sent: Tuesday, October 19, 2010 11:38 PM
To: php-general@lists.php.net
Subject: [PHP] Re: Possible foreach bug; seeking advice to isolate the
problem
Jonathan Sachs wrote:
I've got a script which originally
On Wed, Oct 20, 2010 at 5:00 AM, Tommy Pham tommy...@gmail.com wrote:
Shouldn't that be $row = null since unset will remove the last value, not
just removing the variable also, from the array whereas the $row = null
will
tell the reference pointer that it doesn't point to a value.
No, that
On Wed, Oct 20, 2010 at 10:44 AM, David Harkness
davi...@highgearmedia.com wrote:
On Wed, Oct 20, 2010 at 5:00 AM, Tommy Pham tommy...@gmail.com wrote:
Shouldn't that be $row = null since unset will remove the last value, not
just removing the variable also, from the array whereas the $row =
On Sun, 25 Apr 2010 16:16:00 +0200, fakessh fake...@fakessh.eu wrote:
On Sun, 25 Apr 2010 00:38:17 +0200, fakessh fake...@fakessh.eu wrote:
On Sat, 24 Apr 2010 06:00:55 +0200, fakessh fake...@fakessh.eu wrote:
On Thu, 22 Apr 2010 17:58:43 +0200, fakessh fake...@fakessh.eu
wrote:
On Thu, 22 Apr
Hi, Pawel;
On Sat, Dec 27, 2008 at 05:40, Pawel Rutkowski
rut...@freelance-worker.net wrote:
[snip!]
But in PHP5 x64 I have errors like:
/root/src/php-5.2.6/Zend/zend_hash.c(247) : Freeing 0x0E76BC50 (75 bytes),
script=ext/session/tests/session_encode_variation5.phpt
[Sat Dec 27
something to our Eclipse PDT set-up
so it can detect this as an error.
-Original Message-
From: Thijs Lensselink [mailto:[EMAIL PROTECTED]
Sent: Saturday, August 30, 2008 3:25 PM
Cc: php-general@lists.php.net
Subject: Re: [PHP] Is this a bug?
Jochem Maas wrote:
T Lensselink schreef
Jochem Maas wrote:
T Lensselink schreef:
Catalin Zamfir Alexandru, DATAGRAM SRL wrote:
Hello guys,
I've been stalking on the list for some time. Didn't
have
anything to report/talk, until now. I have a code like this, maybe
you guys
can reproduce it, with output buffering
On Fri, 2008-08-29 at 10:40 +0300, Catalin Zamfir Alexandru, DATAGRAM
SRL wrote:
Echo 'something';
Echo 'another thing';
Echo 'something br /'\;
I got the following output in both php5 and php4:
Warning: Unexpected character in input: '\' (ASCII=92) state=1
in /home/rob/bleh.php on line
Catalin Zamfir Alexandru, DATAGRAM SRL wrote:
Hello guys,
I've been stalking on the list for some time. Didn't have
anything to report/talk, until now. I have a code like this, maybe you guys
can reproduce it, with output buffering started:
Echo 'something';
Echo 'another
PROTECTED]
Sent: Friday, August 29, 2008 10:56 AM
To: Catalin Zamfir Alexandru, DATAGRAM SRL
Cc: php-general@lists.php.net
Subject: Re: [PHP] Is this a bug?
On Fri, 2008-08-29 at 10:40 +0300, Catalin Zamfir Alexandru, DATAGRAM
SRL wrote:
Echo 'something';
Echo 'another thing';
Echo
T Lensselink schreef:
Catalin Zamfir Alexandru, DATAGRAM SRL wrote:
Hello guys,
I've been stalking on the list for some time. Didn't have
anything to report/talk, until now. I have a code like this, maybe you guys
can reproduce it, with output buffering started:
Echo
got the answer from you clive :) Thanks
On Jan 18, 2008 1:02 PM, clive [EMAIL PROTECTED] wrote:
if ($question == 'php')
domail('phplist',$question);
if ($question == 'smarty')
domail('smartylist',$question);
Hi All,
I using html_options smarty tag to output an associative
You'll have to take this up with the Smarty folks, as it's very
smarty-specific, and not (PHP-)General at all...
On Fri, January 18, 2008 12:16 am, GoWtHaM NaRiSiPaLli wrote:
Hi All,
I using html_options smarty tag to output an associative array in
select
drop down.
Here a sample
if ($question == 'php')
domail('phplist',$question);
if ($question == 'smarty')
domail('smartylist',$question);
Hi All,
I using html_options smarty tag to output an associative array in select
drop down.
Here a sample associative array:
array(5) {
[CN-PEK-KEJ]=
array(1) {
On 8/20/07, Augusto Morais [EMAIL PROTECTED] wrote:
I dont know what is happening...
Can somebody clarify the situation for me?
here is the situation:
i have 3 files:
class.php
foo.php
bar.php
// - class.php
class globalactions {
function include_file($module) {
On 8/20/07, aflavio [EMAIL PROTECTED] wrote:
Strange..
I'm return a include..
Not exactly... you're returning the return value of an include.
Take this:
var.php:
?php
return bar;
?
foo.php
?php
function include_bar() {
return include bar.php
}
echo include_bar(); // echoes bar
the file
On Mon, 20 Aug 2007 02:24:49 -0300, Augusto Morais [EMAIL PROTECTED] wrote:
I dont know what is happening...
Can somebody clarify the situation for me?
here is the situation:
i have 3 files:
class.php
foo.php
bar.php
// - class.php
class globalactions {
function
On 8/20/07, Augusto Morais [EMAIL PROTECTED] wrote:
[snip!]
// - foo.php
include lib/clients.class.php;
$clients = new clients(); //instatiating the clients class
[snip again!]
var_dump($clients); //i dont get the object here. I got NULL!!! why?!?!!?
problem:
When the method(include_file)
Colin Guthrie wrote:
Hi,
I've noticed a bug with PHP 5.2.0 when dealing with sessions and posting
quite large forms.
I've attached a file that highlights the bug.
Can people test this please and if it is confirmed i'll post upsteam.
Just want to rule out my distro's packaging being at
Have you checked your error_log? I've had this problem when the wrong
permissions were set on /var/lib/php/session which meant PHP couldn't write
it's session files and hence generated a new ID each time. The error_log
will tell you if this is the case.
Edward
Colin Guthrie wrote:
Hi,
Frank J. Schima wrote:
The ID never changed for me.
PHP 5.2.0
Apache 1.3.33
Mac OS X 10.4.8
Cheers mate.
I guess that could mean its:
* Apache 2 thing
* x86_64 thing
* suhosin thing
* mandriva thing
More tests to narrow those down would be appreciated if anyone has
appropriate
Edward Kay wrote:
Have you checked your error_log? I've had this problem when the wrong
permissions were set on /var/lib/php/session which meant PHP couldn't write
it's session files and hence generated a new ID each time. The error_log
will tell you if this is the case.
No, but the problem
ok
this is returning the retrived data from open sockets :
http://pastebin.com/716768
this is returning an empty string :
http://pastebin.com/716767
On 5/14/06, chris smith [EMAIL PROTECTED] wrote:
On 5/14/06, Fourat Zouari [EMAIL PROTECTED] wrote:
Code 1 :
-
On 5/14/06, Fourat Zouari [EMAIL PROTECTED] wrote:
ok
this is returning the retrived data from open sockets :
http://pastebin.com/716768
this is returning an empty string :
http://pastebin.com/716767
it's not a bug :)
i shoul wait for stream to be returned, i use :
$var = file (http://www.some.server.net:someport;);
then $var=explode ... bla bla..
that never crash.
cheers,
cajbecu
On 5/14/06, Fourat Zouari [EMAIL PROTECTED] wrote:
On 5/14/06, Fourat Zouari [EMAIL PROTECTED] wrote:
ok
this is returning the retrived data from open sockets :
cajbecu, am talking about non-blocking sockets, that's a simple blocking
socket
On 5/14/06, cajbecu [EMAIL PROTECTED] wrote:
$var = file (http://www.some.server.net:someport;);
then $var=explode ... bla bla..
that never crash.
cheers,
cajbecu
On 5/14/06, Fourat Zouari [EMAIL PROTECTED]
On Sun, May 14, 2006 8:49 am, Fourat Zouari wrote:
On 5/14/06, Fourat Zouari [EMAIL PROTECTED] wrote:
it's not a bug :)
i shoul wait for stream to be returned, i use :
while(($buff = stream_get_contents($socket[$i]))==);
echo $buff;
On 5/14/06, Fourat Zouari [EMAIL PROTECTED] wrote:
Code 1 :
-
var_dump(stream_get_contents($rr));
-
Output 1
-
string(185) HTTP/1.1 202 Accepted
Server: Apache2
Content-Length: 24
Connection: close
Content-type: text/html
Pham Huu Le Quoc Phuc a écrit :
I catch an error, could you tell me if you have some ideas?
Error message: Undefined index: start_date in
c:\Inetpub\wwwroot\Cake\app\controllers\dsptrainings_controller.php on
line
33
PHP is telling you that what you are trying to access
Pham Huu Le Quoc Phuc a écrit :
I catch an error, could you tell me if you have some ideas?
class Dsptraining extends AppModel
{
function GetDsptrainings()
{
return $this-findBySql(select max(start_date) start_date from
tbl_dsptrainings);
}
}
did you try your sql
Thanks for relying!
But, Do not have anyway to solve this problem.
- Original Message -
From: nicolas figaro [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Friday, April 07, 2006 3:49 PM
Subject: Re: [PHP] Is it a bug of CakePHP?
Pham Huu Le Quoc Phuc a écrit :
I catch
On Fri, Dec 16, 2005 at 09:09:08AM -0500, Eric Butera wrote:
Hello all,
I have an image gallery script I created and I seem to be having some
difficulties with it. I am using this script on many different platforms
and different PHP versions. I have tried it on 4.4.0 (linux) and
Jared Williams wrote:
Hi,
$writer = new XmlWriter();
...
$writer-writeDtd('html', '-//W3C//DTD XHTML 1.0 Strict//EN',
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
produces no whitespace between the public system ids like...
!DOCTYPE
Jared Williams wrote:
PS.
Yeah, thought it was libxml, hence didn't file a pecl bug report. But
there does seem a problem with this method as can't
just have a publicId or a systemId, libxml function uses NULL as a parameter to
specify which id you don't want to use. Which we've
lost
Jared Williams wrote:
PS.
Yeah, thought it was libxml, hence didn't file a pecl
bug report. But
there does seem a problem with this method as can't just have a
publicId or a systemId, libxml function uses NULL as a
parameter to specify which id you don't want to use. Which
Hello TheI2eptile,
Thursday, March 24, 2005, 2:05:14 PM, you wrote:
T So here is what I would call a bug, but maybe it's thought to be so:
Try it with strict (data-type) comparisons, i.e.:
if ($var === AS)
Then you won't get the bug.
Best regards,
Richard Davey
--
TheI2eptile wrote:
Probably this is the wrong place to put this but I couldn't search for
not at all the wrong place, having said that the only thing probable with
regard
to you/your post is that you are not fully aware of the nature of data types in
php and the way auto-typecasting works (in
No
news.php.net wrote:
?
class A
{
var $name;
function A($str)
{
$this-name = $str;
}
}
$arr = array();
//Put to array to objects of class A,
// where their attribute A::a is assigned a different value
//objects are assigned to an array by reference
$a = new A(qaz);
$arr[0] = $a;
No
news.php.net wrote:
?
class A
{
var $name;
function A($str)
{
$this-name = $str;
}
}
$arr = array();
//Put to array to objects of class A,
// where their attribute A::a is assigned a different value
//objects are assigned to an array by reference
$a = new
I did a little experimenting, and it looks like foreach is misbehaving,
but may I just don't get it, anyway check this out
(my php version and output are below):
class A { var $name; function A($str) { $this-name = $str; } }
// does not work as expected.
$arr = array();
$a = new A(qaz);
$arr[0] =
30 2005 16:07 news.php.net (a):
?
class A
{
var $name;
function A($str)
{
$this-name = $str;
}
}
$arr = array();
//Put to array to objects of class A,
// where their attribute A::a is assigned a different value
//objects are assigned to an array by reference
Rory McKinley wrote:
Hi
Probably a trivial question
While trying to use mysqli on my dev machine, PHP returns the following:
Fatal error: Trying to clone an uncloneable object of class mysqli
After STFW I have found a solution that involves swiching off
compatibility with Zend Engine 1 in
Octavian Rasnita wrote:
Hi all,
I use the following program:
function print_quotes () {
output_reset_rewrite_vars();
echo EOF
table
...
/table
EOF;
}
I have tried this program under Fedora Core 2 in command line mode and on an
Apache web server with the same results.
Do you have suggestions
php under Linux also...
Teddy
- Original Message -
From: Raditha Dissanayake [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, November 29, 2004 5:29 PM
Subject: Re: [PHP] Is this a bug in PHP 4.3.4?
Octavian Rasnita wrote:
Hi all,
I use the following program:
function
On Mon, 29 Nov 2004 17:58:27 +0200, Octavian Rasnita [EMAIL PROTECTED] wrote:
Is PHP so buggy? The 'here document' should work without a problem in PHP
also.
The latest stable PHP 4 is rock solid from where I'm sitting. We have
a bunch of Debian servers running 4.3.9 with no issues.
My code
On Mon, 29 Nov 2004 10:28:57 -0600, Greg Donald [EMAIL PROTECTED] wrote:
I would defiantly upgrade.
Definitely too. :)
--
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Octavian Rasnita wrote:
Thank you. I will try that solution if it works, but the question still
remains...
Is PHP so buggy? The 'here document' should work without a problem in PHP
also.
It probably wasn't a bug in php 4.3.4 but as greg has pointed out you
probably should upgrade anyway. Here
: woensdag 27 oktober 2004 11:41
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Sessions problem bug
Are you using cookie-based sessions? Thus sayeth the manual:
Note: When using session cookies, specifying an id for session_id()
will always
send a new cookie when session_start() is called, regardless
In PHP4 $this-one = $one; assigns a *copy* of $one to $this-one. You
need to use $this-one = $one;
The code will work as expected in PHP5 (and zend.ze1_compatibility_mode
set to off).
Ryan Briones wrote:
This is a scaled down example of something I'm doing in some code. The
results are very
WRONG !
Read the manual about __set() and __get().
And read http://www.php.net/~helly/php/ext/spl/index.html about arrayAccess.
Php 5 allow you to overloading property dynamicaly with __set() and
__get(). And you can access an object like an array with arrayAccess
interface.
There is no
Moreover, $foo['bar'] = 'bar' work perfectly...
Fred.
Frédéric Hardy wrote:
WRONG !
Read the manual about __set() and __get().
And read http://www.php.net/~helly/php/ext/spl/index.html about
arrayAccess.
Php 5 allow you to overloading property dynamicaly with __set() and
__get(). And you can
Well alright, then I ought to read the suggested sources. Thanks for the
advice.
Anyway, doesn't it cause trouble to have $array as a private member?
Frédéric hardy wrote:
Moreover, $foo['bar'] = 'bar' work perfectly...
Fred.
Frédéric Hardy wrote:
WRONG !
Read the manual about __set() and
From: Stephen Craton [EMAIL PROTECTED]
I was making a parabola grapher and I was testing out some values. Part of
the script is to take the variable b and multiply it was negative one,
then
multiply by 2 times a. I entered a test value where a equals 1, b equals
0,
and c equals 0. The result
I don't think it's so much a bug as it is just some odd behavior. If you
use 'this monday' the results are correct.
$start = strtotime('this monday');
Keith
At 02:44 PM 2/28/2004, Rob Petty wrote:
I am getting incorrect results from strtotime:
[dali]$ uname -a
Linux dali
On Thursday 12 February 2004 14:40, Eric Bolikowski wrote:
Headers have to be pretty accurate, or it will cause trouble.
And your redirect header is not quite correct.
It should be this:
header(Location: another_page.php);
and NOT header(Location:another_page.php);
What you need here is a
* Thus wrote Steve Todd ([EMAIL PROTECTED]):
Is it possible to define a variable, such as:
$foo = bar;
and then do as follows to create a totally different variable:
$$foo = text here;
this seems to mean $bar = text here;.
Is this a bug or can we legally use it.
perfectly legal,
Steve Todd wrote:
Is it possible to define a variable, such as:
$foo = bar;
and then do as follows to create a totally different variable:
$$foo = text here;
this seems to mean $bar = text here;.
Is this a bug or can we legally use it.
Yes it's legal.
--- Steve Todd [EMAIL PROTECTED] wrote:
Is it possible to define a variable, such as:
$foo = bar;
and then do as follows to create a totally different variable:
$$foo = text here;
this seems to mean $bar = text here;.
Is this a bug or can we legally use it.
It is not a bug, but
Steve Todd mailto:[EMAIL PROTECTED]
on Wednesday, August 27, 2003 1:28 PM said:
Is this a bug or can we legally use it.
It's legal. And here is an article that explains it:
http://www.phphideout.com/articleview.php/5
(read near the bottom)
Chris.
--
PHP General Mailing List
No its not a bug
basically what you did was assign a value to a value of a variable
a $$ is how you access the value of a variable as a variable
- Original Message -
From: Steve Todd [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 27, 2003 1:27 PM
Subject: [PHP] IS
Steve Todd wrote:
Is this a bug or can we legally use it.
Please RTFM before posting! http://php.net/variables.variable
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt
to decrypt it will be prosecuted to the full extent of the law.
--
PHP General Mailing
read www.php.net/variables.scope
Eric Fleming wrote:
I am having some problems using variables in included files. Can someone
please look at my code below and see how I might accomplish what I am trying
to do?
?php
$subnav = home;
include(incHeader.php);
?
!--- CONTENT AREA ---
The content
in_array searches for a value, you suply key. This will work as you expect:
$data = array();
foreach ($this-_array_a as $key = $value) {
if (! in_array($value, $this-_array_b)
$data['added'][$key] = $this-_array_a[$key];
}
Branko F. Grac(nar wrote:
-BEGIN PGP SIGNED
[EMAIL PROTECTED]
Marek Kilimajer:
in_array searches for a value, you suply key. This will work as you
expect:
array_key_exists searches for a key.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
according to the php doc, online the headers are not affected by the
Output Buffer,
so any functions that manipulate the OB should have no effect. flush I
do not beleive
will fix this issue. (* I have tested it and it did not *)
Still need a good way to accomplish this.
Thanks, James
Ivo
Hello everyone. I was able to determine what was causing my problem
with session variables not being persitant across page requests. I want
to give you the full scope here, so I'm going to paste the code (and if
you have any code tips, please let me know).
I think the problem might be this
On Tuesday 01 July 2003 12:46, John Manko wrote:
Hello everyone. I was able to determine what was causing my problem
with session variables not being persitant across page requests. I want
to give you the full scope here, so I'm going to paste the code (and if
you have any code tips, please
work and the first one doesn't?
-Original Message-
From: Philip Hallstrom [mailto:[EMAIL PROTECTED]
Sent: Friday, April 04, 2003 5:20 PM
To: Daevid Vincent
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: Found a bug in 4.2.3 re: TD and echo
vs. ?php?
It's a coding
, 2003 5:20 PM
To: Daevid Vincent
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: Found a bug in 4.2.3 re: TD and echo vs. ?php?
It's a coding error... at least I think so.
change alarmLightMySQL just return the results not echo
them... echoing
them doesn't make much sense inside another echo
: Philip Hallstrom [mailto:[EMAIL PROTECTED]
Sent: Friday, April 04, 2003 5:20 PM
To: Daevid Vincent
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: Found a bug in 4.2.3 re: TD and echo vs. ?php?
It's a coding error... at least I think so.
change alarmLightMySQL just return the results not echo
them
To: Daevid Vincent
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: Found a bug in 4.2.3 re: TD and echo vs. ?php?
It's a coding error... at least I think so.
change alarmLightMySQL just return the results not echo
them... echoing
them doesn't make much sense inside another echo statement
At 08:33 30.01.2003, zlu tarch said:
[snip]
I was not able to either telnet (via port 80), or
connect using fopen() to www2.barchart.com.
But it seems that it is fine now. Perhaps it was a
temp problem on the site's server, but still, I had no
problems
So sprach 1LT John W. Holmes am 2003-01-27 um 15:49:33 -0500 :
Actually, 08 is equal to 8 in PHP. PHP will convert the string to an
No, that's not true:
if (08 == 8){ echo equal; }
if (08 === 8){ echo more equal; }
This will only print equal and not more equal.
Alexander Skwar
--
How to
--- Alexander Skwar [EMAIL PROTECTED] wrote:
So sprach 1LT John W. Holmes am 2003-01-27 um 15:49:33
-0500 :
Actually, 08 is equal to 8 in PHP. PHP will convert
the string to an
No, that's not true:
if (08 == 8){ echo equal; }
if (08 === 8){ echo more equal; }
This will only print
I was not able to either telnet (via port 80), or
connect using fopen() to www2.barchart.com.
But it seems that it is fine now. Perhaps it was a
temp problem on the site's server, but still, I had no
problems connecting to the site via a browser while
fopen and telnet were not working.
It would
just try doing it with === (three equal signs) and you'll see what is
where
--
Maxim Maletsky
[EMAIL PROTECTED]
Cal Evans [EMAIL PROTECTED] wrote... :
John.
Actually, 08 is equal to 8 in PHP. PHP will convert the string to an
integer and the two will compare as equal.
No they are
Your bug is this:
inconsistency of types.
You split a formatted string into smaller strings and compare the
integers to it. In order to do this correctly, you will need to take
your integers and convert them into the strings, format of which you
already know and used for deformatting the
On Tuesday 28 January 2003 03:56, Scott Fletcher wrote:
Found a PHP bug, I'm using PHP version 4.2.3. I have been struggling with
why PHP code failed to work with the month is August or September, so I
have been playing around it and found the problem. I recently wrote a demo
script for you
-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
Found a PHP bug, I'm using PHP version 4.2.3. I have been
struggling with
why PHP code failed to work with the month is August or
September
I stumbled into this one a short while ago myself. It is not a bug,
I don't see why a string wouldn't work when I use 08 (string) and match it
against the integer 8, or 08.
Kirk Johnson [EMAIL PROTECTED] wrote in message
B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
-Original Message-
From: Scott
--- Scott Fletcher [EMAIL PROTECTED] wrote:
Found a PHP bug
...
if ($month == 01)
I guess you mean:
if ($month == '01')
If so, this is not a bug. Otherwise, please explain what
you think is wrong.
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
audience.
* http://www.christianperformer.com
*
-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 2:14 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Found a PHP bug!
I don't see why a string wouldn't work when I use 08 (string
Re: [PHP] Found a PHP bug!
uh oh...
I don't see why a string wouldn't work when I use 08 (string) and match it
against the integer 8, or 08.
They're just different types. Normally PHP is veeery flexible with
types, like javascript, but it just can't be flexible for you here because
I'm referring to '08' and '09' that don't work
Chris Shiflett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
--- Scott Fletcher [EMAIL PROTECTED] wrote:
Found a PHP bug
...
if ($month == 01)
I guess you mean:
if ($month == '01')
If so, this is not
() for integer
Um, what about double???
Thanks,
Scott F.
Chris Hayes [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Re: [PHP] Found a PHP bug!
uh oh...
I don't see why a string wouldn't work when I use 08 (string) and match
it
against the i
message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Re: [PHP] Found a PHP bug!
uh oh...
I don't see why a string wouldn't work when I use 08 (string) and
match
it
against the integer 8, or 08.
They're just different types. Normally PHP is veeery flexible wit
I would need to use intval() to solve this problem
Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I'm referring to '08' and '09' that don't work
Chris Shiflett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL
U might want to do a type cast to integer from string...
http://www.php.net/manual/en/language.types.type-juggling.php
On Mon, 2003-01-27 at 13:47, Scott Fletcher wrote:
I would need to use intval() to solve this problem
Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL
Because 8 != 8. 8 (and 08) is a string with the numerals
representing
the number eight. It is not the number eight. (think back to basic math,
the
difference between a number and a numeral)
Actually, 08 is equal to 8 in PHP. PHP will convert the string to an
integer and the two will compare as
whatever..
intval() for integer
Um, what about double???
Thanks,
Scott F.
Chris Hayes [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Re: [PHP] Found a PHP bug!
uh oh...
I don't see why a string wouldn't work when
Holmes...
- Original Message -
From: Ray Hunter [EMAIL PROTECTED]
To: Scott Fletcher [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, January 27, 2003 3:45 PM
Subject: Re: [PHP] Found a PHP bug!
U might want to do a type cast to integer from string...
http://www.php.net
John.
Actually, 08 is equal to 8 in PHP. PHP will convert the string to an
integer and the two will compare as equal.
No they are not equal. Yes, PHP will do the conversion so that they are
equal. That does not refute the fact that logically '08' != 8.
Someone already posted why the problem
Yea, it's too bad that not many people know about it. I first asked and
they told me it is done automatically. That was 3 years ago. I never had a
problem for 3 years until now. So, I'm going back to the old way as I did
in Javascript and C programming. I first started PHP 3 years ago, so
Thanks,
Scott F.
Chris Hayes [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Re: [PHP] Found a PHP bug!
uh oh...
I don't see why a string wouldn't work when I use 08 (string) and
match
it
against the integer 8,
Aw nut!!! The intval() doesn't work.. I had enough, I'm going to do
what Kirk Johnson recommend. That one work better.
Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Yea, it's too bad that not many people know about it. I first asked
Another workaround to this problem is as an addition to Kirk Johnson's
suggestion
--clip--
$month = 08;
if (trim($month) == 8) {
echo You got it!!!;
}
--clip--
Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
1 - 100 of 145 matches
Mail list logo