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();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  (null)
number of ops:  5
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   DECLARE_CLASS                                            'recursivevalidator'
  113     1        NEW                                              $1      'RecursiveValidator'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
          4      > RETURN                                                   1

Class ValidatorInterfaceFirst:
Function validate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  validate
number of ops:  5
compiled vars:  !0 = $value, !1 = $groups, !2 = $traverse, !3 = $deep
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      <false>
          3        RECV_INIT                                        !3      <false>
          4      > RETURN                                                   null

End of function validate

Function validateproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  validateProperty
number of ops:  4
compiled vars:  !0 = $containingValue, !1 = $property, !2 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
          3      > RETURN                                                   null

End of function validateproperty

Function validatepropertyvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  validatePropertyValue
number of ops:  5
compiled vars:  !0 = $containingValue, !1 = $property, !2 = $value, !3 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      null
          4      > RETURN                                                   null

End of function validatepropertyvalue

Function validatevalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  validateValue
number of ops:  4
compiled vars:  !0 = $value, !1 = $constraints, !2 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
          3      > RETURN                                                   null

End of function validatevalue

Function getmetadatafactory:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  getMetadataFactory
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   null

End of function getmetadatafactory

End of class ValidatorInterfaceFirst.

Class ValidatorInterfaceSecond:
Function validate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  validate
number of ops:  4
compiled vars:  !0 = $value, !1 = $constraints, !2 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      null
          3      > RETURN                                                   null

End of function validate

Function validateproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  validateProperty
number of ops:  4
compiled vars:  !0 = $object, !1 = $propertyName, !2 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
          3      > RETURN                                                   null

End of function validateproperty

Function validatepropertyvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  validatePropertyValue
number of ops:  5
compiled vars:  !0 = $objectOrClass, !1 = $propertyName, !2 = $value, !3 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      null
          4      > RETURN                                                   null

End of function validatepropertyvalue

Function startcontext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  startContext
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   null

End of function startcontext

Function incontext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  inContext
number of ops:  2
compiled vars:  !0 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function incontext

End of class ValidatorInterfaceSecond.

Class RecursiveValidator:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  __construct
number of ops:  13
compiled vars:  !0 = $contextFactory, !1 = $metadataFactory, !2 = $validatorFactory, !3 = $objectInitializers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      <array>
   28     4        ASSIGN_OBJ                                               'contextFactory'
          5        OP_DATA                                                  !0
   29     6        ASSIGN_OBJ                                               'metadataFactory'
          7        OP_DATA                                                  !1
   30     8        ASSIGN_OBJ                                               'validatorFactory'
          9        OP_DATA                                                  !2
   31    10        ASSIGN_OBJ                                               'objectInitializers'
         11        OP_DATA                                                  !3
   32    12      > RETURN                                                   null

End of function __construct

Function startcontext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  startContext
number of ops:  2
compiled vars:  !0 = $root
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV_INIT                                        !0      null
   43     1      > RETURN                                                   null

End of function startcontext

Function incontext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  inContext
number of ops:  2
compiled vars:  !0 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
   54     1      > RETURN                                                   null

End of function incontext

Function getmetadatafor:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  getMetadataFor
number of ops:  2
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   RECV                                             !0      
   58     1      > RETURN                                                   null

End of function getmetadatafor

Function hasmetadatafor:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  hasMetadataFor
number of ops:  2
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   59     0  E >   RECV                                             !0      
   62     1      > RETURN                                                   null

End of function hasmetadatafor

Function validate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  validate
number of ops:  5
compiled vars:  !0 = $value, !1 = $groups, !2 = $traverse, !3 = $deep
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      <false>
          3        RECV_INIT                                        !3      <false>
   78     4      > RETURN                                                   null

End of function validate

Function validateproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  validateProperty
number of ops:  15
compiled vars:  !0 = $object, !1 = $propertyName, !2 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   79     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
   81     3        INIT_METHOD_CALL                                         'startContext'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $3      
   82     6        INIT_METHOD_CALL                                         $3, 'validateProperty'
          7        SEND_VAR_EX                                              !0
          8        SEND_VAR_EX                                              !1
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0  $4      
   83    11        INIT_METHOD_CALL                                         $4, 'getViolations'
         12        DO_FCALL                                      0  $5      
         13      > RETURN                                                   $5
   84    14*     > RETURN                                                   null

End of function validateproperty

Function validatepropertyvalue:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  validatePropertyValue
number of ops:  22
compiled vars:  !0 = $objectOrClass, !1 = $propertyName, !2 = $value, !3 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   85     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      null
   87     4        INIT_METHOD_CALL                                         'startContext'
          5        TYPE_CHECK                                  256          !0
          6      > JMPZ                                                     ~4, ->9
          7    >   QM_ASSIGN                                        ~5      !0
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~5      !2
         10    >   SEND_VAL_EX                                              ~5
         11        DO_FCALL                                      0  $6      
   88    12        INIT_METHOD_CALL                                         $6, 'validatePropertyValue'
         13        SEND_VAR_EX                                              !0
         14        SEND_VAR_EX                                              !1
         15        SEND_VAR_EX                                              !2
         16        SEND_VAR_EX                                              !3
         17        DO_FCALL                                      0  $7      
   89    18        INIT_METHOD_CALL                                         $7, 'getViolations'
         19        DO_FCALL                                      0  $8      
         20      > RETURN                                                   $8
   90    21*     > RETURN                                                   null

End of function validatepropertyvalue

Function validatevalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  validateValue
number of ops:  13
compiled vars:  !0 = $value, !1 = $constraints, !2 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   91     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
   93     3        INIT_FCALL                                               'trigger_error'
          4        SEND_VAL                                                 'The+RecursiveValidator%3A%3AvalidateValue+method+is+deprecated+in+version+2.5+and+will+be+removed+in+version+3.0.+Use+the+Symfony%5CComponent%5CValidator%5CValidator%5CValidatorInterface%3A%3Avalidate+method+instead.'
          5        DO_ICALL                                                 
   95     6        INIT_METHOD_CALL                                         'validate'
          7        SEND_VAR_EX                                              !0
          8        SEND_VAR_EX                                              !1
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0  $4      
         11      > RETURN                                                   $4
   96    12*     > RETURN                                                   null

End of function validatevalue

Function getmetadatafactory:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5D4aI
function name:  getMetadataFactory
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   99     0  E >   INIT_FCALL                                               'trigger_error'
          1        SEND_VAL                                                 'The+RecursiveValidator%3A%3AgetMetadataFactory+method+is+deprecated+in+version+2.5+and+will+be+removed+in+version+3.0.+Use+the+Symfony%5CComponent%5CValidator%5CValidator%5CValidatorInterface%3A%3AgetMetadataFor+or+Symfony%5CComponent%5CValidator%5CValidator%5CValidatorInterface%3A%3AhasMetadataFor+method+instead.'
          2        DO_ICALL                                                 
  101     3        FETCH_OBJ_R                                      ~1      'metadataFactory'
          4      > RETURN                                                   ~1
  102     5*     > RETURN                                                   null

End of function getmetadatafactory

Function testconstraints:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 14
Branch analysis from position: 5
filename:       /in/5D4aI
function name:  testConstraints
number of ops:  16
compiled vars:  !0 = $constraints
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  103     0  E >   RECV                                             !0      
  105     1        TYPE_CHECK                                    2  ~1      !0
          2      > JMPNZ_EX                                         ~1      ~1, ->5
          3    >   INSTANCEOF                                       ~2      !0, 'Constraint'
          4        BOOL                                             ~1      ~2
          5    > > JMPNZ_EX                                         ~1      ~1, ->14
          6    >   TYPE_CHECK                                  128  ~3      !0
          7      > JMPZ_EX                                          ~3      ~3, ->13
          8    >   INIT_FCALL                                               'current'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        INSTANCEOF                                       ~5      $4, 'Constraint'
         12        BOOL                                             ~3      ~5
         13    >   BOOL                                             ~1      ~3
         14    > > RETURN                                                   ~1
  106    15*     > RETURN                                                   null

End of function testconstraints

Function testgroups:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 47) Position 1 = 9, Position 2 = 23
Branch analysis from position: 9
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 47) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 22
Branch analysis from position: 23
Branch analysis from position: 8
Branch analysis from position: 5
filename:       /in/5D4aI
function name:  testGroups
number of ops:  25
compiled vars:  !0 = $groups
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  107     0  E >   RECV                                             !0      
  109     1        TYPE_CHECK                                    2  ~1      !0
          2      > JMPNZ_EX                                         ~1      ~1, ->5
          3    >   TYPE_CHECK                                   64  ~2      !0
          4        BOOL                                             ~1      ~2
          5    > > JMPNZ_EX                                         ~1      ~1, ->8
          6    >   INSTANCEOF                                       ~3      !0, 'GroupSequence'
          7        BOOL                                             ~1      ~3
          8    > > JMPNZ_EX                                         ~1      ~1, ->23
          9    >   TYPE_CHECK                                  128  ~4      !0
         10      > JMPZ_EX                                          ~4      ~4, ->22
         11    >   INIT_FCALL                                               'current'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $5      
         14        TYPE_CHECK                                   64  ~6      $5
         15      > JMPNZ_EX                                         ~6      ~6, ->21
         16    >   INIT_FCALL                                               'current'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $7      
         19        INSTANCEOF                                       ~8      $7, 'GroupSequence'
         20        BOOL                                             ~6      ~8
         21    >   BOOL                                             ~4      ~6
         22    >   BOOL                                             ~1      ~4
         23    > > RETURN                                                   ~1
  110    24*     > RETURN                                                   null

End of function testgroups

End of class RecursiveValidator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.71 ms | 1420 KiB | 17 Q