Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Derick Rethans
On Thu, 2 Sep 2004, Alan Knowles wrote: > Marcus Boerger wrote: > > >Hello Alan, > > > >juts for the record, you can even __autoload the missing exception class: > > > >php -n -r 'function __autoload($n) { var_dump($n); eval("class $n extends Exception > >{}"); } try { } catch(ExcetpionXYZ $e) {}

Re: [PHP-DEV] [PATCH] #29416 - ob_include

2004-09-01 Thread Derick Rethans
On Wed, 1 Sep 2004, Stuart Dallas wrote: > On Wed, 1 Sep 2004 17:24:33 -0400, Jason Garber <[EMAIL PROTECTED]> wrote: > > Patch didn't come through... > > Odd. I BCC'd it to my archive account and that got the attachment. Oh > well, something had to go wrong. The mailinglist strips all attachem

Re: [PHP-DEV] Directoryiterator / preg_match behavior

2004-09-01 Thread Curt Zirzow
* Thus wrote Aaron Wormus: > > foreach (new DirectoryIterator('.') as $file) { > echo ""; > var_dump($file); > > if (preg_match("/xxx/", $file)){ > // Why is this breaking $file?? > //without even a warning > } > > var_dump($file); > echo ""; > } This

Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Alan Knowles
Marcus Boerger wrote: Hello Alan, juts for the record, you can even __autoload the missing exception class: php -n -r 'function __autoload($n) { var_dump($n); eval("class $n extends Exception {}"); } try { } catch(ExcetpionXYZ $e) {};' dont you think this is a really horrible kludge? and besides

Re: [PHP-DEV] Status of Multibyte support in PHP

2004-09-01 Thread Al Baker
It was just a blanket search. As for bug 29518, I think it is worth fixing at some point in time. You could conceivable build a multilingual site where your "language pack" files were an ini file of key=translated text, and you loaded them at run time. A lot of projects use a PHP file with a php

Re: [PHP-DEV] [PATCH] #29416 - ob_include

2004-09-01 Thread Sara Golemon
> This is my first attempt at submitting a patch so please be gentle :). > *sharpens fangs* > The feature requested in #29416 is something I've wanted to see for a > while, so I decided to have a go at adding it. > Considering the triviality of doing it in user space (the bug report shows the four

Re: [PHP-DEV] [PATCH] #29416 - ob_include

2004-09-01 Thread Stuart Dallas
On Wed, 1 Sep 2004 17:24:33 -0400, Jason Garber <[EMAIL PROTECTED]> wrote: > Patch didn't come through... Odd. I BCC'd it to my archive account and that got the attachment. Oh well, something had to go wrong. Hi All, This is my first attempt at submitting a patch so please be gentle :). The f

Re: [PHP-DEV] [PATCH] #29416 - ob_include

2004-09-01 Thread Jason Garber
Hello Stuart, Patch didn't come through... -- Best regards, Jasonmailto:[EMAIL PROTECTED] Wednesday, September 1, 2004, 3:50:30 PM, you wrote: SD> Hi All, SD> This is my first attempt at submitting a patch so please be gentle :). SD> The feature requested in #2

Re: [PHP-DEV] fputcsv()

2004-09-01 Thread Marcus Boerger
Hello David, as promised i looked at the patch. Besides a small misstake it looks good. But it seems to work different then fgetcsv(). In other words if you write using fputcsv() you are not sure to get the same back with fgetcsv(). Though my current opinion is that fputcsv() is doing it right.

Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Marcus Boerger
Hello Alan, juts for the record, you can even __autoload the missing exception class: php -n -r 'function __autoload($n) { var_dump($n); eval("class $n extends Exception {}"); } try { } catch(ExcetpionXYZ $e) {};' and besides what should the compiler do? Guess what that exception you specified

[PHP-DEV] [PATCH] #29416 - ob_include

2004-09-01 Thread Stuart Dallas
Hi All, This is my first attempt at submitting a patch so please be gentle :). The feature requested in #29416 is something I've wanted to see for a while, so I decided to have a go at adding it. I decided name ob_include described the method by which the function did it's job rather than what i

[PHP-DEV] Directoryiterator / preg_match behavior

2004-09-01 Thread Aaron Wormus
When playing with PHP5 I tried the following code: foreach (new DirectoryIterator('.') as $file) { if (preg_match("/^\./", $file)){ continue; } print "$file\n"; } the result was unexpected, but after an IRC session and reading the manual all became clear. My question is if the

Re: [PHP-DEV] New function request - Variable parsing a string

2004-09-01 Thread Sara Golemon
> Just use double quotes, no need for a function: > > $string = "* {$abc} * {$klm['klm']} * {$xyz->xyz} *"; > echo $string; > He wants to store an UNinterpolated string somewhere (like a DB or text file), then interpolate it at run-time. $sitename = 'php.net'; $username = 'pollita'; $string =

Re: [PHP-DEV] New function request - Variable parsing a string

2004-09-01 Thread Philip Olson
> I don't want to parse variables FROM a string but I want to parse them > INTO a string as described on the page: > > http://ie.php.net/manual/en/language.types.string.php#language.types.string.parsing > > Below a PHP example that shows the function I want. > > > $abc= '123'; > $

Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Ron Korving
Okay, I agree with you on this one. Very weird behaviour by the way.. I didn't know about this. "Alan Knowles" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > aghh.. - the previous example was crap > > The priciple it was try to make was that > > > require_once 'MyExceptio

[PHP-DEV] Re: parse errors when testing for undefined exceptions

2004-09-01 Thread Ron Korving
in your function, you should assume sqlite is present. before calling any functions, have one of the first actions in your script (preferably in some file you include always anyway) be a check on the existance of sqlite. problem solved? "Alan Knowles" <[EMAIL PROTECTED]> schreef in bericht news:[

Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Alan Knowles
aghh.. - the previous example was crap The priciple it was try to make was that require_once 'MyException.php' throw MyException(); then trying to catch MyException leads to a parse error when it's try()'d and not loaded. means we cant lazy load any Exceptions, and save file i

Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Alan Knowles
aghh.. - another crap example: The priciple it was try to make was that require_once 'MyException.php' throw MyException(); then trying to catch MyException leads to a parse error when it's try()'d and not loaded. Regards Alan Alan Knowles wrote: This is a simple example of wh

[PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Alan Knowles
This is a simple example of why making a parse error out of undefined Exception types is going to be very problematic. function test($a) { if (!extension_exists('sqlite')) { return; } try { SQLite::query($a); // parse error!!! - if we dont have sqlite, we dont ha

[PHP-DEV] Very weird behaviour with a neverending recursive function

2004-09-01 Thread Ron Korving
Hi, I've been experiencing very weird behaviour (which I can't seem to reproduce). Nonetheless, I can tell you what happens, and you can decide if this is a PHP5 bug or feature. I wish I could give more information on this, but I can't seem to create a clean situation where this happens. I just ho

Re: [PHP-DEV] New function request - Variable parsing a string

2004-09-01 Thread Herbert Groot Jebbink
Rasmus Lerdorf wrote: >> To speed up a homebuild PHP framework I would like to have a new >> function that expands a string with the PHP variables in it, just like >> how variable parsing is done for a double-quotes string. > http://nl.php.net/parse_str I don't want to parse variables FROM a str