3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array( 0 => array( 0 => ' abc', 1 => ' def', 2 => 'ghi ' ) ); var_dump($a); array_walk_recursive($a, 'trim'); var_dump($a);
based on 846Ji
Output for 5.0.1 - 5.0.5, 5.2.6 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
array(1) { [0]=> array(3) { [0]=> string(4) " abc" [1]=> string(4) " def" [2]=> string(5) "ghi " } } array(1) { [0]=> array(3) { [0]=> string(4) " abc" [1]=> string(4) " def" [2]=> string(5) "ghi " } }
Output for 5.1.0 - 5.2.5
array(1) { [0]=> array(3) { [0]=> string(4) " abc" [1]=> string(4) " def" [2]=> string(5) "ghi " } } array(1) { [0]=> &array(3) { [0]=> string(4) " abc" [1]=> string(4) " def" [2]=> string(5) "ghi " } }
Output for 5.0.0
array(1) { [0]=> array(3) { [0]=> string(4) " abc" [1]=> string(4) " def" [2]=> string(5) "ghi " } }
Process exited with code 139.
Output for 4.4.5 - 4.4.9
array(1) { [0]=> array(3) { [0]=> string(4) " abc" [1]=> string(4) " def" [2]=> string(5) "ghi " } } Fatal error: Call to undefined function: array_walk_recursive() in /in/UupOZ on line 14
Process exited with code 255.
Output for 4.3.2 - 4.4.4
array(1) { [0]=> array(3) { [0]=> string(4) " abc" [1]=> string(4) " def" [2]=> string(5) "ghi " } } Fatal error: Call to undefined function: array_walk_recursive() in /in/UupOZ on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1
array(1) { [0]=> array(3) { [0]=> string(4) " abc" [1]=> string(4) " def" [2]=> string(5) "ghi " } } Fatal error: Call to undefined function: array_walk_recursive() in /in/UupOZ on line 14