# ereg deprecation?

- Thread: https://externals.io/message/48123
- Original archive: https://news-web.php.net/php.internals/48123
- Started by Michael Maclean on 2010-04-28T18:15:56+00:00
- Messages: 14
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #48123 — Michael Maclean — 2010-04-28T18:15:56+00:00

URL: https://externals.io/message/48123#48123

Hi,
I think I asked this before on IRC, but I've forgotten the answer. I was 
just remembering that the ereg extension was due to be deprecated in 
PHP6 - does this still apply to trunk?

-- 
Cheers,
Michael

---

## #48124 — Michael Maclean — 2010-04-28T18:20:54+00:00

URL: https://externals.io/message/48123#48124 · In reply to: #48123

Michael Maclean wrote:
> Hi,
> I think I asked this before on IRC, but I've forgotten the answer. I was 
> just remembering that the ereg extension was due to be deprecated in 
> PHP6 - does this still apply to trunk?

...and by "deprecated" I of course mean "removed". *Ahem*.

(Thanks Philip!)

-- 
Cheers,
Michael

---

## #48125 — Stan Vassilev — 2010-04-28T18:21:10+00:00

URL: https://externals.io/message/48123#48125 · In reply to: #48123

> Hi,
> I think I asked this before on IRC, but I've forgotten the answer. I was 
> just remembering that the ereg extension was due to be deprecated in 
> PHP6 - does this still apply to trunk?
> 

Deprecated since 5.3, and was to be removed in 6.0. 
In that context, it remains deprecated in all new branches.

Regards,
Stan Vassilev

---

## #48126 — Philip Olson — 2010-04-28T18:36:23+00:00

URL: https://externals.io/message/48123#48126 · In reply to: #48125

> > […]
> 
> Deprecated since 5.3, and was to be removed in 6.0. In that context, it remains deprecated in all new branches.

In related news, how about adding a --disable-ereg configure option soon. And in more related news, the following manual page is relatively new:

 Differences from POSIX regex:
 - http://php.net/manual/en/reference.pcre.pattern.posix.php

Additional words there would also be helpful.

Regards,
Philip

---

## #48580 — Felipe Pena — 2010-05-31T17:09:05+00:00

URL: https://externals.io/message/48123#48580 · In reply to: #48123

Hi,

2010/4/28 Michael Maclean <michael@no-surprises.co.uk>

> Hi,
> I think I asked this before on IRC, but I've forgotten the answer. I was
> just remembering that the ereg extension was due to be deprecated in PHP6 -
> does this still apply to trunk?
>
>
I think make no sense to keep it deprecated.

Here's a patch for undeprecate ext/ereg in 5_3 and trunk:
http://felipe.ath.cx/diff/undeprecate-ereg.diff

Any objection? If no, I'll commit it in soon.

-- 
Regards,
Felipe Pena

---

## #48581 — Mark Skilbeck — 2010-05-31T17:20:42+00:00

URL: https://externals.io/message/48123#48581 · In reply to: #48580

> Hi,
>
> 2010/4/28 Michael Maclean<michael@no-surprises.co.uk>
>
> > […]
> I think make no sense to keep it deprecated.
>
> Here's a patch for undeprecate ext/ereg in 5_3 and trunk:
> http://felipe.ath.cx/diff/undeprecate-ereg.diff
>
> Any objection? If no, I'll commit it in soon.
>

Why does it make no sense? It was clearly deprecated for a reason.

-- 
Mark Skilbeck
mahcuz.com | gtk.php.net | pecl.php.net/cairo | docs.php.net

---

## #48582 — johannes@schlueters.de — 2010-05-31T17:23:48+00:00

URL: https://externals.io/message/48123#48582 · In reply to: #48580

> Hi,
> 
> 2010/4/28 Michael Maclean <michael@no-surprises.co.uk>
> 
> > […]
> I think make no sense to keep it deprecated.
> 
> Here's a patch for undeprecate ext/ereg in 5_3 and trunk:
> http://felipe.ath.cx/diff/undeprecate-ereg.diff
> 
> Any objection? If no, I'll commit it in soon.

I still won't recommend using ereg - the missing binary-safety causes
quite some broken checks ... is there anything that can be done which
can't be done using pcre? If not: Less code to maintain -> less
trouble :-)

johanns

---

## #48583 — johannes@schlueters.de — 2010-05-31T17:25:08+00:00

URL: https://externals.io/message/48123#48583 · In reply to: #48581

> > […]
> 
> Why does it make no sense? It was clearly deprecated for a reason.

The main reason was that PHP 6 was Unicode and ereg ca't be made working
with Unicode. That reason is gone (for now)
(but there are others, see my other mail)

johannes

---

## #48584 — Pierre Joye — 2010-05-31T17:25:28+00:00

URL: https://externals.io/message/48123#48584 · In reply to: #48580

hi,

I don't think we should remove it. The sooner users stop to use ereg,
the better.

Cheers,
--
Pierre


> Hi,
>
> 2010/4/28 Michael Maclean <michael@no-surprises.co.uk>
>
> > […]
> I think make no sense to keep it deprecated.
>
> Here's a patch for undeprecate ext/ereg in 5_3 and trunk:
> http://felipe.ath.cx/diff/undeprecate-ereg.diff
>
> Any objection? If no, I'll commit it in soon.
>
> --
> Regards,
> Felipe Pena
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

---

## #48585 — Lukas Kahwe Smith — 2010-05-31T17:27:18+00:00

URL: https://externals.io/message/48123#48585 · In reply to: #48582

> 
> > […]
> 
> I still won't recommend using ereg - the missing binary-safety causes
> quite some broken checks ... is there anything that can be done which
> can't be done using pcre? If not: Less code to maintain -> less
> trouble :-)


i would still keep it deprecated simply because people should not write new code with ereg, even if we do not have to remove it because of lack of unicode support.

regards,
Lukas Kahwe Smith
mls@pooteeweet.org

---

## #48586 — Adam Harvey — 2010-05-31T17:31:08+00:00

URL: https://externals.io/message/48123#48586 · In reply to: #48582

2010/6/1 Johannes Schlüter <johannes@schlueters.de>:
> 
> > […]
>
> I still won't recommend using ereg - the missing binary-safety causes
> quite some broken checks ... is there anything that can be done which
> can't be done using pcre? If not: Less code to maintain -> less
> trouble :-)

I believe PCRE's generally quicker into the bargain anyway.

We've already told people we're killing ereg, and there are good
reasons to do so regardless of Unicode (lack of binary safety being
the main one, with the needless duplication with PCRE being another).
Let's keep it deprecated and kill it when it makes sense to do so
(next major, or if and when Unicode comes back at some future date).

Adam

---

## #48588 — Felipe Pena — 2010-05-31T21:45:17+00:00

URL: https://externals.io/message/48123#48588 · In reply to: #48582

2010/5/31 Johannes Schlüter <johannes@schlueters.de>

> 
> > […]
> was
> > […]
> PHP6 -
> > […]
>
> I still won't recommend using ereg - the missing binary-safety causes
> quite some broken checks ... is there anything that can be done which
> can't be done using pcre? If not: Less code to maintain -> less
> trouble :-)
>
>
I also won't recommend using ereg, I just thought the unique reason to
deprecate it was the unicode stuff, hence wouldn't make sense to keep it
deprecated... But as there are others motivations, I prefer leave as is too.

-- 
Regards,
Felipe Pena

---

## #48589 — Peter Beverloo — 2010-06-01T05:44:16+00:00

URL: https://externals.io/message/48123#48589 · In reply to: #48588

2010/5/31 Felipe Pena <felipensp@gmail.com>
>
> 2010/5/31 Johannes Schlüter <johannes@schlueters.de>
>
> > […]
> I also won't recommend using ereg, I just thought the unique reason to
> deprecate it was the unicode stuff, hence wouldn't make sense to keep it
> deprecated... But as there are others motivations, I prefer leave as is too.
>
> --
> Regards,
> Felipe Pena

Undeprecating the ereg extension now will not only cause confusion,
because it has been deprecated for quite a while already, but it might
also become a liability if Unicode or any similar non-compatible
system might ever be included in the future.

PCRE simply is faster under most conditions, more consistent and since
a significant part of PHP Developers will also use Javascript, likely
to be more appropriate for the web. Companies and individuals have
been adjusting their scripts in favor of PCRE[1][2][3], undeprecating
the extension seems senseless at this point.

I do think Philip Olson's proposal of adding a compile-time flag for
disabling ereg altogether is a good idea, as it would be the next step
in moving ereg away from PHP's core.

Regards,
Peter Beverloo

[1] https://drupal.org/node/530940
[2] http://bugs.typo3.org/view.php?id=9994
[3] http://www.mantisbt.org/bugs/view.php?id=10974

---

## #48592 — Stas Malyshev — 2010-06-01T17:41:02+00:00

URL: https://externals.io/message/48123#48592 · In reply to: #48588

Hi!

> I also won't recommend using ereg, I just thought the unique reason to
> deprecate it was the unicode stuff, hence wouldn't make sense to keep it
> deprecated... But as there are others motivations, I prefer leave as is too.

I think we have enough reasons to keep it deprecated as we have much 
better alternative (pcre) which we want to recommend to the users.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
