Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Gergely Hodicska
Hi Dan, The error was clear: the file containing the class foo was not found. But before I made my post, I did run your test, just to make sure. It worked fine[1] -- because my include_path is set to look at the current directory first. If you used my sample correctly you should get the same

Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Gergely Hodicska
exceptions thrown during autoload are ignored. And one more thing, this is in the manual: "Note: Exceptions thrown in __autoload function cannot be caught in the catch block and results in a fatal error." I think your explanation makes much more clear what happens, maybe it would worth to up

Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Gergely Hodicska
YOu'd be surprised sometimes ;-) Anyway, exceptions thrown during autoload are ignored. Autoloading is the last resort for the engine to find a class. If the class can not be loaded (file isn't there, exception, autoloader doesn't load a file), then you get the fatal error. This is correct beha

Re: [PHP-DEV] strange autoload behavior

2008-07-09 Thread Gergely Hodicska
Hi Dan, The fact that the class "bar" is not found indicates that your include in the autoload is either totally failing or gathering some other files. Make your life better by specifying the path in the include statement rather than relying on the include_path. You totally missed the point.

[PHP-DEV] strange autoload behavior

2008-07-09 Thread Gergely Hodicska
Hi! I think I found a bug but before posing it to bugs.php.net I would like to ask your opinion. I think the it is not a planed behavior that some errors doesn't "bubble up" from autoload, but at least the error message is misleading. - foo.php: bar

Re: [PHP-DEV] RFC: Dropping Namespace

2007-12-06 Thread Gergely Hodicska
Hi! Especially in a framework context there a lot of options how you can make things more convenient, with convention over configuration for example. In the end it might turn out that a developer doesn't have to type class names that often anymore and the length of such a name gets less impor

Re: [PHP-DEV] ignored patches

2007-12-06 Thread Gergely Hodicska
Hi! Yes, that's my point - 3X faster include opcode is not 3X faster code. Of course if you do this opcode a lot of times, it would be somewhat slower than if you do this opcode just one time. However, the question is how it would influence the whole application? I didn't say that the code wi

Re: [PHP-DEV] ignored patches

2007-12-04 Thread Gergely Hodicska
vserver. And the xdebug profiling result shows me in fact that this additional time seems to be spend in the autoload facility and its require_once calls. OFF: require_once in autoload is not logical to me. Best Regards, Felhő -- PHP Internals - PHP Runtime Development Mailing List To unsubsc

Re: [PHP-DEV] ignored patches

2007-12-03 Thread Gergely Hodicska
Hi! Can you provide some benchmark setups that this could be researched - i.e. describe what was benchmarked and how to reproduce it? I have already played with this topic. If you don't have an opcode cache lazy loading is a good solution: it is worth loading a code only when it is needed. Bu

Re: [PHP-DEV] late static binding php6

2007-11-26 Thread Gergely Hodicska
Hi! Of course, we can't make parent:: reference the parent class of the called one, as it would break BC. As in: class A { } class B extends A { public static function test() { echo get_class(new parent), '-', get_parent_class(); } } class C extends B { } C::test(); // A-A and not B-B Maybe y

Re: [PHP-DEV] web applications architectures comparison

2007-11-21 Thread Gergely Hodicska
Hi! Alexey Zakhlestin wrote: I think a good example of php-technology would be symfony project + caching in memcached With symfony it is worth using Doctrine (a Hibernate-like ORM tool), which has built-in caching possibility. Best Regards, Felhő -- PHP Internals - PHP Runtime Development

Re: [PHP-DEV] late static binding php6

2007-11-20 Thread Gergely Hodicska
Hi! What do you want parent::test() to mean? Because it wasn't. parent::test() means A::test(). 'parent::' means 'parent class of the class where this statement is' in PHP. For B, it's A. When you use parent in your code you generally want to add some plus functionality to the parent class. Bu

Re: [PHP-DEV] Multiple class inheritance

2007-11-19 Thread Gergely Hodicska
That would serve my purpose, as long as i can inherit methods and properties from multiple parents. Sorry if it is off to this list. Sam maybe you should check some PHP mixins implementation: http://www.symfony-project.org/book/1_0/17-Extending-Symfony#Mixins http://www.achievo.org/blog/archives

Re: [PHP-DEV] late static binding php6

2007-11-19 Thread Gergely Hodicska
also that would introduce BC issues. Can you show a use case for BC? Current implementation: The __CLASS__ and the get_class() is the same like in the current PHP version, and the get_called_class() is not yet introduced. Or do I overlook something? Best Regards, Felhő -- PHP Internals

Re: [PHP-DEV] late static binding php6

2007-11-19 Thread Gergely Hodicska
As I and several others proposed earlier the best option would be: parent::method() thinks it is the same class as a caller ClassName::method() thinks it is ClassName Yes, this would be the logical behavior for me too. Best Regards, Felhő -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] late static binding php6

2007-11-19 Thread Gergely Hodicska
Actually, I don't think it was. If you want objects, why not use the real thing? Just consider that ZF's initial concept was for ActiveRecord a code which needs LSB. "more complex" is not always better. Did you find my code example "too" complex? I think if LSB is added to PHP there will be a

Re: [PHP-DEV] late static binding php6

2007-11-18 Thread Gergely Hodicska
Hi! this very subject was already discussed in a thread months ago. I have read the thread about it, but I didn't find a conclusion (maybe I missed it). Basically, it's a matter of choice whether fully established calls should break the resolution or not. I think the code I sent is an absol

Re: [PHP-DEV] late static binding php6

2007-11-18 Thread Gergely Hodicska
Hi! I read this thread, and I would like to ask if is there any decision about the behavior of inheritance? I wrote on my blog about late static binding (http://blog.felho.hu/what-is-new-in-php-53-part-2-late-static-binding.html), and I came up with the following example: In think it w

Re: [PHP-DEV] Bring back call-time pass-by-reference

2007-11-17 Thread Gergely Hodicska
Hi! some of them might need to modify one array the other needs to modify two arrays... But every function knows the number of its own arguments, isn't it? array otherwise func_get_args will butcher your references. This behavior has nothing to do with the call-time-pass-reference settings,

Re: [PHP-DEV] Bring back call-time pass-by-reference

2007-11-17 Thread Gergely Hodicska
Say, you have a CMS which generally calls some kind of functions and some of them might need to modify one array the other needs to modify two arrays... Currently you need to wrap these into a "arguments" array otherwise func_get_args will butcher your references. In PHP6 allow_call_time_pass_ref