On 1/11/2013 1:17 PM, Stas Malyshev wrote:
Hi!
A function that is related to a zend_function struct could be placed
anywhere, in any file and can be named in any way. Finding it is like
looking for a needle in a haystack, then you add macros.
You can do macros in C++ too, and you can have detached functions too.
And it is perfectly possible to make mess with classes, I have seen it
many times. Thinking that the language would somehow make you write good
code is an illusion. It can help you or fail to help you, but it can
never make you. C has tools to help you, though some of them aren't as
powerful as I would wish for, it still has them.
When I first started with working with the php-core I was doing
everything wrong because it's a big mess, that's what happens with C, it
It has nothing to do with C. Thinking that if PHP core was written in
<insert other language here> you would instantly get what's going on
after 3 minutes looking in the code is, again, an illusion. PHP core is
complex, because it does complex things. It also somewhat messy as any
organic growth project becomes after 15 years. Nothing has anything to
do with the language. You don't need C++ to not put new zend_hash
functions into zend_compile.c. You just need common sense and knowledge
how the project works.
That's true, but you can't put a method on a ZendHash class without
defining it within the class definition. I forget that C++ does let you
actually implement that function outside of the class definition, but
it's not a method of the class if it's not in the class definition.
I've gotten too use to the way PHP does it where all of the code for the
class is within the class definition it's-self, not quite the same as C++.
Can we re-write PHP with PHP? ;)
--
-Clint
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php