- str_pad: documentation ( source)
<?php
function tryit($operand) {
echo str_pad($operand, 4, ' ', STR_PAD_RIGHT);
try {
eval("\$a = []; \$a $operand \$a;");
echo "ok\n";
} catch (\Throwable $e) {
echo $e->getMessage(), "\n";
}
}
tryit('+');
tryit('-');
tryit('-');
tryit('*');
tryit('/');
tryit('.');
tryit('**');
tryit('<=>');