3v4l.org

run code in 300+ PHP versions simultaneously
<?php function absint( $maybeint ) { return abs( (int) $maybeint ); } $test = [ '10', ' 10', '10 ', ' 10 ', ]; foreach($test as $value) { var_dump(absint($value)); }

preferences:
25.67 ms | 405 KiB | 5 Q