- var_dump: documentation ( source)
- is_numeric: documentation ( source)
<?php
class A
{
public function test($id = null)
{
if (!$id) {
return false;
}
$getArg = $id;
if ($getArg (is_numeric($getArg) || $getArg === 'test')) {
return true;
}
return false;
}
}
var_dump((new A)->test('1'));