3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace AdLabs\ParserBundle\Parsers; /** * Класс парсинга данных * @author Syomik Dmitriy <dsemik@gmail.com> */ class Parsers{ /** * put your comment there... * * @var \stdClass */ protected $inputData; /** * Укзаатель на менеджер сущностей * * @var mixed */ protected $entityManager; /** * логгер * * @var mixed */ protected $logger; /** * Контент файла * * @var string */ protected $fileContent; /** * Массив общих шаблонов парсинга * * @var array */ protected $patterns; /** * Объект класса данных * * @var ParsersObjectData */ protected $objectData; /** * Статус отработки основого шаблона * * @var boolean */ protected $patternStatus; /** * put your comment there... * * @param mixed $objectData объект данных * @param mixed $entityManager Entity Manager * @param mixed $logger логер * * @return Parsers */ public function __construct($objectData, $entityManager, $logger) { $this->objectData = $objectData; $this->entityManager = $entityManager; $this->logger = $logger; } /** * Установить входящие данные * * @param \StdClass $inputData входящие данные (запрос, путь к файлу) * */ public function setInputData(\StdClass $inputData) { $this->inputData = $inputData; } /** * Получить объект данных * * @return ParsersObjectData */ public function getObjectData() { return $this->objectData; } /** * Инициализация поисковой системы и шаблонов для парсинга * * @return boolean */ public function init() { $infoParseResult = $this->pathInfoParse(); $patternResult = $this->getPatterns(); $contentResult = $this->getContent(); return $infoParseResult && $patternResult && $contentResult; } /** * Получить все шаблоны для текущей поисковой системы * * @return boolen */ private function getPatterns() { $this->patterns = $this->entityManager ->getRepository("AdLabsParserBundle:PoiskovikPattern") ->getPatterns($this->objectData->getSearchEngine(), $this->objectData->getDataType()); if (!empty($this->patterns)) { return true; } else { $this->logger->write('Patterns not found '.__CLASS__.' '.__METHOD__); } return false; } /** * Инит поисковой системы из имени файла * * @param string $parsePath * * @return boolen */ private function pathInfoParse() { $parsePath = (string) $this->inputData->path; $pathInfo = pathinfo($parsePath); if (!empty($pathInfo['extension'])) { $this->objectData->setDataType($pathInfo['extension']); $this->objectData->setSearchEngine((string) $this->inputData->searchEngine); $this->objectData->setQuery((string) $this->inputData->query); return true; } $this->logger->write('Error init search engine'); return false; } /** * Получить контент файла * * @return boolen */ private function getContent() { $filePath = (string) $this->inputData->path; if (is_file($filePath)) { $this->fileContent = file_get_contents($filePath); if (!empty($this->fileContent)) { return true; } else { $this->logger->write('File '.$filePath.' is empty'); } } else { $this->logger->write('Parse file '.$filePath.' not found'); } return false; } }

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.0040.01118.05
8.3.50.0130.00821.95
8.3.40.0040.01118.54
8.3.30.0070.00719.06
8.3.20.0040.00420.22
8.3.10.0080.00021.95
8.3.00.0000.00822.52
8.2.180.0080.01216.75
8.2.170.0070.00722.96
8.2.160.0100.00719.03
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0120.00626.16
8.2.120.0040.00417.50
8.2.110.0070.00422.25
8.2.100.0100.00317.79
8.2.90.0000.00817.50
8.2.80.0040.00417.97
8.2.70.0080.00017.92
8.2.60.0040.00417.93
8.2.50.0030.00519.41
8.2.40.0040.00420.61
8.2.30.0040.00418.05
8.2.20.0070.00017.64
8.2.10.0000.00717.55
8.2.00.0040.00417.68
8.1.280.0030.01625.92
8.1.270.0050.00322.26
8.1.260.0060.00326.35
8.1.250.0000.00828.09
8.1.240.0030.00623.74
8.1.230.0110.00022.71
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.22
8.1.190.0000.00817.35
8.1.180.0080.00018.10
8.1.170.0040.00418.56
8.1.160.0050.00221.95
8.1.150.0000.00818.59
8.1.140.0030.00517.39
8.1.130.0040.00417.89
8.1.120.0040.00417.48
8.1.110.0070.00317.30
8.1.100.0040.00417.35
8.1.90.0040.00417.40
8.1.80.0000.00717.42
8.1.70.0030.00317.35
8.1.60.0030.00517.51
8.1.50.0000.00817.34
8.1.40.0040.00417.46
8.1.30.0030.00617.56
8.1.20.0000.00817.59
8.1.10.0000.00817.32
8.1.00.0000.00817.36
8.0.300.0030.00621.95
8.0.290.0030.00916.63
8.0.280.0000.00718.38
8.0.270.0030.00317.24
8.0.260.0060.00016.80
8.0.250.0030.00416.93
8.0.240.0000.00716.91
8.0.230.0040.00416.86
8.0.220.0070.00016.88
8.0.210.0000.00716.87
8.0.200.0050.00316.74
8.0.190.0060.00316.87
8.0.180.0000.00816.92
8.0.170.0040.00416.75
8.0.160.0000.00716.86
8.0.150.0070.00016.70
8.0.140.0050.00216.80
8.0.130.0030.00313.27
8.0.120.0080.00016.69
8.0.110.0080.00016.71
8.0.100.0050.00216.74
8.0.90.0050.00316.71
8.0.80.0060.00916.78
8.0.70.0000.00716.71
8.0.60.0040.00416.82
8.0.50.0000.00716.95
8.0.30.0100.01016.83
8.0.20.0070.01117.40
8.0.10.0040.00416.79
8.0.00.0120.00916.57
7.4.330.0000.00615.00
7.4.320.0030.00316.44
7.4.300.0000.00616.57
7.4.290.0050.00316.35
7.4.280.0060.00316.44
7.4.270.0070.00016.44
7.4.260.0030.00316.33
7.4.250.0040.00416.55
7.4.240.0000.00816.50
7.4.230.0000.00716.48
7.4.220.0060.01816.57
7.4.210.0070.01116.43
7.4.200.0040.00416.64
7.4.190.0000.00716.58
7.4.160.0030.01316.63
7.4.150.0070.01117.40
7.4.140.0110.00817.86
7.4.130.0090.01116.51
7.4.120.0090.00916.40
7.4.110.0160.00316.36
7.4.100.0110.00616.45
7.4.90.0120.00616.25
7.4.80.0030.01319.39
7.4.70.0120.00616.37
7.4.60.0100.00716.52
7.4.50.0000.00816.36
7.4.40.0060.00922.77
7.4.30.0140.00316.31
7.4.10.0100.00714.76
7.4.00.0090.00615.05
7.3.330.0050.00213.17
7.3.320.0050.00013.19
7.3.310.0000.00716.29
7.3.300.0000.00716.21
7.3.290.0030.01016.20
7.3.280.0130.00616.26
7.3.270.0120.01317.40
7.3.260.0030.01416.37
7.3.250.0130.00716.41
7.3.240.0090.00916.23
7.3.230.0060.01016.39
7.3.210.0080.00816.31
7.3.200.0090.00919.39
7.3.190.0060.01116.58
7.3.180.0060.00916.25
7.3.170.0030.01816.30
7.3.160.0110.01116.50
7.3.130.0110.00514.56
7.3.120.0100.00614.85
7.3.110.0050.01414.72
7.3.100.0040.01114.82
7.3.90.0030.01114.65
7.3.80.0090.00314.63
7.3.70.0060.00914.78
7.3.60.0080.00714.78
7.3.50.0060.00614.45
7.3.40.0030.01314.65
7.3.30.0060.00614.63
7.3.20.0030.00916.38
7.3.10.0080.00616.38
7.3.00.0060.00716.27
7.2.330.0140.00416.64
7.2.320.0140.00616.28
7.2.310.0000.01616.53
7.2.300.0060.01216.59
7.2.290.0070.01116.37
7.2.260.0050.01315.05
7.2.250.0050.01014.81
7.2.240.0070.00614.93
7.2.230.0050.01014.97
7.2.220.0040.00714.74
7.2.210.0100.00514.82
7.2.200.0040.01114.88
7.2.190.0060.00614.91
7.2.180.0040.00614.81
7.2.170.0050.00814.78
7.2.160.0040.00814.91
7.2.150.0110.00416.73
7.2.140.0070.00716.65
7.2.130.0030.01016.70
7.2.120.0060.00916.67
7.2.110.0040.01016.70
7.2.100.0050.00716.65
7.2.90.0050.00916.61
7.2.80.0070.00416.70
7.2.70.0050.00916.67
7.2.60.0050.00816.72
7.2.50.0080.00816.82
7.2.40.0050.00616.65
7.2.30.0030.01016.60
7.2.20.0060.00516.66
7.2.10.0090.00416.74
7.2.00.0050.00816.67
7.1.330.0070.00815.40
7.1.320.0040.00615.61
7.1.310.0080.00615.71
7.1.300.0020.00615.72
7.1.290.0060.00915.53
7.1.280.0110.00415.55
7.1.270.0020.00715.52
7.1.260.0030.01115.63
7.1.250.0030.00915.47
7.1.240.0090.00515.63
7.1.230.0030.00915.44
7.1.220.0030.01015.65
7.1.210.0080.00415.49
7.1.200.0060.00715.48
7.1.190.0050.00715.70
7.1.180.0080.00815.46
7.1.170.0080.00415.61
7.1.160.0020.01015.56
7.1.150.0060.00515.76
7.1.140.0040.00815.52
7.1.130.0050.01015.61
7.1.120.0040.01115.64
7.1.110.0080.00615.58
7.1.100.0030.01115.55
7.1.90.0050.00815.58
7.1.80.0050.00915.60
7.1.70.0060.00716.04
7.1.60.0070.00816.92
7.1.50.0070.00716.03
7.1.40.0050.00815.68
7.1.30.0000.01015.49
7.1.20.0120.00215.55
7.1.10.0060.00515.37
7.1.00.0040.03117.94
7.0.330.0040.01115.18
7.0.320.0020.01015.33
7.0.310.0100.00315.35
7.0.300.0030.00715.07
7.0.290.0050.00715.23
7.0.280.0050.00715.08
7.0.270.0030.00515.25
7.0.260.0050.01015.15
7.0.250.0050.00715.38
7.0.240.0040.00415.14
7.0.230.0060.00815.21
7.0.220.0050.01015.27
7.0.210.0020.01215.17
7.0.200.0110.00415.64
7.0.190.0060.00515.31
7.0.180.0030.00715.25
7.0.170.0090.00415.34
7.0.160.0020.00915.18
7.0.150.0070.00615.09
7.0.140.0060.02617.59
7.0.130.0010.01115.20
7.0.120.0070.00715.22
7.0.110.0040.00715.25
7.0.100.0030.01015.29
7.0.90.0050.00515.25
7.0.80.0060.02116.93
7.0.70.0130.01916.80
7.0.60.0140.02016.77
7.0.50.0120.02117.03
7.0.40.0050.01815.61
7.0.30.0040.01915.47
7.0.20.0060.01615.54
7.0.10.0070.02415.54
7.0.00.0080.03215.54
5.6.400.0060.00514.13
5.6.390.0020.01114.08
5.6.380.0050.00814.34
5.6.370.0060.00714.11
5.6.360.0010.01214.29
5.6.350.0030.01114.36
5.6.340.0000.01314.21
5.6.330.0080.00514.18
5.6.320.0060.00714.19
5.6.310.0050.01114.31
5.6.300.0080.00614.18
5.6.290.0090.00614.24
5.6.280.0030.03016.52
5.6.270.0040.00714.23
5.6.260.0050.01014.24
5.6.250.0030.01114.18
5.6.240.0070.00714.37
5.6.230.0060.01716.32
5.6.220.0030.01916.21
5.6.210.0050.01616.41
5.6.200.0030.02016.38
5.6.190.0070.01616.54
5.6.180.0060.03616.44
5.6.170.0030.02416.38
5.6.160.0060.02716.39
5.6.150.0090.03116.35
5.6.140.0120.03016.39
5.6.130.0030.03616.38
5.6.120.0030.02416.46
5.6.110.0070.03116.36
5.6.100.0020.03616.37
5.6.90.0080.03116.39
5.6.80.0080.02816.10
5.6.70.0050.03416.14
5.6.60.0080.03016.23
5.6.50.0080.01916.20
5.6.40.0050.02716.25
5.6.30.0060.02516.20
5.6.20.0110.02216.20
5.6.10.0070.02916.32
5.6.00.0030.02316.25
5.5.380.0060.01014.01
5.5.370.0040.01716.29
5.5.360.0090.02616.09
5.5.350.0040.01916.07
5.5.340.0050.02216.41
5.5.330.0050.01616.27
5.5.320.0060.01716.41
5.5.310.0070.02116.38
5.5.300.0060.03016.41
5.5.290.0100.03016.24
5.5.280.0070.03216.27
5.5.270.0030.02616.36
5.5.260.0090.03116.29
5.5.250.0070.03016.04
5.5.240.0100.02816.01
5.5.230.0030.02015.99
5.5.220.0060.02916.16
5.5.210.0040.03516.03
5.5.200.0090.02916.09
5.5.190.0100.01916.11
5.5.180.0070.03016.08
5.5.170.0020.01113.95
5.5.160.0050.02116.12
5.5.150.0050.02316.09
5.5.140.0060.02916.07
5.5.130.0040.03215.96
5.5.120.0070.03016.11
5.5.110.0030.03415.92
5.5.100.0050.03215.97
5.5.90.0050.02716.05
5.5.80.0030.03316.13
5.5.70.0080.02915.90
5.5.60.0060.02015.98
5.5.50.0050.02816.07
5.5.40.0080.02115.94
5.5.30.0060.02316.06
5.5.20.0040.02616.04
5.5.10.0050.02815.98
5.5.00.0060.02415.93
5.4.450.0080.01814.29
5.4.440.0050.02914.29
5.4.430.0060.02614.23
5.4.420.0040.02414.24
5.4.410.0010.02914.24
5.4.400.0050.02414.18
5.4.390.0050.01914.24
5.4.380.0040.01914.22
5.4.370.0100.02014.21
5.4.360.0060.01614.21
5.4.350.0070.02914.20
5.4.340.0040.02814.21
5.4.330.0060.00411.75
5.4.320.0020.02714.13
5.4.310.0020.02814.12
5.4.300.0060.03114.13
5.4.290.0030.02214.12
5.4.280.0070.02714.18
5.4.270.0070.02714.21
5.4.260.0070.02314.13
5.4.250.0030.01914.24
5.4.240.0060.01714.22
5.4.230.0120.02114.21
5.4.220.0030.02514.22
5.4.210.0050.02814.13
5.4.200.0080.01914.15
5.4.190.0020.01914.13
5.4.180.0080.02514.22
5.4.170.0010.03014.13
5.4.160.0030.02414.20
5.4.150.0060.02914.23
5.4.140.0060.02513.29
5.4.130.0050.02913.26
5.4.120.0030.01713.29
5.4.110.0030.01813.27
5.4.100.0060.01613.30
5.4.90.0070.01913.28
5.4.80.0020.02613.28
5.4.70.0050.02613.32
5.4.60.0030.02313.33
5.4.50.0090.01613.28
5.4.40.0060.01413.34
5.4.30.0080.01913.27
5.4.20.0050.02713.29
5.4.10.0030.02013.31
5.4.00.0070.01313.08
5.3.290.0060.02712.75
5.3.280.0070.01912.75
5.3.270.0050.02212.69
5.3.260.0080.02812.73
5.3.250.0080.02712.70
5.3.240.0040.02012.71
5.3.230.0030.01712.70
5.3.220.0040.02912.69
5.3.210.0100.02512.73
5.3.200.0040.02612.74
5.3.190.0070.02612.69
5.3.180.0080.02312.67
5.3.170.0020.03012.67
5.3.160.0000.02812.73
5.3.150.0060.01712.68
5.3.140.0060.01812.70
5.3.130.0050.01812.70
5.3.120.0070.02112.67
5.3.110.0050.02812.67
5.3.100.0050.02712.50
5.3.90.0050.03012.56
5.3.80.0040.02712.50
5.3.70.0040.02812.48
5.3.60.0070.02712.52
5.3.50.0060.02812.53
5.3.40.0020.02812.51
5.3.30.0080.01312.45
5.3.20.0030.02612.40
5.3.10.0060.01912.37
5.3.00.0070.02512.35
5.2.170.0030.06013.50
5.2.160.0100.05713.50
5.2.150.0130.03713.50
5.2.140.0070.06313.50
5.2.130.0000.04013.50
5.2.120.0000.06313.50
5.2.110.0030.06713.50
5.2.100.0000.06313.50
5.2.90.0000.05713.50
5.2.80.0030.06313.50
5.2.70.0000.05013.50
5.2.60.0000.06013.50
5.2.50.0070.06013.50
5.2.40.0100.05313.50
5.2.30.0030.05313.50
5.2.20.0130.04013.50
5.2.10.0000.05013.50
5.2.00.0030.06013.50
5.1.60.0070.04313.50
5.1.50.0070.05313.50
5.1.40.0030.04313.50
5.1.30.0100.05013.50
5.1.20.0070.03713.50
5.1.10.0000.05713.50
5.1.00.0030.05713.50
5.0.50.0030.04013.50
5.0.40.0100.03713.50
5.0.30.0070.06013.50
5.0.20.0000.04013.50
5.0.10.0030.04313.50
5.0.00.0000.07013.50
4.4.90.0100.02013.50
4.4.80.0000.02713.50
4.4.70.0000.03713.50
4.4.60.0000.02713.50
4.4.50.0030.02013.50
4.4.40.0000.05713.50
4.4.30.0070.02713.50
4.4.20.0030.02313.50
4.4.10.0030.03013.50
4.4.00.0000.03713.50
4.3.110.0070.03013.50
4.3.100.0100.02713.50
4.3.90.0100.02713.50
4.3.80.0030.05313.50
4.3.70.0030.03713.50
4.3.60.0030.03313.50
4.3.50.0030.02013.50
4.3.40.0030.04013.50
4.3.30.0030.03313.50
4.3.20.0000.04013.50
4.3.10.0000.03713.50
4.3.00.0000.02713.50

preferences:
58.24 ms | 401 KiB | 5 Q