[PHP-DEV] Bug #11918 Updated: d'oh

2001-07-05 Thread fabiankessler

ID: 11918
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: Scripting Engine problem
Operating system: win2k
PHP Version: 4.0.6
Description: d'oh

and 

1) $pos is not === FALSE
2) the vars $pos, $string and $accessKey are not used anyhow else or anywhere else in 
that scope (method), and not included using global
3) if i 'initialise' $pos somehow
---cut---
$pos = 'someshit';
$pos = strpos(strToLower($string), strToLower($accessKey));
---cut---
or do the strpos() twice, i get the 0 and not the 1. and the array problem (strange 
characters) is gone also.

fab


Previous Comments:
---

[2001-07-05 22:59:12] [EMAIL PROTECTED]

hi. 

first of all, i'm not able to reproduce that. sorry. it only occures in the context of 
my scripts.

occures in 4.0.5 also.

---cut---
$pos = strpos(strToLower($string), strToLower($accessKey));
echo $pos . " -" . $string . ' ' . $accessKey . "n";
---cut---

this prints out '1 -Username U when it should be a 0 instead. when i do

---cut---
if ($string === 'Username') $string = 'Username';
---cut---

before, there's no problem. of course a var_dump() of $string shows string(8) 
"Username".

in the same context, 

---cut---
$t = array('', '');
echo $t[1];
---cut---

spits out a few strange characters (others each time) 
instead of the ''. and a var_dump() of $t even crashes 
apache. 

the value of $string ('Username') comes from mysql, it's a serialized value, and looks 
like: ;s:8:"Username"; so this should be fine.

well, maybe this sounds familiar to you. to me it looks *very* strange. again, i'm not 
able to reproduce it.

fab


---


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


-- 
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 #11918: d'oh

2001-07-05 Thread fabiankessler

From: [EMAIL PROTECTED]
Operating system: win2k
PHP version:  4.0.6
PHP Bug Type: Scripting Engine problem
Bug description:  d'oh

hi. 

first of all, i'm not able to reproduce that. sorry. it only occures in the context of 
my scripts.

occures in 4.0.5 also.

---cut---
$pos = strpos(strToLower($string), strToLower($accessKey));
echo $pos . " -" . $string . ' ' . $accessKey . "\n";
---cut---

this prints out '1 -Username U when it should be a 0 instead. when i do

---cut---
if ($string === 'Username') $string = 'Username';
---cut---

before, there's no problem. of course a var_dump() of $string shows string(8) 
"Username".

in the same context, 

---cut---
$t = array('', '');
echo $t[1];
---cut---

spits out a few strange characters (others each time) 
instead of the ''. and a var_dump() of $t even crashes 
apache. 

the value of $string ('Username') comes from mysql, it's a serialized value, and looks 
like: ;s:8:"Username"; so this should be fine.

well, maybe this sounds familiar to you. to me it looks *very* strange. again, i'm not 
able to reproduce it.

fab



-- 
Edit Bug report at: http://bugs.php.net/?id=11918&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 #10309 Updated: feature request

2001-06-20 Thread fabiankessler

ID: 10309
User Update by: [EMAIL PROTECTED]
Status: Closed
Bug Type: Feature/Change Request
Operating system: all
PHP Version: 4.0.4
Description: feature request

no, gives a syntax error also. 
PHP Version 4.0.7-dev (and 4.0.5)

Previous Comments:
---

[2001-06-17 04:45:51] [EMAIL PROTECTED]
try:

$c =& (true)? $a: $b;

might work better. Havnt tested it though.

---

[2001-04-12 15:26:32] [EMAIL PROTECTED]
$a = 'foo';
$b = 'bar';

$c = (true) ? &$a : &$b;

=> syntax error, have to do

if (true) {
  $c = &$a;
} else {
  $c = &$b;
}

would be nice :)

---


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


-- 
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 #10967 Updated: $x .= &someFunction();

2001-05-22 Thread fabiankessler

ID: 10967
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: Scripting Engine problem
Operating system: win2k
PHP Version: 4.0.5
Description: $x .= &someFunction();

uhm, well, the thing with the $temp var is useless. i see now that i cannot reference 
something into *a part* of something else.

but the silent loss of "\n" is still a problem, imo.

fab


Previous Comments:
---

[2001-05-18 23:41:12] [EMAIL PROTECTED]
code i would like to use:

---cut---
function &someShit() {
  return 'foo';
}

$out = '';
for ($i = 1; $i <= 3; $i++) {
  $out .= &someShit() . "n";
}
echo $out;
---cut---


problem: 
parse error on line
  $out .= &someShit() . "n";
because .= and & don't work together.

so the workaround would be:
  $temp = &someShit() . "n";
  $out .= $temp;

problem here:
it prints out 'foofoofoo' and not
'foonfoonfoon'

so the code finally looks like:

---cut---
function &someShit() {
  return 'foo';
}

$out = '';
for ($i = 1; $i <= 3; $i++) {
  $temp = &someShit();
  $out .= $temp . "n";
}
echo $out;
---cut---

is this the normal behavior?

fab



---


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


-- 
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 #10967: $x .= &someFunction();

2001-05-18 Thread fabiankessler

From: [EMAIL PROTECTED]
Operating system: win2k
PHP version:  4.0.5
PHP Bug Type: Scripting Engine problem
Bug description:  $x .= &someFunction();

code i would like to use:

---cut---
function &someShit() {
  return 'foo';
}

$out = '';
for ($i = 1; $i <= 3; $i++) {
  $out .= &someShit() . "\n";
}
echo $out;
---cut---


problem: 
parse error on line
  $out .= &someShit() . "\n";
because .= and & don't work together.

so the workaround would be:
  $temp = &someShit() . "\n";
  $out .= $temp;

problem here:
it prints out 'foofoofoo' and not
'foo\nfoo\nfoo\n'

so the code finally looks like:

---cut---
function &someShit() {
  return 'foo';
}

$out = '';
for ($i = 1; $i <= 3; $i++) {
  $temp = &someShit();
  $out .= $temp . "\n";
}
echo $out;
---cut---

is this the normal behavior?

fab




-- 
Edit Bug report at: http://bugs.php.net/?id=10967&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 #10940: ((true) && (true)) to return bool

2001-05-17 Thread fabiankessler

From: [EMAIL PROTECTED]
Operating system: win2k
PHP version:  4.0.5
PHP Bug Type: Feature/Change Request
Bug description:  ((true) && (true)) to return bool

(true) 
returns a bool while
((true) && (true)) 
returns an int. 
so

(((true) && (true)) == true)
"works" while
(((true) && (true)) === true)
doesnt. 

i really don't like this behavior. 

maybe you can forward also that 
http://www.php.net/manual/en/function.gettype.php 
doesn't document the NULL datatype you get (on null and unset values).

thanx
fab



-- 
Edit Bug report at: http://bugs.php.net/?id=10940&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 #10546: extract() to work with objects

2001-04-28 Thread fabiankessler

From: [EMAIL PROTECTED]
Operating system: all
PHP version:  4.0.4
PHP Bug Type: Feature/Change Request
Bug description:  extract() to work with objects

example:

class foo {
  function foo() {
$var_array = array('hello'=>'world');
extract($var_array, EXTR_PREFIX_ALL, "this->prefix");
echo $this->prefix_hello;
  }
};
$f = new foo();

:)
fab



-- 
Edit Bug report at: http://bugs.php.net/?id=10546&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 #10483: someFunction() OR break;

2001-04-24 Thread fabiankessler

From: [EMAIL PROTECTED]
Operating system: all
PHP version:  4.0.4
PHP Bug Type: Feature/Change Request
Bug description:  someFunction() OR break;

why is the syntax
someFunction() OR anotherFunction();
only possible with a function on the right side of the OR? cause it has to return 
something? 
would be nice to be able to to someFunction() OR break;

example:

$success = FALSE;
do { // try block
  doSomething("foo") OR break;
  doSomething("bar") OR break;
  doSomething("hello") OR break;
  doSomething("world") OR break;
  $success = TRUE;
} while (FALSE);
echo ($success) ? 'yes' : 'no';

greetings
fab



-- 
Edit Bug report at: http://bugs.php.net/?id=10483&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 #10309: feature request

2001-04-12 Thread fabiankessler

From: [EMAIL PROTECTED]
Operating system: all
PHP version:  4.0.4
PHP Bug Type: Feature/Change Request
Bug description:  feature request

$a = 'foo';
$b = 'bar';

$c = (true) ? &$a : &$b;

=> syntax error, have to do

if (true) {
  $c = &$a;
} else {
  $c = &$b;
}

would be nice :)


-- 
Edit Bug report at: http://bugs.php.net/?id=10309&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 #9748 Updated: wrong behavior of is_dir() and is_file() on a dir-link

2001-04-07 Thread fabiankessler

ID: 9748
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: *Directory/Filesystem functions
Description: wrong behavior of is_dir() and is_file() on a dir-link

yes

Previous Comments:
---

[2001-03-20 17:25:17] [EMAIL PROTECTED]
What do you mean with directory link?
A Windows "shortcut" to a directory?


---

[2001-03-14 11:11:38] [EMAIL PROTECTED]
on a directory link, is_dir() returns false while is_file() returns true. 

i don't think this is the desired behavior, is it?

i see that ppl are confused here also
http://www.php.net/manual/en/function.is-dir.php
http://www.php.net/manual/en/function.is-file.php



---


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


-- 
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 #9783: dirname()

2001-03-16 Thread fabiankessler

From: [EMAIL PROTECTED]
Operating system: winnt 4.0
PHP version:  4.0.4
PHP Bug Type: Filesystem function related
Bug description:  dirname()

echo dirname("c:/fuck/abc/");
prints out c:/fuck



-- 
Edit Bug report at: http://bugs.php.net/?id=9783&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 #9780: realpath doesn't return trailing slash

2001-03-16 Thread fabiankessler

From: [EMAIL PROTECTED]
Operating system: winnt 4.0
PHP version:  4.0.4
PHP Bug Type: Directory function related
Bug description:  realpath doesn't return trailing slash

echo dirname(realpath("f:/dir 790/asdf/"));

this prints out "f:\dir 790"
and when you do dirname() on this again, well, ...

the problem is that realpath doesn't return the trailing slash so everything else 
treats asdf as a file

fab



-- 
Edit Bug report at: http://bugs.php.net/?id=9780&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 #9765: syntax request

2001-03-15 Thread fabiankessler

From: [EMAIL PROTECTED]
Operating system: all
PHP version:  4.0.4
PHP Bug Type: Feature/Change Request
Bug description:  syntax request

such a syntax would be nice:

if (getColor() == ['green'|'blue']) {
if (someFunction() != [true&null]) {
if (xy() >= [$x&$y]) {

which means

if ((getColor() == 'green') || (getColor() == 'blue')) {
but saves one call to the function
or

$myCol = getColor();
if (($myCol == 'green') || ($myCol == 'blue')) {
but looks better and saves a temp var.

$tmp = functionThatReturnsBool();
if ($tmp == true OR $tmp == null) {

sometimes it could be done with
if (in_array(getColor(), array('green', 'blue'))) { 
but not always.

fab



-- 
Edit Bug report at: http://bugs.php.net/?id=9765&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 #9748: wrong behavior of is_dir() and is_file() on a dir-link

2001-03-14 Thread fabiankessler

From: [EMAIL PROTECTED]
Operating system: winnt 4.0
PHP version:  4.0.4
PHP Bug Type: *Directory/Filesystem functions
Bug description:  wrong behavior of is_dir() and is_file() on a dir-link

on a directory link, is_dir() returns false while is_file() returns true. 

i don't think this is the desired behavior, is it?

i see that ppl are confused here also
http://www.php.net/manual/en/function.is-dir.php
http://www.php.net/manual/en/function.is-file.php




-- 
Edit Bug report at: http://bugs.php.net/?id=9748&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 #9697: filename ends with £

2001-03-12 Thread fabiankessler

From: [EMAIL PROTECTED]
Operating system: winnt 4.0
PHP version:  4.0.4
PHP Bug Type: *Directory/Filesystem functions
Bug description:  filename ends with £

this prints out 'crap' because is_dir() and is_file() return null instead of a boolean 
if the filename ends with a £.

yes, the file in the example is a valid windows filename.

$fullPath = realpath("c:/{}d% test.txt  {}  _-d°§+@ #ç&()=~^`´'$£");
if (is_dir($fullPath) == null) echo 'crap';

-fab



-- 
Edit Bug report at: http://bugs.php.net/?id=9697&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]