3v4l.org

run code in 300+ PHP versions simultaneously
<?php //класс Validator //$this->rules - массив, в котором ключи - строки - названия полей, а элементы - массив, в котором ключи цифры от 0 до n, а //элементы - объекты-правила-валидации. public function validate(Enrollee $enrollee): ErrorList { $errorList = new ErrorList(); foreach ($this->rules as $fieldName => $checklist) { foreach ($checklist as $rule) { $result = $rule($enrollee->get($fieldName)); if ($result) { $errorList->add($fieldName, $result); } } } return $errorList; }
Output for git.master, git.master_jit, rfc.property-hooks
Parse error: syntax error, unexpected token "public", expecting end of file in /in/v85Gq on line 7
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
135.78 ms | 995 KiB | 7 Q