3v4l.org

run code in 200+ 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 7.2.0 - 7.3.0rc4
Warning: count(): Parameter must be an array or an object that implements Countable in /in/MJf1R on line 4 Notice: Undefined variable: words in /in/MJf1R on line 4 Warning: count(): Parameter must be an array or an object that implements Countable in /in/MJf1R on line 4 Lines: 2 - Words: 2
Output for 5.0.4 - 7.1.20
Notice: Undefined variable: words in /in/MJf1R on line 4 Lines: 2 - Words: 2
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: words in /in/MJf1R on line 4 Lines: 2 - Words: 2