3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkDuplicatesInArray($array){ $duplicates=FALSE; foreach($array as $k=>$i){ if(!isset($value_{$i})){ $value_{$i}=TRUE; } else{ $duplicates|=TRUE; } } return ($duplicates); } var_export(checkDuplicatesInArray([1, 1.5]));
Output for 8.0.0 - 8.0.13, 8.1rc1 - rc3
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /in/kGLWT on line 7
Process exited with code 255.
Output for 7.4.0 - 7.4.26
Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/kGLWT on line 6 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/kGLWT on line 7 1
Output for 7.3.0 - 7.3.33
1

preferences:
21.81 ms | 462 KiB | 5 Q