3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function removeWhiteSpace($value) { for($i=0;$i<=count($value);$i++) { //$value[$i]=trim($value[$i]); $temp=trim($value[$i]); echo 'length: ' . strlen($temp) . ' = ' . $value[$i] . '<br/>'; } //return $value; } removeWhiteSpace(array("donkey ","cat"));
Output for 5.3.0 - 7.1.0
length: 6 = donkey <br/>length: 3 = cat<br/> Notice: Undefined offset: 2 in /in/9Zgof on line 6 Notice: Undefined offset: 2 in /in/9Zgof on line 7 length: 0 = <br/>
Output for 4.3.0 - 5.2.17
length: 6 = donkey <br/>length: 3 = cat<br/> Notice: Undefined offset: 2 in /in/9Zgof on line 6 Notice: Undefined offset: 2 in /in/9Zgof on line 7 length: 0 = <br/>