3v4l.org

run code in 300+ PHP versions simultaneously
<?php $token_list = str_split("apt71hfmh618k17dgimvltrn06"); $first = null; $second = null; $modified_list = $token_list; for($i = 0; $i < count($token_list); $i++) { if(!is_nan($token_list[$i]) && $i > 4 && $i < count($token_list) -4) { if(is_null($first)) { $first = $i; } } elseif(is_null($second)) { $second = $i; } } if(!is_null($first) && !is_null($second)) { $modified_list[$first] = $token_list[$second]; $modified_list[$second] = $token_list[$first]; } else { $modified_list[12] = $token_list[13]; $modified_list[13] = $token_list[12]; } $modified_token = implode('', $modified_list); var_dump($token_list); var_dump($modified_token);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: is_nan(): Argument #1 ($num) must be of type float, string given in /in/NODdk:12 Stack trace: #0 /in/NODdk(12): is_nan('a') #1 {main} thrown in /in/NODdk on line 12
Process exited with code 255.

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:
54.52 ms | 401 KiB | 8 Q