creating a new operator

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

creating a new operator

Post by evilcoder »

Hey guys,

Just wanted to know if it were possible to use "define" or something of the like to create a new operator?

I want something like this:

Code: Select all

define ( "not" , ! , true );
So i can construct text based arguments:

Code: Select all

<?php
   if ( not $x )
   &#123;
      return false;
    &#125;
?>
Thanks guys
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

AFAIK, no... you'd need to modify the PHP core to have that.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Maybe creating a new function and setting a cookie/session?
Post Reply