3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array('Implied', 1=> 'Integer', '2' => 'String', 3.0 => 'Float', '' => 'empty', 'f' => 'Non-int'); foreach($a AS $k=>$v){ echo "$v is treated as (" . gettype($k) . ') ' . var_export($k, true) . "\r\n\r\n"; }
Output for 4.3.0 - 7.1.0
Implied is treated as (integer) 0 Integer is treated as (integer) 1 String is treated as (integer) 2 Float is treated as (integer) 3 empty is treated as (string) '' Non-int is treated as (string) 'f'