3v4l.org

run code in 500+ PHP versions simultaneously
<?php function absint( $maybeint ): int { return abs( (int) $maybeint ); } function another_absint( $maybeint ): int { if ( ! is_float( $maybeint ) && ! is_int( $maybeint ) && ! is_numeric( $maybeint ) && ! is_bool( $maybeint ) ) { return 0; } return abs( (int) $maybeint ); } $data = '999 stuff'; var_dump( $data ); echo "\n"; var_dump( absint( $data ) ); echo "\n"; var_dump( another_absint( $data ) );
Output for git.master_jit, git.master
string(9) "999 stuff" int(999) int(0)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
39.84 ms | 780 KiB | 4 Q