3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $forbiddenChar = array("<", ">", "'", "=", "--"); // zakazane znaky $arrayInputsState = array( 'kjobs' => 'ok', 'kpodn' => '', 'kpodn2' => '', 'kuziv' => '', 'nuziv' => '', 'krgis' => '', 'kprog' => '', 'ksyst' => '', 'ver_prog' => '', 'ver_syst' => '', 'ver_data' => '', 'maxuser' => '', 'devid' => '', 'dlimit' => '', 'serialnum' => '', 'cloudid' => '', 'host' => '', 'laktiv' => '', 'larchiv' => '', 'opozn' => '' ); echo "\n\n"; $numberOfFoundError = 0; if (!in_array("error", $arrayInputsState)) { // ak nie je chyba // prejdi cele pole zakazanych znakov foreach($forbiddenChar as $value) { // vyhladaj hodnotu v poli if (in_array($value, $arrayInputsState)) { // nasiel som zhodu ++$numberOfFoundError; break; } } if ($numberOfFoundError == 0) { if (in_array("ok", $arrayInputsState)) { // a ak je nejaky vstup od uzivatela ok $Zaznam->save(); // tak uloz zaznam echo "ok, Zaznam je ulozeny.\n"; } else { // nebol ziadny vstup od uzivatela ok echo "Ziadny vstup nebol ok\n"; } } else { echo "Zakazane znaky\n"; } } else { echo "Error\n"; }
based on AkTYr
Output for 7.0.5 - 7.3.0rc3
Notice: Undefined variable: Zaznam in /in/kKG3j on line 39 Fatal error: Uncaught Error: Call to a member function save() on null in /in/kKG3j:39 Stack trace: #0 {main} thrown in /in/kKG3j on line 39
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: Zaznam in /in/kKG3j on line 39 Fatal error: Uncaught Error: Call to a member function save() on unknown in /in/kKG3j:39 Stack trace: #0 {main} thrown in /in/kKG3j on line 39
Process exited with code 255.
Output for hhvm-3.15.4
Notice: Undefined variable: Zaznam in /in/kKG3j on line 39 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function save() on a non-object (null)' in /in/kKG3j:39 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Notice: Undefined variable: Zaznam in /in/kKG3j on line 39 Fatal error: Call to a member function save() on null in /in/kKG3j on line 39
Process exited with code 255.