3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $obj = new stdClass(); $obj->foo = 'foo'; $obj->bar = 'bar'; $arr = array('foo' => 'foo', 'bar' => 'bar'); var_dump(count(obj)); var_dump(count(obj));
Output for 7.2.0
Warning: Use of undefined constant obj - assumed 'obj' (this will throw an Error in a future version of PHP) in /in/l8nF3 on line 7 Warning: count(): Parameter must be an array or an object that implements Countable in /in/l8nF3 on line 7 int(1) Warning: Use of undefined constant obj - assumed 'obj' (this will throw an Error in a future version of PHP) in /in/l8nF3 on line 8 Warning: count(): Parameter must be an array or an object that implements Countable in /in/l8nF3 on line 8 int(1)
Output for 4.3.0 - 7.1.10
Notice: Use of undefined constant obj - assumed 'obj' in /in/l8nF3 on line 7 int(1) Notice: Use of undefined constant obj - assumed 'obj' in /in/l8nF3 on line 8 int(1)