3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $src = array('foo : bar', 'foo...bar'); for ($lines = 0; $lines <= sizeof($src); $lines++) { $words += count($src[$lines]); } echo "Lines: $lines - Words: $words";
Output for 5.3.0 - 7.1.0
Notice: Undefined variable: words in /in/JcDNU on line 4 Notice: Undefined offset: 2 in /in/JcDNU on line 4 Lines: 3 - Words: 2
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: words in /in/JcDNU on line 4 Notice: Undefined offset: 2 in /in/JcDNU on line 4 Lines: 3 - Words: 2
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: words in /in/JcDNU on line 4 Notice: Undefined offset: 2 in /in/JcDNU on line 4 Lines: 3 - Words: 2