On Mon, Oct 12, 2009 at 05:55:25PM GMT, Carl P. Corliss [rabb...@gmail.com] 
said the following:
> 
> Code Search of: "eregi?(_replace)?\( lang:php" shows ~123,000 results
> Code Search of: 
> "preg_(filter|grep|last_error|match_all|match|quote|replace_callback|replace|split)\(
>  
> lang:php" shows ~374,000 results
> 
> Looks like preg_* functions are used more often than ereg* functions to 
> me...

  I think everyone should read this as it will prove my point.
Especially book #9

  I have a O'Reilly Safari Books Online account and can search the
content of many of the latest books, which I consider something more
official than just doing a causual Google search, which can be
misleading.

  The number 1 selling book on Amazon in the PHP category is "PHP and
MySQL Web Development" (4th Edition) from 2008 by Luke Welling and
Laura Thomson.

  There is no mention of preg_match and the book instead shows how to
use ereg based functions.  In fact, they do mention PCRE, but downplay
it by saying that POSIX regexs are easier to use.


 I think any intelligent person would see this as a alarm that the PHP
world isn't ready for ereg to be dropped or changed.  You need far more
time for the information to make its way through the PHP community.


Going further through the list of Amazon's top selling PHP books we
have:

2. The Essential Guide to Dreamweaver CS4 with CSS, Ajax, and PHP (Essentials)

  Ignore this as it isn't really covering PHP properly. 

3. Regular Expression Pocket Reference: Regular Expressions: from 2008

  This states that it covered PCRE expressions for PHP. So at least
  that's right.


4. Learning PHP, MySQL, and JavaScript: A Step-by-Step Guide to Creating
Dynamic Websites from 2009

  Uses examples written with preg_match

5. Web Database Applications with PHP and MySQL, 2nd Edition from 2004.

  Mentions PCRE but says that they will use POSIX expressions instead.

6. Head First PHP & MySQL from 2008/2009

  Talks about preg_match, mentions that ereg is removed in PHP 6.

7. PHP Cookbook from 2006

  Has mixed examples, some using ereg and some using preg_match

8. Practical Web        Practical Web 2.0 Applications with PHP

  Not on Safari

---->  9. Programming PHP by  Kevin Tatroe, Rasmus Lerdorf and Peter
MacIntyre in 2006. Which may be considered the definitive guide to PHP
since Rasmus is a co-author.

  Uses examples with both ereg and preg_match, BUT ereg is used first in
the book and compromises the majority of the section called "Regular
Expressions".  So here is an example of emphasis being placed on ereg
being the more official functions to use.

10. Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems

  Not on Safari

So that's about 4 out of 7 the top selling books on PHP still strongly
use ereg.  I didn't find any mention in the books I read online about
ereg going away.  Some of them supported PCRE more than others. But
obviously there is still a lot of use of the POSIX functions.

These are best selling books on PHP.  So there ARE A LOT of programmers
out there that think that they are doing the right thing using ereg.
Obviously books can't be the authoritative source for functions, but a
lot of times they are used that way, especially when one of them was
written by the author of the language.  Duh!


 So there is my proof. Does anyone still want to dispute me that ereg is
still heavily used and you'll make a lot of users angry if you don't
give them the proper amount of time to make this transition?




-- 
Mark S. Krenz
IT Director
Suso Technology Services, Inc.
http://suso.org/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to