3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $src = array('foo : bar', 'foo...bar'); $i = 0; while ($src[$i]) { $words += count($src[$i]); $i++; } echo "Lines: $i - Words: $words";
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: words in /in/sPXsI on line 5 Notice: Undefined offset: 2 in /in/sPXsI on line 4 Lines: 2 - Words: 2
Output for hhvm-3.12.0
Notice: Undefined index: 2 in /in/sPXsI on line 10 Lines: 2 - Words: 2
Output for hhvm-3.10.0
Notice: Undefined index: 2 in /in/sPXsI on line 4 Lines: 2 - Words: 2
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: words in /in/sPXsI on line 5 Notice: Undefined offset: 2 in /in/sPXsI on line 4 Lines: 2 - Words: 2
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: words in /in/sPXsI on line 5 Notice: Undefined offset: 2 in /in/sPXsI on line 4 Lines: 2 - Words: 2