Re: [PHP-DEV] Performance degradation
RL>> So, obviously these opens don't really affect the module version RL>> since they only happen on startup, but they still don't seem right. RL>> I understand ./php-cgi.ini, but .//php-cgi.ini and .//php.ini? RL>> Looks like a missing check there. If this is only for CGI/startup, it is indeed not so important, IMHO. After all, CGI is not a performance-star anyway. RL>> Anybody know what the increase from 85 to 95 brk calls actually tells us? Either increased memory usage or substantial change in memory usage pattern (e.g., allocation of one big object, than freeing and allocation a number of small objects with the same size should generate less brk's then allocating small ones first and then large one). -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Why i believe we need final
MB>> If you want real life examples (and surely it seems you will never MB>> trust me) get yourself a book from scott meyers (going to my I would certainly trust you if you gave me an example. Marcus, I'm not here to personally attack you. I just do not see the value of this feature. If you do - why not enlighten me? I submit that if an idea has a value, there ought to be a way to show others that value - or at least to try it, including providing examples on how this idea should be useful. Referring me to textbooks on OO is not going to prove anything - I had my OO classes and I know what OO is. I just don't see how 'final' can be really useful in PHP - not in OO-textbook theorteical way, but in practice. And I believe there are more people that do think so - otherwise I would have been enlightened already by someone who sees the practical use of it. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute_API.c
Should be fixed now. EK>> > EK>> That makes PEAR installer coredump with the following core: EK>> > EK>> > Doesn't happen to me. What were the arguments? EK>> EK>> You need to remove $PREFIX/lib/php to reproduce on my RedHat 7.3 EK>> box. EK>> EK>> ./configure --enable-debug && make && make install-pear EK>> EK>> Edin EK>> -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute_API.c
EK>> That makes PEAR installer coredump with the following core: Doesn't happen to me. What were the arguments? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Why i believe we need final
MB>> Sure it cannot because insert cannot. The problem and the error you did MB>> above is that you split an operation into two. Your real operation is MB>> insert_with_password and that is different from insert. Again insert is an That's the whole point of OO - to allow overloading the same operation, so even classes that do not know about implementation details could use it. MB>> as a member and not as a base class. Maybe it is now a good thing to MB>> have a generalised container interface and declare insert in the container MB>> implementations final. Highly specialised containers would then inheritd I do not see why should container interface be final. MB>> A class that is derived from a concrete container may in some container MB>> implementations have final functions. For example whatever inherits a fifo Still have no explanation why anyone would need it. Just to disallow overriding "because we can"? I see no added value in that. MB>> If you have another insert implementation in a class than you MB>> missused inheritance. If the operation is different than your derived MB>> class is no for example no longer a fifo. Instead it uses a fifo. Implementation can be different and still be a fifo. That depends on overriding implementation. Again, I still have yet to see any example where the proposed 'final' plays substantial role and not just is there because 'maybe someone might want to use it'. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Why i believe we need final
MB>> Consider you defined a container (list, vector what ever) and want MB>> to derive from it. Then there is *really*no* need to override methods MB>> like "insert" or "remove". You may want to have additional things like MB>> "insert_if" or whatever. But for the container part "insert" must stay as MB>> it is and that requires static binding. Well, if there is *really no need*, why one would override it? Obviously, if one overrides it, there's a need? I don't see why container writer should care if anyone overrides the method. Could you bring a real example where one needs non-overridable methods? Only thing I can think of are various Java security classes (like class loaders, etc.) which if you succeed to override various checking hooks may lead to trouble. But we don't have such things in PHP... For example, what if I want to create "secure container", where insert can be done only after you called password() function for the container with right password? Your 'finalized' container would not allow me to do it. MB>> And here comes "final" as it allows to emulate static binding with MB>> dynamic binding. If you declare a function "final" it is invariant MB>> against inhertance starting from that point in the inhertance tree. In Could you explain what is "invariant against inhertance"? What should happen if I define function with the same name in derived class - is this a compile error? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Reducing the number of system calls for includes
RL>> Well, they require us to be able to uniquely identify a file, they do RL>> not necessarily require us to know the canonical filename. This RL>> could be done in a single stat where we grab the device number and RL>> inode. And if inode of the file changes? Files are still identifies (at least for the user) by filename, not by inode. I know that's little probability scenario, but still... -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ZendEngine2 / zend_object_handlers.c __get __set __call
r not to use it. LB>> In other languages the aim is just to give the developper a way to LB>> 'overload' get set and call using the current class properties and LB>> methods without having to build a new independant context for the LB>> object. I'm still not convinced that 'overloading' regular access is a good thing. As well as I am not convinced, for example, that we need operator overloading - in fact, I'm convinced that we are pretty well without it :) LB>> 1. variables doesn't appear in class definition wheareas the user can LB>>use them. So? Documentation rules. Anyway if you use accessors you probably don't want or cannot define it just as variables. You probably even don't know the variables beforehand. LB>> 2. the absolute need to create a private hashtable to handle variables LB>>the user will use whereas he can't see them. That supposing you want to keep them inside the object. Nothing, however, prevents you from keeping it on disk, in SQL database or any other way developer's vivid imagination can invent. LB>> 3. the absolute need to create a getter for a setter That's not entirely right, but I don't see it as an issue anyway. LB>> 4. the need to recode this system everytime you wan't to use accessors. This point I don't understand completely. What do you mean? LB>> Simple : LB>> LB>> function __get($var) LB>> { LB>> // this is a recursive call to __get() LB>> $temp = $this->someTestValue; And here you get another call to __get, which in turn gets to this line and produces another call to __get, which in turn... Am I missing something? LB>> There no way to mistake. And again 'if', 'for' and 'while' generate LB>> bug when incorrectly used. If you have in docs something that needs 'IMPORTANT' clause, this means there's a well-paved way to a mistake. Otheriwse you wouldn't need any 'IMPORTANT' explanations ;) LB>> The only argument i retain from your response is the performance one. So I feel I must reiterate the second point: current scheme allows *both* total and partial control over the access, at the marginal cost of one hash lookup (you can even write object_get function yourself if you like these names ;) and one variable in __get/__set functions. Your scheme allows *only* total control at the cost of great class slowdown. LB>> What you propose is a way to select variables which will invoque the LB>> __get / __set. That's a good idea but moving them from the object to a LB>> private hashtable destructurate the class conception. Why? I don't see anything destroying class conception in private data. There's a lot of very fine classes having private data. LB>> class Foo { LB>> LB>> var $bar; LB>> LB>> getter $bar {...} LB>> setter $bar($value) {...} LB>> }; LB>> LB>> LB>> This is a feature request :) Well, this was discussed... I'm not sure if there's a way to implement these efficiently, but I'll put it in the 'to think about' box of my brains, and maybe somebody other has ideas about this too. I'd propose you to write a separate cleaner RFC (and check the list archives for similiar proposals and their outcome). -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ZendEngine2 / zend_object_handlers.c __get __set __call
LB>> The way python handle this is just fine and allow much more code magic LB>> in classes. I don't think "more magic" is neccessarily good thing. LB>> The python rule : if we have a __get, __set, __call, we use it. no LB>> more no less. This will: a) slow down *a lot* any class that has accessors b) put all the variable handling on the user (you will have to check *each* access to the class property, with no opt-out). c) make impossible or unclear to work with classes that both have defined variables and have accessors - either we get loops or we get some hard-to-catch magic - you will never know if the access to variable will call accessor or not. LB>> and to be sure this design will be usuable, php would produce 3 LB>> functions with references everywhere: LB>> LB>> object_set($object, $varName, $value) LB>> object_get($object, $varName) LB>> object_call($object, $method, $arguments[]) LB>> LB>> tada ! python way of coding : clean, simple, powerfull within your LB>> favorite web scripting language. I don't know Python ways, but from your explanation is looks to me neither simple, nor clean. As for power, Assembler is powerful too :) That's strictly IMHO, of course. LB>> Of course this thing is possible with the current system but it requires LB>> the following : LB>> LB>> 1 - do not declare 'var $bar' or declare it private (need some more test LB>> for private but not the right solution as the magic requires public LB>> access). Right, accessors are called for undefined properties. LB>> 2 - create a private hashtable which will handle undeclared variables LB>> (because once a variable is set in the object's properties array, __get LB>> and __set won't work anymore with it) Right. That's why you use accessors, not - you don't want variables to be manipulated directly. LB>> 3 - create the __get() method so we can retrieve the variable from the LB>> private hashtable. That you will have to do in any case. LB>> 4 - disable error_reporting(E_ALL) because $object->myvar is not LB>> declared and you can't ask it in your code. That has nothing to do with it - accessor should take care for this, it won't both call accessor and issue warning. LB>> Well, all this will make the code uggly, unclear to document, hard to LB>> maintain, and will take anybody about 3 times the same to develop the LB>> above example... And of course you're limited as you can't call other LB>> variables setters while in __set (same for __get and __call)! I don't see how this would make the code ugly. And I don't see how you could allow to recursively call accessors in your model (BTW, current model could allow recursion in some cases - your should have recursion always prohibited, unless you prevent /by internal PHP means/ accessors from touching variables inside the object at all). LB>> To finish with, i hope you'll teach me advantages of the current LB>> design because i took a look at the zend_object_handlers.c and ... LB>> well ... i really think there's a 5:00 am conception mistake behind LB>> the scene :) I don't think so. Now if you explain what's the problem with it (except for "Python does it other way", which is fine by me but I'm not a Python fan so it says nothing to me but a bit of trivia) I could answer it point by point. LB>> - when will "use()" be implemented (a package attempt i bet) ? What is "use()"? LB>> - get_class_methods() do not return methods array when used on a LB>> namespaced class Submit a bug report with code example. You may also want to copy the report (with code example, if I didn't mention this yet) to the list. This is not only for this, but also for any other things you think are bugs. Code example does great things to syncronize about what is the problem. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c
e abuse, however hard you try - for example, if you write extension to class List, which overrides method getElement() to clean the list, and try to use this extension with function SortList that uses getElement(), you will discover that you are in a big trouble. To prevent people from shooting in their feet 100% is an impossible task. But we can at least not help them too much. MB>> Maybe we decide that for PHP this is not a problem since we simply MB>> ignore this fact what is possible in a loosely typed language. That has nothing to do with loose/strict typing - even in loosely typed language you cannot convert object of class X into object of class Y if there's no relation between classes. That would be just meaningless. MB>> private in B can be used with protocol A if they are public there. It MB>> does not imply that you can use A's protocol without typecasting b to MB>> A. When in this scenario all methods are linked dynamically we have Here I do not see what do you mean by 'typecasting' or why we need one. MB>> In this C++ example dynamic_cast is used for "is_a". When MB>> dynamic_cast(p) returns NULL the variable p is not of type X or MB>> one of it's parent. Well, I think futher we get from dynamic_cast and other C++ niceities, better we are. C++ has unfortunate C past and thus has all kinds of troubles with OO, but this is not the reason to copy all these troubles in PHP. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: sapi/fastcgi
HR>> as neither of them works you can remove both :) What do you mean neither works? I have Zeus/PHP/FastCGI install with PHP 4.2.3 running here, seems working. Am I missing something? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] Redirect on Error
PO>> It sounds like this is where the problem lives. As a reference, PO>> glob() was initially documented about six months ago and sha1() PO>> about six days. OK, I have updated the phpfunc to use new manual structure. The number of undocumented functions is down to 12% now :) -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] Redirect on Error
PO>> Yes, phpfunc updates daily and that is good (although it continues PO>> to say last updated sept. 22). There are documented functions Sept. 22 is code update date (i.e., that's the last time the file structure, etc. changed). I think there indeed needs to be something more clear to state this. PO>> Old: en/functions/{extension}.xml PO>> New: en/reference/{extension}/functions/{function}.xml PO>> PO>> It sounds like this is where the problem lives. As a reference, PO>> glob() was initially documented about six months ago and sha1() PO>> about six days. Oh. Now I see. So each function now has one individual file? I guess that requires update to phpfunc module. I will check into this. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] Redirect on Error
PO>> Just to defend phpdoc a bit, this statistic is based on PO>> a php manual generated on April 25, 2002, which is when PO>> zend.com/manual/ was last updated. Also, missing functions That's not exactly true. The phpfunc is updated much more frequently than the manual (since it takes _a real lot_ of time to build the full manual...) - usually, daily. Also, as far as I understand, the numbers are taken from manual/PHP sources, not from generated manual. So if something is not correct, it's because I messed something up or something changed in the manual and phpfunc script no longer catch it - but not because it's not updated. Can you point to some function that is defined but listed as not defined? Did the manual structure change substantially? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] apache_hooks
What is apache_hooks SAPI module? It looks like it produces errors in my build... And no docs there. What's that? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] on the subject of overloading: __call()
BB>> but there is no way to make equivalent calls using call_user_func() BB>> or call_user_func_array(). you can't use "parent::a_method", BB>> array($this,'parent::a_method'), array(parent,"a_method"), BB>> or array('parent',"a_method"). if you use the literal class name, BB>>call_user_func_array(array(get_parent_class($this),'a_method'), $args); BB>> it doesn't fail, but it's as if you were making a static method call BB>> from outside of an object context - $this is not defined. I fear you lost me here. Is the "a_method" static method or not? If yes - why not pass $this? If not - why do you need $this? I will look into your examples later and respond what I think. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Limitations of the ZendEngine2 Object Model?
PM>> > class Root { PM>> class Nested { PM>>function Nested() { PM>> print("Root::Nested constructed\n"); PM>>} PM>> } PM>> } PM>> PM>> class Child extends Root { PM>> class Nested { PM>>function Nested() { PM>> parent::Nested(); PM>> print("Child::Nested constructed\n"); PM>>} PM>> } PM>> } PM>> PM>> $object = new Child::Nested; PM>> ?> PM>> PM>> If you attempt to execute this script with the PHP 4.3.0 ZE2 alphas (either PM>> 1 or 2), you'll get a fatal error specifying that "Cannot fetch parent:: as PM>> current class scope has no parent", referring to the Child::Nested PM>> constructor and the "parent::Nested();" line. Is the outer classes just But the Child::Nested class doesn't have parent indeed! Child has parent, but Child::Nested doesn't. PM>> meant to be for namespacing purposes? Any class deriving from the PM>> parent will not have its nested classes derive from the parents PM>> nested classes. So then why can't nested classes be extended from PM>> anything? Just some symbolism: P is parent, defines P.n is nested, D It can. You can use "extends" in nested class, AFAIK, just as you do in plain one - just interitance is not inherited (brrr... what a messy phrase) by the nested classes. PM>> extends P, defines D.n nested, yet D.n has no relation to P.n and is PM>> not allowed to extend it explicitly (wouldn't it be implicit, with You definitely can do it explicitly - by saying "extends Root::Nested" in Child::Nested. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] on the subject of overloading: __call()
BB>> related topic: in the current state of ze2, there are several ways to BB>> call methods directly that can't be emulated by call_user_func() - BB>> calling self::method() for instance, or the visibility of $this if BB>> you call class::method(). is that likely to stay true? Since __call is the method of the class, calling self::method can be achieved, I think. As for the second point - could you please explain furher what you mean, maybe with an example? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] problem with EG(uninitialized_zval_ptr)
TCA>> yep - but can we simply move init_executor a bit "up"? I fear it's as "up" as it can be - just the start of zend_activate(). The problem, as it seems, is that some code can be called before zend_activate() - like INI handlers. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] problem with EG(uninitialized_zval_ptr)
TCA>> but zval_ptr_dtor (used in assert.c-OnChangeCallback) checks TCA>> against EG(uninitialized_zval_ptr) - so calling zval_ptr_dtor TCA>> anytime before init_executor will cause an UMR. Actually, zval_ptr_dtor calls zval_dtor, which does much more EG(...) games than just EG(uninitialized_zval_ptr). So I guess calling zval_ptr_dtor before init_executor is unwise indeed... -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] trying to understand zvals
TDJ>> Could you go into a little more depth on the problem, just so I TDJ>> understand? The problem is that passing argument passes only zval *, i.e. pointer to variable itself. To make reference assignment, you need zval **, i.e. the place in the symbol table. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] trying to understand zvals
TDJ>> Sorry, I wasn't clear. I mean ref_assign to be a C function, in my TDJ>> extension. Ah. Then you need to accept the first parameter by reference (this is defined in ZEND_FE definition, put first_arg_force_ref as second parameter). Then you get parameters the usual way (zend_get_parameters_ex, etc.) and have to zval ** variables, something like this: zval **dest, src; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &dest, &src)) { WRONG_PARAM_COUNT; } Then if src wasn't reference, you need to separate it: SEPARATE_ZVAL_TO_MAKE_IS_REF(src); (*src)->refcount++; This will also make src a reference. Then you have to free old value of dest: zval_ptr_dtor(dest); Then assign: *dest = *src; I think this should be enough... Note that refcount is increased before calling dtor - to avoid problems with something like assign_ref($foo, $foo) (it's not wise to do this, but this way it won't crash/produce garbage). -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] trying to understand zvals
TDJ>> Thanks for your response! While it does not cause a crash, your TDJ>> function doesn't do what I expected. Do you know where I went TDJ>> wrong? OK, looking again on the matter in depth, it seems to me that you cannot do it from C function either, due to the way in which parameters are passed in the engine. What you can do is to pass names and then work with symbols tables (either global or local) directly. You'll also have to take care to properly destroy old destination value and properly separate the source value. You can look on ASSIGN_REF opcode in zend_execute.c for example (yes, it's a bit messy, I know). -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] trying to understand zvals
TDJ>> Thanks for your response! While it does not cause a crash, your TDJ>> function doesn't do what I expected. Do you know where I went TDJ>> wrong? You are right, this doesn't work. I'll look a bit more into it... -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] trying to understand zvals
TDJ>> I'm trying to do some extension programming, and I'm pretty confused TDJ>> by the whole zval thing. In particular, references are a little TDJ>> mysterious. If I have TDJ>> TDJ>> $foo = "zonk"; TDJ>> $bar =& $foo; TDJ>> TDJ>> in PHP, what actually happens? Specifically, if I wanted a function What actually happens is that both entries in symbol table with names "foo" and "bar" point to the same zval (having refcount of 2 now) containing string "zonk". TDJ>> that did such a reference assignment: TDJ>> TDJ>> $foo = "zonk"; TDJ>> $bar = "baz"; TDJ>> TDJ>> ref_assign($bar, $foo); // $bar =& $foo; TDJ>> TDJ>> what has to happen in ref_assign? That's problematic, due to the way PHP variables work. The best you can do is something like this: function ref_assign($a, $b) { $GLOBALS[$a] =& $GLOBALS[$b]; } ref_assign("bar", "foo"); That's assuming they are globals. If they are not, I cannot now think of a good way to make variable-binding function. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] auto_prepend_file and auto_append_file
IA>> however creates a problem for people who for whatever reason want to IA>> use file called 'none'. Not to mention the fact that this particular Do you know such people? What is the reason to use filename "none" as a prepend file? IA>> option is not at all supported. My suggestion is that rather then I thought it is supported, by lex parsing none as "". IA>> adding strncmp() for 'none' in addition to existing checks for IA>> auto_prepend_file/auto_append_file values we simply change the IA>> documentation to explain that to disable these options a user should IA>> use "" as their value. And break existing setups? Don't think it's any good... -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] zend_execute function
e>> i have to use zend execute statement into PHP api. how can i use this e>> function to interpret php code? thanks MAX If you need just to execute PHP code, you have eval() in PHP. zend_execute is to be used by Zend engine, and needs various preparations (like, zend_compile, etc.) before it can run. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /ext/standard var_unserializer.re
SB>> /usr/src/php4/ext/standard/var_unserializer.c:1: parse error before '<<' SB>> token I fear that has something to do with your CVS checkout... There's no <<'s in CVS version (and yes, it compiles just fine). -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /ext/standard var_unserializer.re
SB>> > /php4/ext/standard var_unserializer.re SB>> > Log: SB>> > ZE2 compatibility fix SB>> > ## In ZE2 the hash contains zend_class_entry *! SB>> SB>> Please commit an updated version of the re2c output as well. OK, did so. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Let's fork GD!
f>> It only reads the first frame, so it's not really supported, but f>> the point was that there are a lot of GIF images around there f>> (unfortunately), either static or animated. I also hope it dies f>> like BMP, or even the stupid AOL ART format! Well, I think animated GIFs will be a relic very soon, I guess, as soon as Flash support gains more coverage (most of browser do support it), and there's also MNG format which supports animation, though I don't really know its support status. MNG pages says mozilla and konq support it. No info about MSIE. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Let's fork GD!
f>> Agreed with GIF format, look at facelink.com, i'm sure 80% of the f>> pictures uploaded there are from programs and cameras that default f>> to GIF. I'm not really savy with graphics but isn't GIF the only f>> format that allows for animated pictures? If you mean digital cameras, they usually default to JPEG/MPEG. As for animated pictures - does GD support that anyway? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PHP-QA] Supporting Apache 2 with PHP 4.2.0
RB>> Which client library are you using? The bundled one, I think... -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PHP-QA] Supporting Apache 2 with PHP 4.2.0
RB>> Which mysql functions are causing the segfault? I currently have PHP RB>> 4.2.0RC2 + Apache 2.0.35 running on my test machine and PHP 4.1.2 + RB>> Apache 2.0.32 running on a production machine with 1.3.22 on it in RB>> case things go sour. for me, mysql_connect segfaults in gethostname, but I strongly suspect the cause is elsewhere, because the code in question looks completely innocent. I didn't have time yet to investigate it further. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] RE: [PHP-QA] Supporting Apache 2 withPHP 4.2.0
JT>> Will you reply to all those bug reports then? Well, probably I personally not. But how it's related to anything? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] RE: [PHP-QA] Supporting Apache 2 with PHP 4.2.0
JC>> > that apache 2 / PHP 4.2.0 is stable enough for production yet, and JC>> > therefore recommend to drop the apache2filter from the release branch. "If JC>> JC>> I definitely agree that we need to make sure that we do not release a JC>> version we consider stable and have it crashing due to the apache 2 stuff. Actually I personnaly don't think 'we cannot declare it stable' leads to 'we cannot release it'. Why just not say 'Apache 2 support is unstable, use it on your own risk and only if you know what you are doing'? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PHP-QA] Supporting Apache 2 with PHP 4.2.0
DR>> after a little discussion on IRC, we came to the conclusion that it DR>> is not a good idea to say that php 4.2.0 supports apache 2. The DR>> reasoning behind is that we are not even 50% sure if apache 2(.0.35) DR>> works correctly, or that the filter works correctly. This is because Actually, I complied CVS apache2filter with 2.0.35, and it segfaults on some mysql functions. I don't know the reason yet, but what is clear that it's not in the 'working' stage as of now. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] new port
fw>> it to compile (which is not a simple task!), and notice an enormous amount fw>> of bad casting in the code. For example: fw>> fw>> int joe = (ulong) *p; Things like this should be fixed, I think - that's a bug, plain and simple, since ulong and int can have different size, and you get data loss here (unless you are 100% sure *p is fitting int, in which case it should be commented in the code). Can you point out some of the examples where this happens? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Current CVS doesn't build Java module
JT>> This should be fixed now. works, thanks. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Current CVS doesn't build Java module
I try to build Java module with current CVS and it fails to find jni.h. This is no wonder since it somehow omits Java directory in build string: gcc -I/home/frodo/php4/ext/java -I/home/frodo/php4/java/ext/java -DPHP_ATOM_INC -I/home/frodo/php4/java/include -I/home/frodo/php4/java/main -I/home/frodo/php4 -I/home/frodo/php4/java/Zend -I/home/frodo/php4/ext/xml/expat -I/home/frodo/php4/main -I/home/frodo/php4/Zend -I/home/frodo/php4/TSRM -I/home/frodo/php4/java/TSRM -g -Wall -c /home/frodo/php4/ext/java/java.c -fPIC -DPIC -o ext/java/.libs/java.lo That was the build line for java.c. And configure line was: ../configure --enable-debug --with-java=/opt/IBMJava2-13 --with-config-file-path=/home/frodo/php4 --with-libedit Could someone from build persons please take a look on it? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ZendEngine 2
AG>> As in the Engine 2 overloaded classes don't necessarily have a class entry AG>> we have to check out what needs to be done here. Well, I think classes _do_ have class entry - at least, those we might want to use. _Objects_ not necessary have class entry, but classes should have one, at least we might reasonably require that classes used as protocol handlers would have one in class table. That won't prevent them from using overloaded object mechanism - you still can override create_object and put any handler table you want in the object. So I think that code is completely OK. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Build changes - dynamic exports
SS>> Should work fine now Does work fine. Thanks :) -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Build changes - dynamic exports
I have noticed that somewhere after 4.1.2 PHP build process was changed and now PHP does not export dynamic symbols (dlopen on .so that uses PHP/Zend symbols fails). Adding -Wl,-export-dynamic fixes this - at least on Linux - but I want to understand: a) what was the change that brought to it, b) why it was done, was it intentional or just an omission and c) what is the most effective way to fix that? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP audit
JO>> It might be better to work on a separate tree, and later let PHP JO>> developpers merge what parts they want to. Why? Your patches then would bit-rot constantly and you would have to update it even that nothing changes, and risk introducing new bugs in transition. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] the dl() issue
MK>> For them, digging into the guts of the system, installing PHP MK>> extensions there and modifying obscure, Apple-supplied configuration MK>> files is MUCH, MUCH more frightening than just downloading a php MK>> extension, dropping it into the Sites folder in their home directory, MK>> and calling dl("extension.bundle"); in their PHP scripts. Might the solution be in the form of some 'auto-load extension folder'? I.e., folder in which all extensions found there are loaded automatically? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php + cygwin - some more
MB>> datetime.c: In function `php_mktime': MB>> datetime.c:187: wrong type argument to unary minus MB>> gmadjust = -(is_dst ? (int)timezone - 3600 : (int)timezone); MB>> see (int) conversion of timezone -> gmadjust has type int MB>> MB>> datetime.c: In function `php_date': MB>> datetime.c:254: warning: assignment makes integer from pointer without a cast MB>> tzone = (long)timezone; MB>> see (long) conversion of timezone -> tzone has type long MB>> MB>> >>>> i think we can commit this to cvs anyone against? <<<< That's the same issue - timezone is a function in cygwin, and the thing that is meant here is _timezone. However, I don't know how to express this in ifdef-HAVE_THIS_AND_THAT terms. Anyone? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] php + cygwin - some more
Ok, seeing that some people indeed do use cygwin to build PHP, here's report about my achievements: After upgrading cygwin to latest version (1.3.10-1) and all tools there (autoconf 2.52, libtool 1.4e) and checking out latest CVS, it builds. Only problems being: 1. line 187 of datetime.c - complains about timezone, since timezone is defined as function in headers. Changed to _timezone, seems to work. 2. A lot of undefined symbols in XML modules. Rebuilt with --without-xml, since no time to investigate further on this. Besides that, builds php.exe cleanly. Still don't know if and how is possible to build .dll for apache with cygwin. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php + cygwin
AG>> "Everything's possible" :) I just don't think anyone has done it. I see. Generally, the real question is more practical - why it looks for liconfig? Can any of autoconf/configure/libtool gurus give any pointers? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php + cygwin
AG>> I don't think anyone has every compiled PHP with cygwin. But it should be possible? I.e., I don't see why wouldn't it be possible. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] php + cygwin
Did anyone have success in compiling PHP4 with cygwin? For me, configure fails with: checking if libtool supports shared libraries... yes ../ltconfig: Can't open ../ltconfig: No such file or directory configure: error: libtool tag configuration failed Any ideas? Also, what exactly is the procdure of building PHP DLL for Apache, if such thing is possible without Visual? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php 4.1.1 Darwin shared apache builds
DK>> This has been a problem for awhile actually. Someone posted to the DK>> list awhile back the best solution to the duplicate symbol message, DK>> removing an entry of yytext from the zend_language_scanner.c. After DK>> talking with Zeev this proved to be a bit more difficult then DK>> expected (thanks to flex). No, no, no. Not *that* one yytext duplicate symbol message. A ton of duplicate symbol messages for each symbol in .al's. That's what I'm talking about. All libraries get added twice and that drives cc crazy and brings duplicate messages. DK>> As far as the libtool parts go, I am still lost on it. I do know it DK>> needs to have the -flat_namespace define added to the compile DK>> options. Does 4.0.6 version have it? If so, the question is why it got removed. If not, te question is how 4.0.6 libtool works? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] php 4.1.1 Darwin shared apache builds
I have noticed that libtool for PHP 4.1.[01] doesn't build libphp4.so right on Darwin. Actually, it tries to build libphp4.dylib instead, and fails to do even that - first it tries to add all libraries twice and fails with a ton of "duplicate symbol" messages, then if you fix that manually you get .dylib which Apache fails to load with 'unknown reason' error message. If you take libtool from 4.0.6, it works OK and creates .so which runs perfectly for PHP 4.1.[01]. So I guess some bugs were introduced (at least with regard to Darwin) somewhere between 4.0.6 and 4.1. Can anybody shed some light on the matter - what was done on libtool side from 4.0.6 till 4.1.1 and could it break Darwin and what is the most efficient way to fix it? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] C++ in extension?
LK>> Can anybody tell me why I get an "Call to undefined function" LK>> when compiling a module using a C++ compiler (made a small test LK>> - it works fine when renaming the extension to *.c ... ). There LK>> are no make errors. The *only* error is that PHP seams unable LK>> to find the function when compiled using C++. Isn't it possible LK>> to do C++ in PHP extensions?!?!? BTW: I'm using gcc on a Linux LK>> RH7.2 -thanx Yes, it's possible to do C++. I think you should use extern "C" on functions that should be used from PHP, since PHP is C program and doesn't know about C++ name mangling. I think wrapping all PHP macros, function defs, PHP includes, etc. in extern "C" would help. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Content-Encoding vs. Transfer-Encoding in gzip
gzip encoding module now uses Content-Encoding header to sign that the page uses gzip encoding. Mozilla doesn't handle this 100% good (it saves it as zipped, which is not exactly expected behaviour) and they claim Transfer-Encoding is the right header to use for in-transfer encoding. See: http://bugzilla.mozilla.org/show_bug.cgi?id=51852 So, the question is: shouldn't PHP indeed use Transfer-Encoding instead of Content-Encoding? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] [CVS] Memleak when assigning a class being propertyof another class the class
MF>> on shutdown. MF>> MF>> If I remove the reference operator (thus make a copy of the object [which I MF>> don't want]) at any point there is no leak. I guess you've got circular reference case there (it's when variable X references Y which in turn references X or part of X). It's known to cause memory leaks. It's not dangerous since these leaks are auto-cleaned after each request. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Package extension proposal
AM>> > Also, I fear that XML would be too slow for time-critical operation like AM>> > including files on runtime, but I might be mistaken. AM>> Could be possible. AM>> Solutions: AM>> 1.) creating a c-function, which parses the xml-file The problem is that I do not want to create dependency on any XML parser extension, and I do not want to rewrite the parser also. So I guess that this: AM>> 2.) the PEAR-Installer create a package file of the 'your' AM>> format from the XML package file maybe would be better. Let's see what other people think. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate function problems
DB>> I do not know Java. In Perl, namespaces exist, so it's a DB>> completely different ballgame. But even still, it's not the DB>> responsibility of the user to know the inner workings of a DB>> module or package in Perl. If we talking about "how to quick hack PHP engine so that it would suit this-minute needs of someone" - it is not so interesting to me to discuss. If we talk about PHP strategy - it's already accepted that PHP needs namespaces, and there's a work in progress on it, so it's not "completely different ballgame". DB>> function library from the user themselves. Why are you DB>> continuing this argument? Mostly because I have got tens of answers to this thread and only *one single answer* on my package proposal. So if this thread is the place where my voice is heard - I will use it :) -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Package extension proposal
>> PEAR has already a XML-based package file format, which is already used >> for installation and information retrieving. Is it documented somewhere? Also, I fear that XML would be too slow for time-critical operation like including files on runtime, but I might be mistaken. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate function problems
SSB>> Basically, I think we should postpone fixing all of this for the SSB>> ZE2-version of PHP, so we can do it proper. I think this could be done without waiting for ZE2. ZE1 has everything that is needed for this, if only you do not insist on having keyword for it but it is OK with you to use function. Please see my package extension proposal and if you disagree - please tell why. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate function problems
BM>> An E_NOTICE is raised at runtime. I know many people ignore BM>> these, but it is there. That's like saying "I know nobody will hear the fire alarm, because I have switched it off, but I'll still press the alarm button and consider it to be the proper way to report the fire". -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate function problems
DB>> My argument is that some functionality similar to a C #ifdef and DB>> #ifndef is needed. Neither the include_once() nor the if/endif Tell me how, for example, Java or Perl programmers manage to live without ifdefs. DB>> I already pointed out why include_once() is bad. You place the DB>> responsiblity of knowing the inner workings of function libraries on the DB>> user themselves and not the library. This is poor programming. No, not at all. If you talk about library, the only thing user should do is package_load("Library") whenever he needs it. See my package proposal. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Package extension proposal
Below is the proposal for PHP packaging extension. The intentions is for PHP to have the package system kind of like what Perl and other languanges have. The comments and suggestions are most welcome, as usual. Especially the experience with packaging system from other languages. === Name: Package Extensions Draft Version: 1.0 Author: Stanisval Malyshev <[EMAIL PROTECTED]> Goal: Create a system that will allow to create and conveniently handle PHP code "bundles", containing one or more PHP code files bound by the common function. Requirements: The system should: * allow convenient loading of the whole package with the single statement * allow convenient checking if the package is loaded * allow the user to conveniently pack the package and to describe relationships between the packages * this is not meant to replace include() and include_once() but to add functionality that will allow more systematic view on the PHP code tree * the system should sit well with future namespace implementation, allowing packages to use the benefits of the namespaces The system is meant to be implemented as a PHP extension. On the best of my knowledge, it can be implemented without interfering with any existing code and without needing any code modification in any other parts of PHP/Zend. Proposed functions: === package_load("Name") Loads the package with name "Name". The loading is done in the global scope (as opposed to include()). Returns true on success. If the package with this name was loaded, it just returns true, while doing nothing. If the package cannot be found, it returns error. TBD: fatal error or not? package_is_loaded("Name") - Returns true if the package is loaded, false otherwise. package_set_path("path") Sets the package path for looking for packages. The default is the include path. Technology: == Package is located and loaded in the following way: 1. First, the package location name is determined. If the name does not contain :: signs, the package location name is the package name. If the package name contains ::, each :: component is a subdirectory, i.e. Foo::Bar::Baz produces the location name of Foo/Bar/Baz (just like in Perl). 2. Package location name is prepended with each directory in the package path. The '.pdef' extension is added to the path. If a file with such name exists, this is a package definition file, which is parsed according to 3. If not, the '.php' extension is added to the above path. If a file with such name exists, it is considered to be the main file of the package and is included with global scope. This file should require_once the rest of the files. 3. The package definition file has format like the following: Package: Foo::Bar Version: 3.14.15 Requires: PEAR Requires: DB::MySQL Files: boobar.php boo.inc classes/class.A.inc classes/class.B.inc Package: line defines the name of the package, should be the same as is required (as a sanity control measure). Version: is not used in the meantime. Requires: line defines that this package depends on other package, which should be loaded before this package is loaded. This line can be repeated a number of times. Files: line marks the start of the file list. The next lines of the file, until the end, will be package filenames, one per line. The pacthes are relative to the package directory. The files are included (just like include()) in the global context and executed, one by one. It is not recommended to put any global-scope code but definitions and variable definitions into these files. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate function problems
RL>> Stanislav, he does have a point in that it would be a good idea to be able RL>> to create an include file which protected itself from multiple exclusion RL>> instead of relying on the user to use the file correctly. That's what he I'm these minutes finish to write a proposal which is meant to adress some part of this issue. I will post it very soon. RL>> which is which is not great. It would be nice if you could trigger the RL>> include_once functionality from the file being included. I fear this won't sit well with how the engine works... But maybe you won't need this, in fact. I think that this should be done in more systematic way, so that if you include some code bunch, you are sure this and that is defined, without checking each thing by itself. Especially when we talk about functions and classes, which are not the same small change as variables and should be handled more systematically. There still be the cases when you do need such hacks, in one way or another, but I think that a systematic approach to the problem will do better than a hackish 'patch there, fiddle here' approach. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate function problems
DB>> Essentially, to answer your question. include_once() is a very DB>> poor way to write modular code that will be used across DB>> different projects and across different developers. You are Why? DB>> placing the responsibility of not accidentally redefining DB>> function names on the user of the function library or code file DB>> and not on the file itself as it should be and as it is in other DB>> languages such as C. To put it shortly, it's a backwards way of PHP is not C. So PHP can not be "such as C". You are placing responcibility of including a module onto the engine, and that is completely OK with me. I agree that it would be good to have more developed concept of a package and all the hoopla that is going with that - but until then, I see nothing wrong in include_once. DB>> including files and it's a poor programming technique. Why? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate function problems
DB>> where people were attempting to actually redefine a function DB>> name. Brian's patch allows the compiler to encounter the same DB>> function in the same file on the same line and only give a DB>> notice instead of a fatal error. It's not the most elegant Which is not backward-compatible with how PHP behaved until then. That's what I was saying. DB>> solution, but then again, we have no #ifdef and #ifndef as you C DB>> coders do to allow us to properly create function libraries. A lot of languages don't have ifdefs (actually, most of them). A lot of languages do not allow to redefine functions. Still each of these languages allows to create code libraries. Obviously, your implied argument that this is needed to implement libraries is wrong. DB>> If/else could be used to achieve similar results, but from what DB>> I understand, only under a serious performance penalty. Which, DB>> BTW, is very unacceptable. Actually, even now it can be done properly, given: 1. Reusable code (variables) and definition code (function) reside in different files, just like you would do it in C 2. include and include_once is used properly It would be much better if PHP could have a concept of a library package, which would solve a lot of "did I already have this package, and if not, how I import it properly?" questions. Making quick hacks to bend the language into compliance with some hacky way to solve the problem won't do any good in the long run, only bring more problems. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate function problems
BM>> It is not a matter of the functions. If everything were a function or class BM>> ( like Java ) this would not be an issue. But, we have variables and such BM>> in these files that prevent us from be able to trust include_once. Ah. Now I see what you mean. Then the solution would be or use classes, or make functions and variables different includes (since they are anyway different in the function context - former are global and later are not). BM>> And my fix will keep a function from being defined twice. It BM>> will simply also allow people who have become accustomed to BM>> using the language this way to keep doing it. I'm not sure that being allowed to use a language in a buggy way is a right thing to do... This would hide many "double include" errors, and would *not* restore the backwards compatibility - since code that didn't work then would work now with your patch. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate function problems
BM>> include_once as i have already stated is useless inside of a BM>> function. Variables in the file are not global. And, I cannot Why include_once inside a function is different from include inside a function? BM>> include it again with include_once. The example I gave is not BM>> acurate to how we use it. We actually use a variable, not a BM>> define to control the inclusion of a file. Can you explain this further? How comes that include_once is not enough to prevent double include and ensure the function is defined? BM>> The other thing is that backward compatiblity was broken when it BM>> did not have to be. include_once is a *new* function in PHP to BM>> lots of people. There's a backward compatibility and there's a bug-compatibility. The PHP always worked so that you cannot redefine functions once defined (we'll leave ZE2 discussions about function ovverides alone for now). If there was a bug that allowed to do it, it's a logical thing to fix it, not to drag it through versions as if it should be so. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate function problems
BM>> See bug 13616. I see. I think you should really use include_once - I just do not see the reason why not to do it and why patch the code instead. Could you explain? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] New zend_compile.c to solve all of the duplicatefunction problems
BM>> I played with the code in zend_compile.c last night and came up with this BM>> solution. The attached file will only issue a NOTICE for duplicate BM>> functions from the same line and file. It will still issue an ERROR for BM>> duplicate functions of a different file or line number. In either case, I must have missed something, I wasn't following the list last days - how this should be used? I guess this is so that duplicate include of the same file would work? Why is it a good thing? If this was already discussed, please feel free to refer me to the archive. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
BB>> why not => then. imo the parser will easily distinguish array BB>> definition from an expression The last thing we need is symbol reuse. The parser can distinguish a lot of things, the problem is that the human developer would be confused. => has a clear meaning in PHP, adding other meaning to it would have very high WTF factor for the developer. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] curl compiler failed
SH>> I'd expect it to work with all php's above 4.0.8, the only problem SH>> is that if you link PHP 4.0.8 with an older version of CURL this SH>> will cause PHP compilation errors that maybe unforseen, therefore, SH>> to right it truly portable, you need two version checks for each new SH>> piece of code. SH>> SH>> if (phpversion == 4.0.8 && curl_version == 7.9) { SH>> curl_setopt($ch, CURLOPT_SSL_VERIFYRESULT, 1); SH>> } No, I need just: if ($curl_version >= 7.9) { curl_setopt($ch, CURLOPT_SSL_VERIFYRESULT, 1); } And this is way better for one simple reason - it's easy to know which version of cURL CURLOPT_SSL_VERIFYRESULT appeared in. It's pretty hard to know which version of PHP is required for that, unless you are familiar with CVSweb and stuff (or depend on ChangeLog and people really documenting changes in their commit messages - which is not the case, unfortunately). This is also way better for logical reasons - you don't really need PHP 4.0.8 here, you need recent cURL, right? You couldn't care less for PHP version one it supports what you want. Also, imagine this is a stand-alone extension - oops. You need to check version anyway, since it is not linked to any specific PHP release. Won't it be logical to just check what you want to know instead of trying to shave with an axe? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] curl compiler failed
SH>> SH>> Yes, but it also affects the portability of apps when using cURL, SH>> you have to worry not only which php version supports which SH>> features, but also which curl version linked with php supports these SH>> features, this is a real headache. No, quite the opposite - if the only thing you have to worry about would be installed cURL version and not PHP version (or if you could just write something like requires(curl >= 7.7.2) - just like RPM does, for example) - it would be easier. Especially taking into account that generally you hardly know which version of curl which PHP supported - how exactly many people know which constants were in with PHP 4.0.3/cURL without looking into the CVSweb? Probably less than two. That brings us to capabilities discovery and versioning discussion, which deserves its own topic and serious attention, outside this small issue I brought up. Maybe someone has to write an RFC for this. In any case, if you feel that it is absolutely necessary to support this constant in PHP, even though no cURL release still has it, please insert the relevant configure check. It is the real pain to go through three screens of gcc wailings each time and recompile it again just to discover yet another constant missing. (it would be also pretty much pain to have latest CVSes of 10+ packages just to be able to compile CVS PHP, but I talked about this already). -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] curl compiler failed
SH>> Try latest cvs with one of the curl pre-releases (the latest pre SH>> release should work fine). Maybe it is still possible to ifdef such things? Like, support of two more constants is not really so vital for curl usage, and if I have a choice of using unpackaged pre-release possibly-buggy version and get into constant upgrade circle or stay with checked installed release of curl, I would certainly choose the latter. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] cURL does not compile
cURL from CVS does not compile with cURL 7.8. I guess it's because of using new options, etc. Can it be made so that cURL module does not require constant upgrading to latest CVS of cURL? Like, some ifdefs, etc.? Or, if this is impossible, is it possible to update configure also so it would warn that installed cURL is not enough anymore? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Zend engine bug
GS>> echo (2147483649 & 2147483649); GS>> GS>> echo (2147483649 % 5); If you want numbers longer than long, you should use GMP anyway (or should know what you are doing). That unsigned hack, IIRC, was made with the single purpose of enabling working with IPs, etc. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Zend engine bug
GS>> It cannot do this since l (zval.value.lval) is signed. This also means GS>> that other functions using using zendi_convert_to_long() are GS>> busted: modulus and rest of the bitwise implementation. Oh, that's an old weird story. In short, we have two contradicting requirements: 1. We have 'long' type, which is signed long 2. We have requirement to support 32-bit values, such as IP addresses, and bit-wise operations with them. The result is that hack - otherwise (like, if we promoted this to floats, as, for example, arythmetic operators do) you could not handle 32-bit values in no way in the long. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Bug #12841: ++, -- operators does not conert the typeof variable.
>> From: [EMAIL PROTECTED] >> Operating system: FreeBSD 4.3 >> PHP version: 4.0.6 >> PHP Bug Type: Scripting Engine problem >> Bug description: ++, -- operators does not conert the type of variable. The attached patch should cure it. jeroen, are you on it or should I commit this patch? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 Index: zend_operators.c === RCS file: /repository/Zend/zend_operators.c,v retrieving revision 1.114 diff -u -b -r1.114 zend_operators.c --- zend_operators.c2001/08/26 10:30:19 1.114 +++ zend_operators.c2001/09/04 16:12:03 @@ -1443,7 +1443,13 @@ { switch (op1->type) { case IS_LONG: + if(op1->value.lval == LONG_MAX) { + /* switch to double */ + double d = (double)op1->value.lval; + ZVAL_DOUBLE(op1, d+1); + } else { op1->value.lval++; + } break; case IS_DOUBLE: op1->value.dval = op1->value.dval + 1; @@ -1459,8 +1465,14 @@ switch (is_numeric_string(strval, op1->value.str.len, &lval, &dval, 0)) { case IS_LONG: + if(lval == LONG_MAX) { + /* switch to double */ + double d = (double)lval; + ZVAL_DOUBLE(op1, d+1); + } else { op1->value.lval = lval+1; op1->type = IS_LONG; + } efree(strval); break; case IS_DOUBLE: @@ -1492,21 +1504,31 @@ switch (op1->type) { case IS_LONG: + if(op1->value.lval == LONG_MIN) { + double d = (double)op1->value.lval; + ZVAL_DOUBLE(op1, d-1); + } else { op1->value.lval--; + } break; case IS_DOUBLE: op1->value.dval = op1->value.dval - 1; break; case IS_STRING: /* Like perl we only support string increment */ - if (op1->value.str.len==0) { /* consider as 0 */ + if (op1->value.str.len == 0) { /* consider as 0 */ STR_FREE(op1->value.str.val); op1->value.lval = -1; op1->type = IS_LONG; break; } else if (is_numeric_string(op1->value.str.val, op1->value.str.len, &lval, NULL, 0)==IS_LONG) { /* long */ STR_FREE(op1->value.str.val); + if(lval == LONG_MIN) { + double d = (double)lval; + ZVAL_DOUBLE(op1, d-1); + } else { op1->value.lval = lval-1; op1->type = IS_LONG; + } break; } break; -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: base_convert() broken
SB>> Works fine now, thanks! Could you merge this into 4_0_7, SB>> please? OK. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: base_convert() broken
SB>> > No, it's related to me. I added this warning, by request of ... SB>> > hmm, sorry, not remember exactly, I can look up if you want. It's SB>> > a right thing to do - the number is indeed too long to fit long, SB>> > so converting it to long will not give you the right results. SB>> > Actually, the Even More Right Thing To Do (TM) would be for this SB>> > function to switch to floats once you go over long limit, but I SB>> > had not time to do it then. SB>> SB>> Any update on this? See current CVS, I've added a patch that should fix it. Note: the functions like decbin still don't use the zval-ed functions, so they work only on longs as of now. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: base_convert() broken
SB>> > Actually, the Even More Right Thing To Do (TM) would be for this SB>> > function to switch to floats once you go over long limit, but I SB>> > had not time to do it then. SB>> SB>> Any update on this? No, not yet - had no time. This requires some changes over the code, since now it's hardcoded to return long and should return zval instead. I'll try to find some time this week. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] [PATCH] Zend/zend_alloc.c
WF>> When emalloc fails to allocate ZEND INTERNAL MEMORY the current WF>> behaviour is correct, but what if the author of an EXTENSION has a WF>> different idea? Then the author of the extension doesn't use Zend APIs. API is the certain way of defining the behaviour. Using part of the API while refusing to use other parts is generally pretty bad idea. WF>> I faced this problem using odbc with Solid. SQLColAttributes can WF>> return very big number (2147483647) when you ask for WF>> SQL_COLUMN_DISPLAY_SIZE of a LONG VARCHAR and obviously my computer WF>> does not have enough virtual memory. It is not always a wise idea to use MAX_SIZE kind of constants to allocate memory. Some of them can indeed be huge. You should fix you code to not use such constants for memory allocation. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] [PATCH] Zend/zend_alloc.c
WF>> Changing emalloc to return NULLs does not modify the program WF>> behaviour: you (probably) receive a SIGSEGV from the emalloc WF>> caller and the execution terminate. I can't see a big Making such assumptions is a good way to security holes and obscure bugs. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] [PATCH] Zend/zend_alloc.c
JG>> I disagree with this patch. The scenario of not being able to JG>> allocate memory is a fatal error, and the only appropriate JG>> response for php is to exit. If you need other behavior use JG>> pemalloc( which calls malloc if set persistant ). Actually, there's a lot of code in PHP that is based on the assumption that emalloc never fails. If emalloc can return NULLs, all this code should be rewritten. I do not see any point in it and agree with Jason. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: [PHP-CVS] cvs: php4 /ext/standard/tests/serialize 001.phpt
>> Not to be picky, but the smallest number is -2147483648... I didn't want to get the smallest one, I just wanted to add regression test for the bug I've discovered. For it it's not really important. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Serious bug in the serializer's smart_str_print_long
smart_str_print_long does a wrong thing when printing longs. From what I understand, it tries to 'reverse' the number so that it could be printed more easily. The problem here is that number that fits long may not fit long when 'reversed'. So this procedure gives utter trash for big numbers, e.g., 2147483647 is printed as 0(/)(0*.// - which is not exactly what would be expected. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Chora and CVSWeb problems
ZS>> That's why 75% of our users and like 90% of the Web uses it, eh? :) Well, we all know that millions of lemmings can't be wrong, but the fact is that MSIE is pretty crappy browser. The much more sad fact is that the rest of browsers (which makes 2 or 3 of them) are more crappy (some of them order of magnitude more crappy). ZS>> > It does not honour mime types and ZS>> >simply uses the file extension and/or any client-side file type ZS>> >associations. Chora is doing the right thing. On that com.xml URL you It does even worse. It tries to guess file type from the content. I hope somebody will invent some worm that uses this misfeature so that they would finally fix it... -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: [PHP-QA] Re: PHP-4.0.7RC1
ZS>> This is one case in which there's no added value to E_NOTICE - in your ZS>> example, you explicitly don't care whether the variable exists or ZS>> not. There are many cases in which there is an added value in ZS>> E_NOTICE. For example: Agreed. But if we enable it by default, we may actually do a disservice for the user - because the useful cases are lost in the swarm of the unuseful ones. If we want to make them useful, some mechanism of weeding out the "more useful" and burying the rest should be established. Otherwise user just learns to ignore them (as people learned to ignore windows messages and press OK at whatever thing happens). ZS>> You can set any INI entries using ini_set() for a particular script. I I know. That's shaving with an axe - I can do it, but that's wrong thing to do. User should not be encouraged to fiddle with ini_set unless it is absolutely necessary. ZS>> think adding new functions is messy - too many functions in PHP support ZS>> opening URLs (because they're built on top of fopen-wrappers). Well, maybe there is some middle-ground solution. I just see encouraging of ini_set to be wrong. There should be a better way to do it. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: [PHP-QA] Re: PHP-4.0.7RC1
C>> if('foo' == $x){ C>> $secure = true; C>> } C>> ... C>> if($secure){ C>> # do sumthing that needs authentication C>> } C>> C>> This will happily run in E_ALL &~ E_NOTICE whether $x == 'foo' or not. C>> Attacker can then inject $secure in the query string, and it'll apply C>> whether or not $x == 'foo'. This will be caught with error_reporting C>> E_ALL. That's entirely different issue, having nothing to do with notices, but with register_globals and mixing internal and user-supplied variables. The fact that E_NOTICE may in some situation help you to find it is lucky (or, on the second thought, unlucky - it may as well not happen, and you are toast with all your belief in notices) coincidence, nothing more. C>> Yes, average PHP code is full of security or other holes. That's overbroad statement which is just wrong. I can show you a lot of scripts generating a real lot of notices, but having no security hole. Also, note that fixing notice in the above code in the obvious way - changing simple if() to isset and stuff - will shut up your precious notice mechanism, while leaving the hole wide open. Is that what you want? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: [PHP-QA] Re: PHP-4.0.7RC1
ZS>> I consider E_NOTICE as a basic element of good programming ZS>> practices. Unlike register_globals, which simply begs for ZS>> security bugs to Actually, I fail to see why it is so. Let's see two code snippets: if($arr['foo']) { ... do something ... } if(isset($arr['foo']) && $arr['foo']!=false) { ... do something ... } Both have the same function, but the first generates E_NOTICE. Why the first is bad programming practice? How many PHP users would really prefer the second over the first? ZS>> kind of suggestion. That's why I think that adding it to the ZS>> php.ini-recommended is a good first step. However, it would make average PHP code to output tens of warnig, which would be annoying and would hardly be useful in many cases. ZS>> While we're at it, I think that we should also take another ZS>> recommendation from the advisory that brought this mess upon us ZS>> - and turn URL fopens off by default. Well, generally I personally would even go further and make two functions - one for file-only fopen (about 90% of fopen usage?) and another which would open everything and the kitchen://sink. Or make some switch, etc. - configuration option doesn't seem to me fit here, it's not per-server but per-script property if you want URL fopens or not. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Please..
ZS>> "Any technique is acceptable for keeping changes separate - generally, you ZS>> would have to mark changes very clearly for them to be separate. We don't ZS>> want to hard-code the idea that the form must be patches. " ZS>> ZS>> http://www.trolltech.com/products/download/freelicense/annotated.html Actually, CVS branch fits rather nicely here, if one was talking about CVS. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Latest CVS Problem
ZS>> >internet with the latest cvs... ZS>> > ZS>> >> >$file=fopen("http://php.net/","r";); ZS>> >fpassthru($file); ZS>> >?> ZS>> >Will produce "Segmentation Fault (core dumped)" There was a bug in URL fopen some days ago. Should be fixed in current CVS. I can't check it since I didn't update to current CVS yet, but generally the patch that looks like it should fix it was committed some days ago :) -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: The new $_GET/POST/ENV
JG>> How about $_COULDCONTAINSHELLCODE? Well, also $_BIGSECURITYHOLE, $_HACKMEHARDER and $_0WNM3P13453P13453... Let your imagination go wild. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: gmp_init with a base argument
TA>> OK. Here is a suggestion for an adjustment in math.c. The patch TA>> could probably be improved: The check for strings with more than TA>> 31 chars should probably be less hard-coded, but I'm not sure TA>> which contant to use for determining maximum size of a LONG. I have made a bit more general patch, see CVS of math.c -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: gmp_init with a base argument
TA>> Does the lack of comments mean that I may commit the patch? (I think TA>> that I still have CVS access.) I was pretty busy last week, sorry, so I couldn't look at it thoroughly. But on the quick glance your patch looks OK. TA>> By the way: TA>> I think that the decbin() function should bail out if you pass it a TA>> value which contains more bits than PHP is able to handle. - Perhaps TA>> with a hint about using GMP for large numbers. I'd say "give a warning" istead of "bail out", but that's a good idea, generally. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> 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 dies on URL fopen
Recently, PHP started to segfault for me on URL fopen, e.g.: fopen("http://www.host.com","r";) brings immediate segfault. Investigation showed that the problem happens in php_sock_fgets_internal (file fsock.c), in the first SEARCHCR() statement and is because when sock parameter is passed to php_sock_fgets_internal, both readbuf and readpos are 0, and SEARCHCR does p = READPTR(sock), which makes p be 0 too, and then uses *p != '\n' as a condition. Could anybody who know the code look at this and check what has gone wrong? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: midgard, was RE: [PHP-DEV] Legal solution: RE: [PHP-DEV] Non-GPL readline
SL>> If (a) is true then I could GPL my copy of PHP and then use and SL>> GPL-non-LGPL code I liked You can not GPL PHP code - that's not your code, you don't hold a copyright on it. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] extension not shutting down on each request
GK>> It seems that on termination of a script the GK>> PHP_MSHUTDOWN_FUNCTION is not called. MSHUTDOWN is called on the module shutdown (i.e., engine shutdown), RSHUTDOWN - on the request end. GK>> However the doc at www.zend.com says : GK>> GK>> "... As dynamic loadable modules are loaded only on page GK>> requests, the request shutdown function is immediately followed GK>> by a call to the module shutdown handler (both deinitialization GK>> events happen at the same time)... " I guess this is related to modules loaded with dl() function. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DEV] Am I still subscribed
CN>> Not that it may be the same thing, but I had my server setup for CN>> ORBS RBL and somehow the lists.php.net server got on that list. CN>> I'm not even sure if ORBS is active. ORBS is officially dead. Moreover, one of the 11 ORBS nameservers now returns positive identification for every address. Use other relay checkers. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Zend engine: unresolved external _zend_assign_to_variable_referen ce?
MB>> I want the fieldname to be a true reference to the value, so MB>> if I modify dbx_result->data[0][0] (in a php-script, I mean), MB>> and access it through dbx_result->data[0]['fieldname'], I MB>> want to get the modified value. When you build the result hash, use the same zval * in both places (don't forget the right refcount), it should work. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Strange printf
LP>> IMHO, I think this is an artifact of PHP only supporting _signed_ LP>> integers. But printing signed binary numbers or octals, etc. is pretty meaningless - at least, I fail to see any use of it and no printf I know ever did that. This also doesn't exactly works right - thus I ask, would it be OK to remove it or anyone here uses this feature and objects to it? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] more printf oddity
I have also noticed that all values in functions php_sprintf_append*int are converted to int, though they were originally long. I know that on some systems (like Linux ix86) int == long, but I'm not sure we should mix those two types. Does anybody has an explanation for this? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]