How can I create a new operator in PHP?

Viewed 3444

I see myself doing the following code for default assigment all the type on PHP

$variable = $variable ? $variable : 'default value';

I know that with 5.3 I can do

$variable = $variable ?: 'default value';

I would like to further simplify it by being able to just do

$variable ?= 'default value';

and have the variable reassigned in case it evaluates to false. Is it possible to create that assignment? Do I have to compile my own version of php to do that?

6 Answers
Related