3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits = [ 'apple', 'banana' , 'cherry' ]; foreach ( $fruits as $fruit ) { // The $fruit just gets overwritten each time, so the array of $fruits never changes. $fruit = str_rot13( $fruit ); } print_r( $fruits ); foreach ( $fruits as $key => $fruit ) { // Now we're assigning the rotated string back to the original array. $fruits[ $key ] = str_rot13( $fruit ); } print_r( $fruits );
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => apple [1] => banana [2] => cherry ) Array ( [0] => nccyr [1] => onanan [2] => pureel )

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:
28.38 ms | 405 KiB | 5 Q