RE: [PHP-DEV] regex operators

From: Date: Tue, 14 Oct 2003 17:02:27 +0000
Subject: RE: [PHP-DEV] regex operators
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-4835@lists.php.net to get a copy of this message
On Tuesday, October 14, 2003 11:18 AM, mailto:derick@php.net wrote: > Right, and as George's example already works I see no point in adding > more 'magic' operators that look like Perl to me. What about a match operator? I realize that similar functionality can be achieved with preg_match(), but we could duplicate all operators with functions: if (equals($foo,$bar)) {} instead of if ($foo == bar). Obviously, testing equality is a frequent enough operation that it would be clumsy to not have an == operator. In the same vein, matching against a regex seems like a more frequent operation in web programming than, say bitshifting with assignment ala the <<= and >>= operators. Which is why I think it could be a useful addition. David

« previous php.internals (#4835) next »