3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $key = '价格'; $doc = []; $doc[$key] = false; $value = $doc[$key]; var_dump($doc); if(pre_match('/[0-9]\d*/', $value) $doc[$key] = floatval($value); else unset($doc[$key]); var_dump($doc);
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected '$doc' (T_VARIABLE) in /in/WYYVq on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected '[' in /in/WYYVq on line 4
Process exited with code 255.