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($value[$i]) . ' = ' . $value[$i] . '<br/>'; } //return $value; } removeWhiteSpace(array("donkey "));
Output for 5.3.0 - 7.1.0
length: 7 = donkey <br/> Notice: Undefined offset: 1 in /in/uvBuC on line 6 Notice: Undefined offset: 1 in /in/uvBuC on line 7 Notice: Undefined offset: 1 in /in/uvBuC on line 7 length: 0 = <br/>
Output for 4.3.0 - 5.2.17
length: 7 = donkey <br/> Notice: Undefined offset: 1 in /in/uvBuC on line 6 Notice: Undefined offset: 1 in /in/uvBuC on line 7 Notice: Undefined offset: 1 in /in/uvBuC on line 7 length: 0 = <br/>