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();

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0130.00918.56
8.3.50.0110.00821.08
8.3.40.0100.00718.94
8.3.30.0100.00718.97
8.3.20.0040.00420.34
8.3.10.0030.01323.66
8.3.00.0080.00023.66
8.2.180.0180.00017.00
8.2.170.0040.01122.96
8.2.160.0140.00022.29
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0090.00017.62
8.2.110.0030.00720.22
8.2.100.0090.00317.75
8.2.90.0060.00319.00
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0080.00017.93
8.2.50.0000.00918.07
8.2.40.0040.00421.19
8.2.30.0000.00717.96
8.2.20.0000.00817.83
8.2.10.0050.00218.04
8.2.00.0000.00718.14
8.1.280.0110.00325.92
8.1.270.0090.00020.22
8.1.260.0070.00426.35
8.1.250.0080.00028.09
8.1.240.0120.00019.45
8.1.230.0080.00318.82
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0050.00317.23
8.1.180.0060.00318.10
8.1.170.0040.00418.50
8.1.160.0040.00421.96
8.1.150.0000.00718.80
8.1.140.0000.00817.36
8.1.130.0000.00717.63
8.1.120.0000.00717.34
8.1.110.0040.00417.31
8.1.100.0000.00717.48
8.1.90.0040.00417.41
8.1.80.0000.00717.33
8.1.70.0030.00717.47
8.1.60.0030.00617.57
8.1.50.0000.00817.51
8.1.40.0000.00917.47
8.1.30.0000.00817.42
8.1.20.0040.00417.59
8.1.10.0040.00417.57
8.1.00.0040.00417.36
8.0.300.0040.00418.77
8.0.290.0050.00316.75
8.0.280.0040.00418.49
8.0.270.0000.00717.28
8.0.260.0070.00017.27
8.0.250.0000.00717.06
8.0.240.0030.00316.99
8.0.230.0030.00317.06
8.0.220.0030.00317.00
8.0.210.0040.00416.90
8.0.200.0000.00717.07
8.0.190.0040.00417.02
8.0.180.0050.00217.06
8.0.170.0000.00817.01
8.0.160.0000.00816.93
8.0.150.0070.00316.94
8.0.140.0040.00416.86
8.0.130.0030.00313.50
8.0.120.0040.00416.93
8.0.110.0030.00616.88
8.0.100.0000.00716.81
8.0.90.0030.00516.97
8.0.80.0110.00816.99
8.0.70.0030.00516.90
8.0.60.0040.00417.08
8.0.50.0070.00016.86
8.0.30.0100.00817.11
8.0.20.0110.00817.40
8.0.10.0000.00817.04
8.0.00.0080.01116.76
7.4.330.0030.00315.20
7.4.320.0050.00216.40
7.4.300.0000.00616.59
7.4.290.0030.00316.40
7.4.280.0070.00416.56
7.4.270.0030.00516.48
7.4.260.0000.00716.45
7.4.250.0000.00716.52
7.4.240.0050.00216.52
7.4.230.0030.00316.60
7.4.220.0060.01216.57
7.4.210.0090.00616.59
7.4.200.0040.00416.56
7.4.160.0120.00616.54
7.4.150.0130.00317.40
7.4.140.0110.00817.86
7.4.130.0120.00516.59
7.4.120.0110.01016.65
7.4.110.0100.00716.45
7.4.100.0090.01216.50
7.4.90.0100.01016.46
7.4.80.0080.01019.39
7.4.70.0170.00016.46
7.4.60.0130.00316.52
7.4.50.0020.00216.32
7.4.40.0110.00616.55
7.4.30.0000.01816.67
7.4.00.0070.01014.82
7.3.330.0000.00513.23
7.3.320.0030.00313.23
7.3.310.0030.00316.21
7.3.300.0050.00216.35
7.3.290.0090.00716.35
7.3.280.0060.01216.39
7.3.270.0180.00017.40
7.3.260.0190.00016.61
7.3.250.0130.00716.47
7.3.240.0150.00716.58
7.3.230.0100.00716.41
7.3.210.0080.00816.55
7.3.200.0110.00616.32
7.3.190.0070.01016.41
7.3.180.0000.01516.46
7.3.170.0000.01616.55
7.3.160.0070.01016.32
7.3.120.0100.00914.66
7.3.110.0000.01814.85
7.3.100.0070.01114.99
7.3.90.0030.00914.96
7.3.80.0030.01314.83
7.3.70.0070.00414.64
7.3.60.0040.01114.57
7.3.50.0070.00714.96
7.3.40.0100.00314.75
7.3.30.0070.00714.91
7.3.20.0030.00616.61
7.3.10.0040.00816.69
7.3.00.0040.00916.56
7.2.330.0060.01216.54
7.2.320.0140.01016.29
7.2.310.0050.01216.43
7.2.300.0110.00516.50
7.2.290.0140.00916.54
7.2.250.0060.01314.86
7.2.240.0030.01315.16
7.2.230.0040.01114.97
7.2.220.0060.01014.82
7.2.210.0060.00314.79
7.2.200.0060.00814.80
7.2.190.0030.01414.89
7.2.180.0120.00314.70
7.2.170.0000.00915.00
7.2.160.0060.00914.81
7.2.150.0040.00716.45
7.2.140.0100.00716.81
7.2.130.0050.00916.65
7.2.120.0050.01016.89
7.2.110.0000.01216.64
7.2.100.0080.00716.64
7.2.90.0100.00716.79
7.2.80.0000.01316.66
7.2.70.0070.00916.85
7.2.60.0090.00716.64
7.2.50.0130.00116.73
7.2.40.0080.00616.84
7.2.30.0080.00816.79
7.2.20.0070.00916.69
7.2.10.0050.01216.58
7.2.00.0050.00917.73
7.1.330.0040.01415.71
7.1.320.0030.01015.84
7.1.310.0040.00715.54
7.1.300.0000.01315.55
7.1.290.0040.01115.71
7.1.280.0060.00615.60
7.1.270.0000.01415.64
7.1.260.0040.00815.72
7.1.250.0020.01215.75
7.1.240.0080.00715.64
7.1.230.0090.00615.49
7.1.220.0060.00715.60
7.1.210.0050.00715.61
7.1.200.0050.01015.62
7.1.190.0080.00615.66
7.1.180.0090.00515.58
7.1.170.0050.00915.49
7.1.160.0070.00915.69
7.1.150.0070.00915.69
7.1.140.0030.01515.67
7.1.130.0070.00515.48
7.1.120.0030.01415.60
7.1.110.0100.00415.65
7.1.100.0070.00516.62
7.1.90.0100.00315.66
7.1.80.0050.00715.68
7.1.70.0040.01216.05
7.1.60.0060.01216.87
7.1.50.0060.00916.12
7.1.40.0070.00815.63
7.1.30.0040.01015.56
7.1.20.0040.00615.71
7.1.10.0070.00515.71
7.1.00.0070.02717.77
7.0.330.0060.00315.35
7.0.320.0070.00315.31
7.0.310.0050.00715.41
7.0.300.0050.00615.16
7.0.290.0060.00815.21
7.0.280.0000.01315.32
7.0.270.0080.00515.29
7.0.260.0020.00915.37
7.0.250.0130.00115.46
7.0.240.0080.00615.25
7.0.230.0030.00915.22
7.0.220.0100.00315.38
7.0.210.0050.00515.19
7.0.200.0070.00715.78
7.0.190.0060.01015.35
7.0.180.0080.00915.27
7.0.170.0110.00515.38
7.0.160.0090.00415.37
7.0.150.0020.01115.37
7.0.140.0050.00515.28
7.0.130.0070.00515.11
7.0.120.0080.00715.14
7.0.110.0080.00515.27
7.0.100.0060.00715.31
7.0.90.0040.00415.23
7.0.80.0080.00415.34
7.0.70.0060.00415.33
7.0.60.0070.03316.96
7.0.50.0060.01516.23
7.0.40.0100.01715.76
7.0.30.0130.01415.60
7.0.20.0100.02415.64
7.0.10.0130.02515.68
7.0.00.0010.02415.60
5.6.400.0070.00714.37
5.6.390.0060.01014.36
5.6.380.0060.00814.18
5.6.370.0020.01414.27
5.6.360.0060.00814.23
5.6.350.0070.00514.17
5.6.340.0070.00614.42
5.6.330.0080.00314.58
5.6.320.0060.00514.51
5.6.310.0030.00714.48
5.6.300.0070.00614.40
5.6.290.0040.01014.42
5.6.280.0050.01014.36
5.6.270.0040.01114.50
5.6.260.0060.00814.21
5.6.250.0050.01014.38
5.6.240.0030.00914.38
5.6.230.0080.00614.34
5.6.220.0060.00714.58
5.6.210.0070.02516.40
5.6.200.0060.01615.55
5.6.190.0040.03716.38
5.6.180.0170.03216.52
5.6.170.0100.02116.35
5.6.160.0050.02716.47
5.6.150.0040.02115.53
5.6.140.0060.03415.53
5.6.130.0070.02115.71
5.6.120.0090.02816.72
5.6.110.0120.03116.63
5.6.100.0080.03116.59
5.6.90.0070.02316.42
5.6.80.0060.01816.31
5.6.70.1190.01916.41
5.6.60.0050.01014.45
5.6.50.0080.00414.29
5.6.40.0070.00514.24
5.6.30.0100.00414.21
5.6.20.0050.00814.10
5.6.10.0050.00814.29
5.6.00.0070.00614.20
5.5.380.0070.00512.87
5.5.370.0060.00612.51
5.5.360.0020.01012.63
5.5.350.0080.02715.24
5.5.340.0110.01914.45
5.5.330.0050.02915.26
5.5.320.0120.02415.14
5.5.310.0140.03015.19
5.5.300.0090.01514.46
5.5.290.0060.03014.59
5.5.280.0070.02515.45
5.5.270.0060.01715.46
5.5.260.0100.03115.49
5.5.250.0110.02915.26
5.5.240.0040.02115.21
5.5.230.0030.00812.61
5.5.220.0040.00712.60
5.5.210.0040.00812.64
5.5.200.0040.00812.71
5.5.190.0000.01112.41
5.5.180.0030.01012.55
5.5.170.0020.01112.74
5.5.160.0050.00712.66
5.5.150.0090.00312.60
5.5.140.0070.00412.62
5.5.130.0110.00412.67
5.5.120.0030.01012.59
5.5.110.0060.00512.63
5.5.100.0020.01412.34
5.5.90.0030.00512.57
5.5.80.0080.00612.65
5.5.70.0060.00812.70
5.5.60.0060.00612.63
5.5.50.0100.00512.69
5.5.40.0070.00712.50
5.5.30.0030.00912.50
5.5.20.0050.00812.64
5.5.10.0060.00612.38
5.5.00.0060.00812.52
5.4.450.0060.02213.82
5.4.440.0080.02713.74
5.4.430.0090.02313.88
5.4.420.0090.02113.91
5.4.410.0070.02313.80
5.4.400.0080.02113.73
5.4.390.0060.02213.60
5.4.380.0060.02413.66
5.4.370.0080.02213.69
5.4.360.0080.02113.64
5.4.350.0070.02213.61
5.4.340.0070.02213.76
5.4.330.0030.00410.90
5.4.320.0060.02413.72
5.4.310.0090.01813.63
5.4.300.0040.02313.76
5.4.290.0100.01913.41
5.4.280.0070.02313.70
5.4.270.0100.01513.62
5.4.260.0080.02713.65
5.4.250.0120.02113.86
5.4.240.0060.02313.52
5.4.230.0030.02813.69
5.4.220.0070.02213.73
5.4.210.0080.01713.56
5.4.200.0040.02312.87
5.4.190.0060.02113.55
5.4.180.0070.02413.67
5.4.170.0060.02213.67
5.4.160.0050.02413.67
5.4.150.0070.02313.67
5.4.140.0050.02012.77
5.4.130.0040.02412.79
5.4.120.0200.01812.83
5.4.110.0200.02112.63
5.4.100.0180.02312.86
5.4.90.0090.02212.92
5.4.80.0060.02012.77
5.4.70.0080.02012.90
5.4.60.0050.02312.77
5.4.50.0100.01812.70
5.4.40.0090.02012.68
5.4.30.0090.02112.81
5.4.20.0050.02312.73
5.4.10.0110.01612.63
5.4.00.0090.02012.61
5.3.290.0120.02812.74
5.3.280.0120.02812.61
5.3.270.0120.02912.62
5.3.260.0080.03012.64
5.3.250.0130.02712.68
5.3.240.0100.03012.63
5.3.230.0140.02212.64
5.3.220.0080.03312.57
5.3.210.0120.02812.56
5.3.200.0070.03012.52
5.3.190.0120.02512.54
5.3.180.0070.03412.62
5.3.170.0110.03112.64
5.3.160.0070.03912.59
5.3.150.0110.02812.64
5.3.140.0090.03212.50
5.3.130.0100.03312.61
5.3.120.0130.02812.60
5.3.110.0110.02812.52
5.3.100.0220.02312.29
5.3.90.0220.03112.30
5.3.80.0180.03112.19
5.3.70.0110.02512.20
5.3.60.0200.03012.23
5.3.50.0030.03212.24
5.3.40.0100.02412.18
5.3.30.0080.02612.31
5.3.20.0070.02512.05
5.3.10.0100.02312.08
5.3.00.0100.02712.03
5.2.170.0200.02610.86
5.2.160.0080.01810.83
5.2.150.0050.02810.83
5.2.140.0020.02810.86
5.2.130.0060.02110.73
5.2.120.0080.02010.73
5.2.110.0100.02810.82
5.2.100.0070.01910.76
5.2.90.0130.02210.82
5.2.80.0110.02210.84
5.2.70.0030.02710.82
5.2.60.0120.02510.72
5.2.50.0070.02410.78
5.2.40.0000.02810.69
5.2.30.0130.02510.80
5.2.20.0180.02510.69
5.2.10.0230.02010.64
5.2.00.0230.02010.56
5.1.60.0240.01510.33
5.1.50.0180.02310.26
5.1.40.0190.02110.21
5.1.30.0280.01810.46
5.1.20.0050.02510.44
5.1.10.0070.02010.23
5.1.00.0060.02610.25
5.0.50.0040.0159.54
5.0.40.0030.0229.44
5.0.30.0090.0229.27
5.0.20.0100.0169.33
5.0.10.0120.0149.44
5.0.00.0100.0269.27
4.4.90.0130.0088.11
4.4.80.0120.0128.15
4.4.70.0080.0148.13
4.4.60.0100.0138.12
4.4.50.0100.0138.15
4.4.40.0110.0188.10
4.4.30.0100.0138.10
4.4.20.0130.0128.16
4.4.10.0100.0138.17
4.4.00.0100.0218.11
4.3.110.0080.0158.07
4.3.100.0120.0158.08
4.3.90.0150.0108.06
4.3.80.0170.0158.11
4.3.70.0120.0118.10
4.3.60.0130.0138.09
4.3.50.0130.0128.10
4.3.40.0120.0178.09
4.3.30.0030.0157.46
4.3.20.0030.0147.48
4.3.10.0080.0097.41
4.3.00.0030.0128.71

preferences:
60.12 ms | 401 KiB | 5 Q