3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class C implements ArrayAccess { public offsetExists ( $offset ) { echo $offsetExists; } public offsetGet ( $offset ) { echo $offsetGet; } public offsetSet ( $offset , $value ) { echo $offsetSet; } public offsetUnset ( $offset ) { echo $offsetUnset; } } } $x = new C(); var_dump(empty($x));
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected 'offsetExists' (T_STRING), expecting variable (T_VARIABLE) in /in/RYUaZ on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/RYUaZ on line 4
Process exited with code 255.