3v4l.org

run code in 500+ PHP versions simultaneously
<?php function absint_dennis( $maybeint ) { return min( PHP_INT_MAX, abs( (int) $maybeint ) ); } $values = array( PHP_INT_MIN, PHP_INT_MIN * 2, PHP_INT_MAX, PHP_INT_MAX * 2, ); foreach ( $values as $value ) { echo "absint( $value ) === "; var_dump( absint_dennis( $value ) ); echo "\n\n"; }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.90.0120.00616.73

preferences:
46.36 ms | 480 KiB | 5 Q