3v4l.org

run code in 300+ PHP versions simultaneously
// урл https://hotline.ua/ua/auto-motocykly/aima-power-eagle/ <form name="parse" method="post"> <input type="url" name = "urlforparse" id="urlforparse" style="width: 350px; height: 65px; font-size: larger;"> <input type="cat" name = "categoo" id = "categoo"> <button class="button button--anthe" type="submit"><span>Парсить</span></button> </form> </html> <?php include('simple_html_dom.php'); $post = $_POST["urlforparse"]; $categoo = $_POST["categoo"]; $html = new simple_html_dom(); $html = file_get_html($post); // читаем страницу $name = $html->find('html body h1[class=title__main]', 0); // название товара //$arr = array('<h1 class="title__main" data-v-6623cabe>','</h1>'); $name = strip_tags($name); echo $name; $cod_sku = $html->find('html body span[data-qaid=product-sku]', 0); // код продукта $cod_sku = strip_tags($cod_sku); echo $cod_sku; $pric = $html->find('html body div span span[class=price__value]', 0); // цена товара $pri = preg_replace( // убираем все что НЕ цифры, // так как &nbsp; декодируется // НЕ в пробел, а другую сущность '/\D+/', '', html_entity_decode($pric) ); echo $pri. "<br>"; // выводим цену $pric = str_replace('&nbsp;', '', $pric); echo $pric. "<br>"; // выводим цену

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.5.30.0090.00819.61
8.5.20.0100.00718.21
8.5.10.0120.00519.76
8.5.00.0120.01020.16
8.4.180.0140.00723.88
8.4.170.0160.00721.98
8.4.160.0110.01123.71
8.4.150.0080.00516.86
8.4.140.0150.00617.98
8.4.130.0130.00718.81
8.4.120.0040.00422.40
8.4.110.0120.00820.79
8.4.100.0140.00818.12
8.4.90.0150.00520.42
8.4.80.0060.00318.89
8.4.70.0120.00919.05
8.4.60.0130.00920.37
8.4.50.0120.00920.48
8.4.40.0100.01017.93
8.4.30.0100.01020.43
8.4.20.0170.00317.95
8.4.10.0070.00422.19
8.3.300.0130.00820.41
8.3.290.0120.00818.41
8.3.280.0130.01118.54
8.3.270.0130.00816.59
8.3.260.0110.00916.56
8.3.250.0070.00816.56
8.3.240.0130.00716.75
8.3.230.0120.00716.82
8.3.220.0110.00918.98
8.3.210.0120.00618.44
8.3.200.0050.00416.75
8.3.190.0120.00717.20
8.3.180.0110.00818.94
8.3.170.0060.00617.30
8.3.160.0190.00017.25
8.3.150.0120.00617.08
8.3.140.0090.00616.77
8.3.130.0000.00818.48
8.3.120.0110.00019.23
8.3.110.0000.00820.94
8.3.100.0150.00324.06
8.3.90.0110.00426.77
8.3.80.0030.00617.97
8.3.70.0140.00718.43
8.3.60.0120.00318.46
8.3.50.0060.01516.63
8.3.40.0130.00720.19
8.3.30.0130.00320.59
8.3.20.0070.00024.18
8.3.10.0050.00324.66
8.3.00.0040.00426.16
8.2.300.0150.00518.27
8.2.290.0130.00717.16
8.2.280.0130.00720.50
8.2.270.0040.01516.87
8.2.260.0000.00817.32
8.2.250.0070.00717.03
8.2.240.0080.00019.19
8.2.230.0070.00322.58
8.2.220.0090.00637.54
8.2.210.0160.00326.77
8.2.200.0030.00617.13
8.2.190.0080.00818.79
8.2.180.0090.00617.13
8.2.170.0130.00319.08
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0050.00321.97
8.2.110.0070.00321.11
8.2.100.0090.00318.03
8.2.90.0030.00619.95
8.2.80.0090.00020.53
8.2.70.0100.01079.33
8.2.60.0190.00079.33
8.2.50.0110.00879.33
8.2.40.0130.00479.33
8.2.30.0120.00479.33
8.2.20.0140.00379.33
8.2.10.0130.00479.33
8.2.00.0070.01079.33
8.1.340.0110.00817.98
8.1.330.0090.01016.36
8.1.320.0060.01318.13
8.1.310.0030.01616.67
8.1.300.0040.00417.05
8.1.290.0100.00030.84
8.1.280.0160.00025.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0020.00528.09
8.1.240.0000.00922.06
8.1.230.0070.00422.67
8.1.220.0000.00817.78
8.1.210.0030.00618.87
8.1.200.0170.00079.33
8.1.190.0110.00579.33
8.1.180.0160.00379.33
8.1.170.0120.00679.33
8.1.160.0140.00479.33
8.1.150.0130.00479.33
8.1.140.0080.01279.33
8.1.130.0140.00579.33
8.1.120.0080.00879.33
8.1.110.0140.00479.33
8.1.100.0080.00879.33
8.1.90.0070.00979.33
8.1.80.0120.00579.33
8.1.70.0160.00079.33
8.1.60.0120.00679.33
8.1.50.0120.00579.33
8.1.40.0080.00879.33
8.1.30.0170.00079.33
8.1.20.0170.00079.33
8.1.10.0120.00979.33
8.1.00.0130.00579.33
8.0.300.0040.00420.27
8.0.290.0080.00879.33
8.0.280.0070.00779.33
8.0.270.0130.00479.33
8.0.260.0150.00079.33
8.0.250.0080.00879.33
8.0.240.0120.00479.33
8.0.230.0150.00079.33
8.0.220.0150.00079.33
8.0.210.0070.01079.33
8.0.200.0120.00579.33
8.0.190.0110.00679.33
8.0.180.0100.00779.33
8.0.170.0140.00479.33
8.0.160.0110.00779.33
8.0.150.0110.00679.33
8.0.140.0150.00479.33
8.0.130.0180.00079.33
8.0.120.0160.00079.33
8.0.110.0120.00379.33
8.0.100.0080.00879.33
8.0.90.0130.00279.33
8.0.80.0080.00879.33
8.0.70.0120.00479.33
8.0.60.0130.00379.33
8.0.50.0090.00679.33
8.0.30.0110.00479.33
8.0.20.0110.00479.33
8.0.10.0130.00379.33

preferences:
44.33 ms | 1259 KiB | 5 Q