[PHP-DEV] new construct
Hi, I need to know which is the correct new construct: class_name or __construct. From Zend_Changes: The Zend Engine 2.0 introduces a standard way of declaring constructor methods by calling them by the name __construct(). ... For backwards compatibility, if the Zend Engine 2.0 cannot find a __construct() function for a given class, it will search for the old-style constructor function, by the name of the class. But: ?php class A { function __construct() { echo into A::__construct(); } function A() { echo into A::A(); } } $a = new A; ? and /usr/local/php5-230202003/bin/php test.php give this result: into A::A() And this is not correct, or not ? tnx -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] buildconf warning
From today's cvs using default Zend directory buildconf: checking installation... buildconf: autoconf version 2.53 (ok) buildconf: Your version of autoconf likely contains buggy cache code. Running cvsclean for you. To avoid this, install autoconf-2.13 and automake-1.5. buildconf: automake version 1.6.3 (ok) buildconf: libtool version 1.4.3 (ok) rebuilding configure rebuilding acconfig.h rebuilding main/php_config.h.in WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot' WARNING: and `config.h.top', to define templates for `config.h.in' WARNING: is deprecated and discouraged. WARNING: Using the third argument of `AC_DEFINE' and WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without WARNING: `acconfig.h': WARNING: AC_DEFINE([NEED_MAIN], 1, WARNING: [Define if a function `main' is needed.]) WARNING: More sophisticated templates can also be produced, see the WARNING: documentation. autoheader: `main/php_config.h.in' is created bye -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] buildconf warning
Il mar, 2003-02-25 alle 18:13, Magnus Mb@) ha scritto: This is because you are running autoconf version 2.53 (which is buggy). Downgrading to 2.13 will remove those warnings. Tnx. -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Why parent::construct not called?
Hi, why if I have class B extends A { } the only way to call in automatic the A::__construct() is to not write the B::__construct() ? Ok, this is the design of PHP. But why ? tnx -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Why parent::construct not called?
Il dom, 2003-02-23 alle 17:32, Marcus Börger ha scritto: You can do the following: class base { function __construct() { echo base::__construct()\n; } [...] I know know. What I want to understand is why the base::__construct() is called (in automatic) only when derived::__constuct() is missing. I think that or the base::__construct() is always in automatic called or it is always never called (in automatic). bye -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Why parent::construct not called?
Il dom, 2003-02-23 alle 18:07, Marcus Börger ha scritto: In ZE2 each class has a constructor. That constructor can be overwritten by writing a method named __construct. So far so good. Ok... This is the design.. tnx. -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] no construct called
Hi, I have this code: ?php error_reporting(E_ALL); class esempio { var $pubblica; private $privata = Io sono privata; var $protetta = Io sono protetta; /*function esempio() { echo sono in esempio::esempio()br\n; } */ function __construct() { echo sono in esempio::__construct()br\n; $this-protetta = I'm protect; } function exe() { echo sono in exe()br\n; echo $this-protetta; } } class exe extends esempio { function __construct() { echo sono in exe::__construct()br\n; } function exe() { echo sono in exe::exe()br\n; } function ex2() { echo sono in exe2()br\n; echo \$protetta: .$this-protetta.br\n; $this-exe(); } } $n = new exe; $n-ex2(); ? This is the output: sono in exe::exe() sono in exe2() $protetta: sono in exe::exe() Why not __construct() of esempio class is called? If I have two construct (__construct() and exe() ) is ok that exe() is called and not __construct() (of class exe) ??? I'm using php5-cvs of 19 Feb 2003. Tnx in advance. -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] no construct called
Il sab, 2003-02-22 alle 14:57, michel 'ziobudda' morelli ha scritto: Hi, I have this code: Hi again. In my script I have noticed that if I write: protected $protetta = Io sono protetta; the function function ex2() { echo sono in ex2()br\n; echo \$Protetta: .$this-protetta.br\n; $this-exe2(); } works (it writes $Protetta: Io sono protetta), but if I write var $protetta = Io sono protetta; the same function write only $Prottetta: I think that If I do not declare $protetta like protected it is pubblic so it is usable from extend classess and other script. Why not ? Here the new script: ?php error_reporting(E_ALL); class esempio { var $pubblica; private $privata = Io sono privata; //var $protetta = Io sono protetta; protected $protetta = Io sono protetta; function esempio() { echo sono in esempio::esempio()br\n; } function __construct() { echo nel costruttore di Abr\n; } function exe2() { echo sono in exe2()br\n; echo \$Prottetta: .$this-protetta.br\n; } function __destruct() { echo brio sono il distruttore di esempio; } } class exe extends esempio { function __construct() { echo sono in exe::__construct()br\n; } function exe() { echo sono in exe::exe()br\n; } function ex2() { echo sono in ex2()br\n; echo \$Protetta: .$this-protetta.br\n; $this-exe2(); } function __destruct() { echo brio sono il distruttore; } } $n = new exe; $n-ex2(); ? -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] cvs checkout
cvs checkout: move away php4/TSRM/tsrm_win32.h; it is in the way why this ? tnx -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Libtool for RH8
Hi, i have downloaded the new cvs version of php5, but: buildconf: libtool version 1.4.2 found. You need libtool version 1.4.3 or newer installed to build PHP from CVS. make: *** [buildmk.stamp] Error 1 where I can find it ? there is no update for redhat for libtool 1.4.3 tnx -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Invalid argument supplied for foreach()
Compiled today CVS version of php5. when I do 'make install' I get: Installing PEAR environment: /usr/local/php5-19022003//lib/php/ Warning: Invalid argument supplied for foreach() in /home/httpd/html/PHP/php5/pear/PEAR/Common.php on line 1165 [MORE AND MORE] bye. -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] session_set_save_handler and session_start
Hi, I'm tryng new possibility to set a session handler via class: session_set_save_handler(array($hnd, open_session), array($hnd, close_session), array($hnd, read_session), array($hnd, write_session), array($hnd, destroy_session), array($hnd, gc_session) Now, I'm using this read_session (into class): function read_session($sessionid) { $query = select value,last from session where id = '.session_id().'; $this-dbms-Exec_Query($query); //think the result like 'id|i:0;' if ($this-dbms-ReturnNum() == 0) { $session_exist = false; } else { zb_debug(session exist); $session_exist = true; $session = $this-dbms-ReturnNextObject(); zb_debug(value of session is .$session-value); $expire = session_cache_expire(); if ( ($session-last + $expire) time() ) { zb_debug(Session expire); zb_debug(delete from DB); $query = delete from session where id = '.session_id().'; $this-dbms-Exec_Query($query); zb_debug(session deleted); //La sessione è scaduta. $this-session_exist = false; } else { session_decode($session-value); var_dump($_SESSION); /** this is the result: array(0) { } ERROR! */ } } return true; } Why the session_decode give me an empty array ?? I'm tring session_start() session_set... but the result is that my handler is ignored so I'm tring session_set... session_start() but the result is an empty _SESSION array. Where is my error ? I have see the possibility to make a session-handler vie class into tests directory so I have thinked that this is a php5 problem (or a my problem with php5). Using cvs via cvs -z3 -d :pserver:[EMAIL PROTECTED]:/repository -z3 co php5 and with this configure: ./configure --with-apxs2=/usr/local/httpd-2.0.43/bin/apxs --prefix=/usr/local/php5-`date +%d%m%G`/ - -with-openssl --with-zlib --with-bz2 --with-gd --with-mysql --with-xmlrpc Tnx in advance for all. -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Ok, I'm stupid but why..
... it does not work: ?php class FooClass { function bar() { print foobar\n; } function foo() { $this-bar(); bar(); } } $obj = new FooClass; $obj-foo(); ? with these CVS: cvs -z3 -d :pserver:[EMAIL PROTECTED]:/repository -z3 co -rPHP_4_3 php4 cvs -z3 -d :pserver:[EMAIL PROTECTED]:/repository -z3 co php5 cvs -z3 -d :pserver:[EMAIL PROTECTED]:/repository -z3 co php4-ze2 and this configure: ./configure --with-apxs2=/usr/local/httpd-2.0.43/bin/apxs --prefix=/usr/local/php5-`date +%d%m%G`/ - -with-openssl --with-zlib --with-bz2 --with-gd --with-mysql --with-xmlrpc Ok, I'm stupid, but where is my error ??? plz. -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Ok, I'm stupid but why..
Il mar, 2003-02-04 alle 16:58, michel 'ziobudda' morelli ha scritto: ... it does not work: [snip] cvs -z3 -d :pserver:[EMAIL PROTECTED]:/repository -z3 co -rPHP_4_3 php4 yes, with php4 it can not work (is not ZE2) (error in cutpaste). but for the other ? cvs -z3 -d :pserver:[EMAIL PROTECTED]:/repository -z3 co php5 cvs -z3 -d :pserver:[EMAIL PROTECTED]:/repository -z3 co php4-ze2 -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Again scope
Il dom, 2003-02-02 alle 21:31, Maxim Maletsky ha scritto: da http://www.php.net/ZEND_CHANGES.txt ?php class FooClass { function foo() { $this-bar(); bar(); } function bar() { print foobar\n; } } $obj = new FooClass; $obj-foo(); ? Ok, this not works. My cvs is old, very old. Tnx anyway. -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Again scope
? Class Foo { var $foo2; Function Bar() { echo $foo2.\n; print Bar; } Function Bar2() { $foo2=foo2; Bar(); } } $f = new foo; $f-Bar2(); ? give me this error: Fatal error: Call to undefined function: bar() in /home/httpd/html/PHP/test/3.php on line 14 I'm using php-cli from cvs (2 weeks ago). And there is a variable scope (for the class). -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Error from last cvs (php4)
./buildconf ./configure --prefix=/usr/local/php4-27012003 --with-openssl --with-zlib --with-bz2 --with-gd --with-mysql --with-xmlrpc gcc -Iext/standard/ -I/home/httpd/html/PHP/php4/ext/standard/ -DPHP_ATOM_INC -I/home/httpd/html/PHP/php4/include -I/home/httpd/html/PHP/php4/main -I/home/httpd/html/PHP/php4 -I/home/httpd/html/PHP/php4/Zend -I/home/httpd/html/PHP/php4/ext/xml/expat -I/home/httpd/html/PHP/php4/TSRM -g -O2 -c /home/httpd/html/PHP/php4/ext/standard/basic_functions.c -o ext/standard/basic_functions.o echo ext/standard/basic_functions.lo /home/httpd/html/PHP/php4/ext/standard/basic_functions.c: In function `php_simple_ini_parser_cb': /home/httpd/html/PHP/php4/ext/standard/basic_functions.c:2827: `ZEND_INI_PARSER_POP_ENTRY' undeclared (first use in this function) /home/httpd/html/PHP/php4/ext/standard/basic_functions.c:2827: (Each undeclared identifier is reported only once /home/httpd/html/PHP/php4/ext/standard/basic_functions.c:2827: for each function it appears in.) make: *** [ext/standard/basic_functions.lo] Error 1 -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] RFE: trigger_error()
Il lun, 2003-01-27 alle 21:53, Sebastian Bergmann ha scritto: michel 'ziobudda' morelli wrote: is this avaible only into PHP5 ?? Yes. There is a __unset() function? No, there are __get(), __set() and __call() interceptors. Can you explain me this new function ? I have understood that __set() is called when a variable is setted (but this function not setted the variable), but __get and __call ??? Tnx for all and sorry for my bad english. -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Error from last cvs (php4)
Il lun, 2003-01-27 alle 22:03, Andrey Hristov ha scritto: checkout php5 php4 module doesn't work with ZE2. php_4_3 branch works with ZE1 ehmm.. I have get php4 module from cvs. Is this not correct ?? cvs -d :pserver:[EMAIL PROTECTED]:/repository -z3 co -P php4 For PHP5 I get php5 module. Tnx and bye -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] RFE: trigger_error()
Il lun, 2003-01-27 alle 22:06, Sebastian Bergmann ha scritto: michel 'ziobudda' morelli wrote: Can you explain me this new function ? See http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES From that page I read about __set() but I have not understand one thing: $foo = new Setter(); $foo-n = 1; $foo-a = 100; Return me: Setting [a] to 100 OK! Getting [a] Returning: 100 But 'n' Tnx for all. -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] function not found
Hi, I have installed httpd 2.0.43 with php5 (is this ok for development about a book for PHP5? Is this the correct cvs ??). I have a function with an error (this is a my problem) but this is the php-error page: Warning: main(zb_ng/Admin/globals.php) [function.main]: failed to create stream: No such file or directory in /home/httpd/html/zb_ng/test/c_faq/1.php on line 8 but [function.main] is a link to www.php.net/function.main that report: Sorry, no documents matched your search for function.main. Is this a bug ? bye and sorry for my bad english. -- michel 'ziobudda' morelli [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Designing for PHP4 with PHP5 in mind...
Il mar, 2003-01-07 alle 20:15, J Smith ha scritto: You can still use constructors that have the same name as the class, at least for the time being. Just tested it with 4.4.0-dev HEAD and ZE2. If you have both a method with the same name as the class and a method called __construct(), the method with the class name will be used as the constructor and __construct() won't be used at all. Only one thing: where I can found news about this new features ? I read this mailinglist but I have lost the point of the new features. Tnx. Ah, when the php5 ? March ? bye -- MULTA DI 160.000 PERCHE' IL MULO E' PRIVO DI LUCI DI POSIZIONE (Cronaca vera, 1995) -- Michel ZioBudda Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.phpdev.it -- -- Modi eleganti per licenziare una persona: - Mi dica, quanto tempo ha lavorato per noi, senza contare domani? -- Michel ZioBudda Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.phpdev.it -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Designing for PHP4 with PHP5 in mind...
Il mar, 2003-01-07 alle 20:15, J Smith ha scritto: You can still use constructors that have the same name as the class, at least for the time being. Just tested it with 4.4.0-dev HEAD and ZE2. If you have both a method with the same name as the class and a method called __construct(), the method with the class name will be used as the constructor and __construct() won't be used at all. Only one thing: where I can found news about this new features ? I read this mailinglist but I have lost the point of the new features. Tnx. Ah, when the php5 ? March ? bye -- MULTA DI 160.000 PERCHE' IL MULO E' PRIVO DI LUCI DI POSIZIONE (Cronaca vera, 1995) -- Michel ZioBudda Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.phpdev.it -- -- Modi eleganti per licenziare una persona: - Mi dica, quanto tempo ha lavorato per noi, senza contare domani? -- Michel ZioBudda Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.phpdev.it -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Warning in wrong parameter
Hi, I have installed php 4.2.1 and error_reporting = ALL. I write a function called foo() that accept only 1 parameter. Now if I write: ? $result = foo(bar); ? All is ok. If I write: ? $result = foo(bar,bar2); ? All is ok, but for me that is not OK because my function foo() accept only 1 parameters and no 2 o 3 or more. Is there any possibility that PHP return me a warning with the message (e.g.) Warning parameter number for [function name] in [page.php] line [line number] ??? Tnx in advance. And sorry for this stupid question and for my bad english. Happy all. -- Ti desidero, voglio trascinarti a letto, piegarti, farti sudare, prenderti da farti incendiare il corpo... Ti aspetto: Tua, Influenza. -- Michel ZioBudda Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.phpdev.it -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Warning in wrong parameter
Il mar, 2002-12-24 alle 22:20, Eric Coleman ha scritto: AFAIK, it's supposed to allow for more parameters anyway ;) Hmm... I have supposed it... however in C/C++ is the same (thing). Sorry for the stupid question and my best whishes with all my heart for a merry MERRY Christmas. -- Michel ZioBudda Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.phpdev.it -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] php4.3 and zend2
Hi, and sorry for the question: I have lost the cvs string to get last php4-dev with ze2. Does some1 give me it ? tnx and sorry. -- Michel ZioBudda Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.phpdev.it -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] try/catch/throw in php5 ?
any news about an error management in php5 ? tnx -- -- Gli ultimi saranno i primi, ma lo sportello chiude alle 12 -- Michel ZioBudda Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.phpdev.it -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] php 4 and Zend 2
Hi, how can I try php4 and zend 2 ? I'm need it to write a book.. If I need to get the cvs version, how ? other than cvs co php4 is there a possibility to know where php5 go out ? bye and tnx. -- -- Vendo tutto per esaurimento (Insegna in un negozio) -- Michel ZioBudda Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.phpdev.it -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Italian Book on PHP 5
Hi, I'm writing a php's book for italian people. I need to know some info about php 5.0. Any ideal time line ?? Tnx in advance. Ah, how can I get the HEAD cvs ? tnx -- -- Vecchioni da ragazzo si chiamava Jovanotti ? -- Michel ZioBudda Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.phpdev.it -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php