3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = ['foo']; $bar = ['apples', 'banana', 'carrots']; var_dump(count($foo > 2)); var_dump(count($bar > 2)); var_dump(count($foo) > 2); var_dump(count($bar) > 2);
Output for 7.2.0
Warning: count(): Parameter must be an array or an object that implements Countable in /in/KhlI7 on line 5 int(1) Warning: count(): Parameter must be an array or an object that implements Countable in /in/KhlI7 on line 6 int(1) bool(false) bool(true)
Output for 5.4.11 - 7.1.10
int(1) int(1) bool(false) bool(true)
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/KhlI7 on line 3
Process exited with code 255.