|
There are two ways of looking at that. 1. Full compatibility is absolutely, 100% required, or 2. While there are differences, from a practicality standpoint, they are pretty much the same. I use PCRE a decent amount but I'm drawing a blank on a situation where the difference has been unbearable. That's not to say that it's true 100% of the time but it's never bitten me. Based off of the Wikipedia article it seems like recursion in very specific circumstances are the biggest issue. So, it may not be 100% but it works pretty well.If it is really the full Perl 5 regular expressions, it is very powerful :) Enjoy :D
As for dynamic typing increasing maintenance, I'd have some trouble buying that. In PHP there are 8 data types. Integer, Boolean, Float, String, NULL, resource, object and arrays. Objects and arrays can be "strongly" typed in that you can state that you want an array and not a string, or a particular instance of a class. So you have the ability to build a good structure to virtually any sized application.I am not saying I am _RIGHT_ or anything like that, just that that is - based on my Java experiences with Class.forName instead of using "new" - the large amount of work done by the compiler that makes the program resilient against casual changes.
However, when you deal with the 4 "scalar" types, that is when the dynamic typing occurs. The biggest problem is that (0 == false == null) based off of the type juggling rules and 0, false and null could have different meanings in certain circumstances. But in those cases you can use type sensitivity when you need it by using the === or !== sign. In other words (0 !== false !== null). But once you get into PHP 5 OOP the rules are virtually identical to any strongly typed OO language.That is just because it was emulating Perl and Perl does often do VERY strange things :)
The reason for having these dynamic typing rules is that on the web EVERYTHING is a string. Whether "1" is a string or an integer really doesn't matter that much from a practical standpoint because the browser submitted a string value of 1. There is overhead in having the dynamic typing going on but it makes for very easy to write code.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.