6

I was looking at a website that said use of POSIX is dying out in PHP 5.3.

I was also working though a video ISO (from around 2005) that said I should stick to POSIX if I'm new to PHP and have never programmed in Python.

I've read that PCRE is faster than POSIX. I don't what to go hardcore on a regex that's dying out. (I don't have any plans on learning Python for a long while)

POSIX looks quite easy to grasp as I've already been revising it but I don't care for what's easy I want to learn what works better for what I want to do. Which will be string manipulation, verification, & database stuff (once I get to that stage)

what should I learn? please give clear reasons for using either.

Thanks for your time

Glacius
  • 127
  • 1
  • 8

3 Answers3

11

Learn PCRE (preg_* functions in PHP). POSIX regular expressions (ereg*, split functions in PHP) have been deprecated as of PHP 5.3, and should not be used anymore. This is the official recommendation. To quote the manual page:

This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.

mfonda
  • 7,873
  • 1
  • 26
  • 30
9

POSIX is obsolete and is deprecated.

zerkms
  • 249,484
  • 69
  • 436
  • 539
4

If by "POSIX" you mean the baseline, older style of regular expressions -- they are dinosaurs. Skip over them and learn Perl Compatible type regular expressions (which also applies to Python, Ruby, PHP, Java, Javascript, etc etc etc)

If by "POSIX" you mean the baseline compatible OS calls that are compatible over many Unixy operating systems -- these are very very important and not obsolete at all.

I think you mean the former. If so SKIP POSIX / BRE regular expressions -- learn Perl type regular expressions.

IF you mean the latter -- learning POSIX OS Concepts is important. (and I am still learning them...)

the wolf
  • 34,510
  • 13
  • 53
  • 71