[PHP] Re: [PHP-DEV] PHP 5.3.7RC1 Released for Testing

2011-06-16 Thread Frédéric Hardy
is http://svn.php.net/viewvc/php/php-src/tags/php_5_3_7RC1/NEWS?revision=HEADview=markup. The previous link is about 5.3.4RC1. Best regards, Fred. -- Frédéric Hardy : Architecte d'application/Admin. système/Ergonome

[PHP] [PHP5] How to knwo object class name in a function called statically ?

2004-10-07 Thread Frédéric Hardy
Hello - I have this code : abstract class foo { private __construct() {} public static getInstance() { static $instance = null; if (is_null($instance) == false) return $instance; else { $class = __CLASS__; return new $class(); }

[PHP] Apache 2 and php 5 compatibility

2004-09-23 Thread Frédéric Hardy
Hello - I known that using apache 2 with php 4.x is not a good idea, because some php library are not compatible with multi-threading. But php 5 ? Best regards, Fred - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] A somewhat faster alternative to is_dir and is_file?

2004-09-09 Thread Frédéric Hardy
You can try directoryIterator and recursiveDirectoryIterator in php5. I don't know if they are more faster than your solution (it seems to me that these extension are written in php, not in C, but portage to C is in todo list), but they do exactly the same thing than your class. Is it really a

[PHP] [PHP5] paradox ? Bug ?

2004-09-03 Thread Frédéric Hardy
Hello - I think there is a bug or a paradox in the php 5 object model implementation. This is an example : ?php class foo implements arrayAccess { private $array = array(); function __construct() {} function __get($key) { return $this-offsetGet($key); } function

Re: [PHP] Re: [PHP5] paradox ? Bug ?

2004-09-03 Thread Frédéric Hardy
. Frédéric hardy wrote: Hello - I think there is a bug or a paradox in the php 5 object model implementation. This is an example : ?php class foo implements arrayAccess { private $array = array(); function __construct() {} function __get($key) { return $this-offsetGet($key

Re: [PHP] Re: [PHP5] paradox ? Bug ?

2004-09-03 Thread Frédéric Hardy
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

Re: [PHP] [PHP5] paradox ? Bug ?

2004-09-03 Thread Frédéric Hardy
Marek Kilimajer wrote: See recent discusion on this list about this behavior. You can find it in the archives if you look for __isset. I know, I am the author of this recent discussion. Current discussion is an extension. echo (isset($foo-array) == true ? 'array is set' : 'array is not set');

Re: [PHP] Is a PECL a black whole?

2004-09-03 Thread Frédéric Hardy
What is PECL ? PECL is a repository for PHP Extensions, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions. The packaging and distribution system used by PECL is shared with its sister, PEAR. ... Is it clear ? It is the same

Re: [PHP] Re: [PHP5]__get, __set and isset()

2004-09-01 Thread Frédéric Hardy
, Catalin Frédéric hardy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yes but not :-). With you use these magic functions, when you write $o-a = 'foo', you create a property in the object. Not ? Even if it is stored in an array member, __set() create a property and __get

Re: [PHP] How to Select multiples tables of different database in one query

2004-09-01 Thread Frédéric Hardy
Not difficult : database db1 database db2 database db3 select db1.table3.column2, db2.table5.column1, db3.table1.column7 FROM db1.table3, db2.table5, db3.table1; You can use alias in FROM on table like this : select alias1.column2, alias2.column1, alias3.column7 FROM db1.table3 AS alias1,

Re: [PHP] How to Select multiples tables of different database in one query

2004-09-01 Thread Frédéric Hardy
Warning 2 : it is a mysql example. Whith other DBM, i don't know how to do that, but i think that its exactly the same thing. PHP version : mysql_query($query). Fred. Tariq Murtaza wrote: *Hi All,* Can someone elaborate on How to Select multiples tables of different database in one query,

[PHP] [PHP5]__get, __set and isset()

2004-08-31 Thread Frédéric Hardy
Is it possible to do something like this : class foo { private $array = array(); function __construct() { ... } function __get($key) { return (isset($this-array[$key]) == false ? null : $this-array[$key]); }

Re: [PHP] Re: [PHP5]__get, __set and isset()

2004-08-31 Thread Frédéric Hardy
Bug Id is 29917. Fred. Daniel Schierbeck wrote: Frédéric hardy wrote: Is it possible to do something like this : class foo { private $array = array(); function __construct() { ... } function __get($key) { return (isset($this-array[$key]) == false ? null

Re: [PHP] Re: [PHP5]__get, __set and isset()

2004-08-31 Thread Frédéric Hardy
Yes but not :-). With you use these magic functions, when you write $o-a = 'foo', you create a property in the object. Not ? Even if it is stored in an array member, __set() create a property and __get() retrieve its value. Doc says : The $name parameter used is the name of the variable

Re: [PHP] Re: [PHP5]__get, __set and isset()

2004-08-31 Thread Frédéric Hardy
But there is no property set to NULL !! Fred. M. Sokolewicz wrote: next time, please read the isset documentation carefully. I quote: [quote]isset() will return FALSE if testing a variable that has been set to NULL.[/quote] Catalin Trifu wrote: Hi, Is this really a bug. I think not.

[PHP] PHP5 : __sleep() and __wakeup()

2004-08-12 Thread Frédéric Hardy
Hello ! I have a problem with __sleep() and __wakeup() with php 5.0.0. if you have a class like that : class foo { private $var = 'var'; function __construct() { ... } function __sleep() { return array('var');

[PHP] PHP5 : __sleep() and __wakeup()

2004-08-12 Thread Frédéric Hardy
Hello ! I have a problem with __sleep() and __wakeup() with php 5.0.0. if you have a class like that : class foo { private $var = 'var'; function __construct() { ... } function __sleep() { return array('var'); } function wakeup() { } } and

Re: [PHP] A function in PHP that changes html in a string from p align=center to p align=center ?

2004-08-12 Thread Frédéric Hardy
str_replace('p align=center', 'p align=center', $string) However, align argument is deprecated in last version of html. Use css instead. Best regards Fred raditha dissanayake wrote: SED wrote: Is there any function in PHP that changes html in a string from p align=center to p align=center ? (e.g.

Re: [PHP] PHP5 : __sleep() and __wakeup()

2004-08-12 Thread Frédéric Hardy
I'am using php 5.0.0 release. Try this : var_dump($test); var_dump(unserialize(serialize($test))); You should obtain something like that for fist var_dump : object test string test - 'var' and for the second var_dump : object test string test - 'var' string test - null

Re: [PHP] Request form duplicate names

2003-12-19 Thread Frédéric HARDY
Try input type'checkbox' name='id[]' value='1' So in your script : $ids = $POST['name']; $first_id = $POST['name'][0]; Best regards, Fred === Frederic HARDYEmail: [EMAIL PROTECTED] HEXANET SARL

[PHP] openssl_private_encrypt problem !!

2003-12-16 Thread Frédéric HARDY
Hello ! This is my code : ?php #GET PRIVATE KEY PREVIOUSLY GENERATED $private_key = openssl_get_privatekey('file://path_to_private_key', 'mypassword'); $data = abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx yzabcdefghijklmnopqrstuvwxyzabcdefghijlm