![]() |
|
|
|
|
|
|
2
18th December 16:18
External User
Posts: 1
|
IIRC, it was shot down. Use overloading and interfaces to get similar
effects. regards, Lukas -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
3
18th December 16:38
External User
Posts: 1
|
You're right, it was, that's why we have interfaces.
Zeev -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
4
18th December 16:41
External User
Posts: 1
|
create_function() accepts a string, and that string is constructed with
full access to the lexical scope of the creating function, so I'm not exactly sure how it's different. My ML/LISP memory fails me. Since when do we consider moving towards LISP a good thing? ![]() For those odd ends where you really need that, create_function() can do the job for you just as well (before anybody complains that it's cumbersome - GOOD, it's supposed to be, you're not supposed to be creating functions on the fly unless you absolutely have to). Zeev -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
5
18th December 18:15
External User
Posts: 1
|
Hello George,
MB>>>> * Anonymous functions. The real stuff, not just some odd string* MB>>>> passed to create_function(). MB>>> MB>>>There were some others already asking for this, maybe we should at least MB>>>give it a thought if it is doable at all, anybody? 4) Speed/Security. create_function() takes a string which is compiled at run-time. An unnamed function syntax would allow compilation at original compile time thus allowing compiler caching (speed) and prevents from executing modified code which is bad anyways (security). Last but not least for small functions the syntax support leeds to much more readable code, while on the other hand some tools might have trouble with create_function() strings. Best regards, Marcus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
6
18th December 18:20
External User
Posts: 1
|
Hello Zeev,
Exactly. And you can emulate MI with __call(). The only thing we could probably add is delegates to overcome the anti-code-reuse interface aspect. // Some interface interface Printable { function print(); } // A general implementation for the interface class PrintHandler implements Printable { function print() { /* ... */ } } // A standard user class that implements the interface. Typically this is the // reason for MI since often you would just go with a standard impl for the // interfaced code. Actually common with containers (*). class Document implements Printable { delegate Printable $print; function __construct() { $this->print = new PrintHandler($this); } // No need to provide function print here - actually doing so is an error // since tit's body is automatically generated as a call to the delegate: // function print() { // if (!$this->print) throw new Exception("Delegate must not be NULL"); // $this->print->print(); // } } On the one hand this raises the complexity and syntax magic. On the other way it is really elegant and promotes code-reuse which is otherwise a pain with interfaces. (*) Actually the most prominent case is a general Container and a base class in a GUI Framwork. There the desktop and the windows need containers too. So you'd habe an interface to access the container and implement it againa and again...even though you already have it. And if you find a mistake - nobody tells you whether you fixed all incarnations of the code. Best regards, Marcus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
7
6th March 18:19
External User
Posts: 1
|
I am PHP programmer since a time and I wish php to be more closed to a
serious language. I am annoyed by a lot of things in PHP. For example in the following code: <?php while($ch !=3D EOF) $thestring .=3D $ch; print $thestring; ?> I ask you why $thestring is available outside of the while loop. I don't want to be boring but php have serious problems like no-namespaces. It gives headaches to any C programmer. It is PHP created for designers with no programming knowledge or for real programmers. Why not let the graphical webmasters to use other SSI like Escapade (just kiding).Please read : Why PHP sucks (for large systems) Edwin Martin <edwin@bitstorm.org>, PHP Annoyances, I hate PHP, Experiences of Using PHP in Large Websites, Aaron Crane <aaron.crane@gbdirect.co.uk> It is PHP created for average programmers or by average programmers. I don't think so ...maybe it is just oversimplification that leads to excessive complexity ... just saying... -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
8
6th March 18:19
External User
Posts: 1
|
OF>>don't want to be boring but php have serious problems like
OF>>no-namespaces. It gives headaches to any C programmer. It is PHP Because PHP is not C, neither it is Java, Perl, Python, C++, ML, Smalltalk, Lisp, Javascript, Z80 assembler or any other language one was trained into. So to expect that any syntax construct and any pattern you were used to in your favorite language would automatically appear in PHP is a mistake. OF>>Please read : Why PHP sucks (for large systems) Edwin Martin OF>><edwin@bitstorm.org>, PHP Annoyances, I hate PHP, Experiences of Using OF>>PHP in Large Websites, Aaron Crane <aaron.crane@gbdirect.co.uk> Most of it either "my favorite feature X is not there" or "this particular function module doesn't have option X which I need" or "my favorite product is not free". While the first can change and the second may be valid point for specific module developer, it has no relation to PHP being inadequate in general. That's like saying "American cars suck" because they have gear shifting done differently from european ones. Again, I think any feedback (including, and even probably most of all - "sucks" articles) is valuable and provides food for thought, but it doesn't mean that if you are used to particular feature of particular language, like block scoping in C or pointers or <> construct in Perl, it automatically should be in PHP. IMHO, good language can not be built on kitchen-sink principles. PHP has one set of features, $Perl (replace with your favorite language here) has another. Choose what is best to fit your task. OF>>It is PHP created for average programmers or by average programmers. I Well, I'd propose you to leave alone the "by" part - I think discussing qualities of PHP builders is not your purpose and definitely is not mine - but for the "for" part the answer is definitely "yes" - PHP is the language that one can use even if he's not used to read machine code as a lunch-time amusement and has troubles understanding what latest Obfuscated C contest winner code actually does. It is suitable (and reasonably easy) for consumption by average person - and I see nothing wrong with it. -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
9
12th March 12:28
External User
Posts: 1
|
Hi:
It would be nice if PHP could not get tripped up by "<?xml" tags when short_tags is on. http://bugs.php.net/bug.php?id=25987 --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
10
12th March 12:28
External User
Posts: 1
|
Already included, you may have seen this feature used before, <?php :-)
Ilia -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php |
|
| Some other forums that might be of your interest : Php 5 forum, Apache forum, Iis forum, Functions forum, Classes forum, Librarys forum, Bugs forum, Postgres forum, Mysql forum, Paradox forum, Ms sql forum, Configurations forum, Php.ini forum, Problems forum, Scripting forum, Css forum, General forums, Off-topic talk, Links, Extra forums, Php |