3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo implements ArrayAccess { public function offsetGet($x) { var_dump($x); } public function offsetExists($x) { var_dump($x); } public function offsetSet($x, $y) { var_dump($x); } public function offsetUnset($x) { var_dump($x); } } $foo = new Foo(); echo "$foo[0]"; echo "$foo[1]"; echo "$foo[00]";
based on r699v
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0alpha1
int(0) int(1) string(2) "00"
Output for hhvm-3.12.14 - 3.17.3
string(1) "0" string(1) "1" string(2) "00"