3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ValidatorInterfaceFirst { public function validate($value, $groups = null, $traverse = false, $deep = false); public function validateProperty($containingValue, $property, $groups = null); public function validatePropertyValue($containingValue, $property, $value, $groups = null); public function validateValue($value, $constraints, $groups = null); public function getMetadataFactory(); } interface ValidatorInterfaceSecond { public function validate($value, $constraints = null, $groups = null); public function validateProperty($object, $propertyName, $groups = null); public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null); public function startContext(); public function inContext($context); } class RecursiveValidator implements ValidatorInterfaceFirst, ValidatorInterfaceSecond { protected $contextFactory; protected $metadataFactory; protected $validatorFactory; protected $objectInitializers; public function __construct($contextFactory, $metadataFactory, $validatorFactory, array $objectInitializers = array()) { $this->contextFactory = $contextFactory; $this->metadataFactory = $metadataFactory; $this->validatorFactory = $validatorFactory; $this->objectInitializers = $objectInitializers; } public function startContext($root = null) { /* return new RecursiveContextualValidator( $this->contextFactory->createContext($this, $root), $this->metadataFactory, $this->validatorFactory, $this->objectInitializers ); */ } public function inContext($context) { /* return new RecursiveContextualValidator( $context, $this->metadataFactory, $this->validatorFactory, $this->objectInitializers ); */ } public function getMetadataFor($object) { //return $this->metadataFactory->getMetadataFor($object); } public function hasMetadataFor($object) { //return $this->metadataFactory->hasMetadataFor($object); } public function validate($value, $groups = null, $traverse = false, $deep = false) { /* $numArgs = func_num_args(); if (self::testConstraints($groups) && ($numArgs < 3 || 3 === $numArgs && self::testGroups($traverse))) { $constraints = $groups; $groups = $traverse; } else { trigger_error('The Symfony\Component\Validator\ValidatorInterface::validate method is deprecated in version 2.5 and will be removed in version 3.0. Use the Symfony\Component\Validator\Validator\ValidatorInterface::validate method instead.', E_USER_DEPRECATED); $constraints = new Valid(array('traverse' => $traverse, 'deep' => $deep)); } return $this->startContext($value) ->validate($value, $constraints, $groups) ->getViolations(); */ } public function validateProperty($object, $propertyName, $groups = null) { return $this->startContext($object) ->validateProperty($object, $propertyName, $groups) ->getViolations(); } public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null) { return $this->startContext(is_object($objectOrClass) ? $objectOrClass : $value) ->validatePropertyValue($objectOrClass, $propertyName, $value, $groups) ->getViolations(); } public function validateValue($value, $constraints, $groups = null) { trigger_error('The '.__METHOD__.' method is deprecated in version 2.5 and will be removed in version 3.0. Use the Symfony\Component\Validator\Validator\ValidatorInterface::validate method instead.'); return $this->validate($value, $constraints, $groups); } public function getMetadataFactory() { trigger_error('The '.__METHOD__.' method is deprecated in version 2.5 and will be removed in version 3.0. Use the Symfony\Component\Validator\Validator\ValidatorInterface::getMetadataFor or Symfony\Component\Validator\Validator\ValidatorInterface::hasMetadataFor method instead.'); return $this->metadataFactory; } private static function testConstraints($constraints) { return null === $constraints || $constraints instanceof Constraint || (is_array($constraints) && current($constraints) instanceof Constraint); } private static function testGroups($groups) { return null === $groups || is_string($groups) || $groups instanceof GroupSequence || (is_array($groups) && (is_string(current($groups)) || current($groups) instanceof GroupSequence)); } } $obj = new RecursiveValidator();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: Too few arguments to function RecursiveValidator::__construct(), 0 passed in /in/5D4aI on line 113 and at least 3 expected in /in/5D4aI:26 Stack trace: #0 /in/5D4aI(113): RecursiveValidator->__construct() #1 {main} thrown in /in/5D4aI on line 26
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:
56.17 ms | 401 KiB | 8 Q