3v4l.org

run code in 300+ PHP versions simultaneously
<?php $FEK_year = 2013; $url = 'http://www.et.gr/idocs-nph/search/fekForm.html'; $year = (int)$FEK_year; $resultsArray = array(array()); $index1 = 0; $index2 = 0; $FEK_year = 2013; $checkBoxIssue = NULL; $FEK_number = 1; $urlpdf = NULL; echo 'hello'; if ($year < 30) { $FEK_year = (string)(2000 + $year); } elseif ($year < 100) { $FEK_year = (string)(1900 + $year); } else { $FEK_year = (string)($year); } $fekyear = (int)$FEK_year; $data = array('year' => $FEK_year, $checkBoxIssue => 'on', 'fekNumberFrom' => $FEK_number, 'fekNumberTo' => $FEK_number, 'fekEffectiveDateFrom' => '01.01'.((string)$fekyear), 'fekEffectiveDateTo' => '31.12',((string)$fekyear), 'fekReleaseDateFrom' => '01.01'.((string)$fekyear), 'fekReleaseDateTo' => '31.12'.((string)($fekyear+1)), 'pageNumber' => '1'); // use key 'http' even if you send the request to https://... $options = array( 'http' => array( 'header' => "Accept-language: en\r\n" . "Content-type: application/x-www-form-urlencoded\r\n" . "User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36\r\n", 'method' => 'POST', 'content' => http_build_query($data) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); if (strpos($result, 'Το ΦΕΚ σε PDF μορφή') !== false) { $urlpdf = 'http://www.et.gr'.substr($results, strpos($results, 'href=') + 6, strpos($results, '\" target=') - (strpos($results, 'href=') + 6)); } return $urlpdf;
Output for 8.5.0 - 8.5.1
hello Deprecated: Using null as an array offset is deprecated, use an empty string instead in /in/RR1b3 on line 24 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for www.et.gr failed: Name or service not known in /in/RR1b3 on line 44 Warning: file_get_contents(http://www.et.gr/idocs-nph/search/fekForm.html): Failed to open stream: php_network_getaddresses: getaddrinfo for www.et.gr failed: Name or service not known in /in/RR1b3 on line 44
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
hello Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for www.et.gr failed: System error in /in/RR1b3 on line 44 Warning: file_get_contents(http://www.et.gr/idocs-nph/search/fekForm.html): Failed to open stream: php_network_getaddresses: getaddrinfo for www.et.gr failed: System error in /in/RR1b3 on line 44
Output for 8.3.28
hello Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for www.et.gr failed: Name or service not known in /in/RR1b3 on line 44 Warning: file_get_contents(http://www.et.gr/idocs-nph/search/fekForm.html): Failed to open stream: php_network_getaddresses: getaddrinfo for www.et.gr failed: Name or service not known in /in/RR1b3 on line 44
Output for 8.0.13 - 8.0.30
hello Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/RR1b3 on line 44 Warning: file_get_contents(http://www.et.gr/idocs-nph/search/fekForm.html): Failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/RR1b3 on line 44
Output for 8.0.0 - 8.0.12
hello Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/RR1b3 on line 44 Warning: file_get_contents(http://www.et.gr/idocs-nph/search/fekForm.html): Failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/RR1b3 on line 44
Output for 7.0.20, 7.1.5 - 7.1.33, 7.2.0 - 7.2.24, 7.3.0 - 7.3.12, 7.3.32 - 7.3.33, 7.4.0, 7.4.26 - 7.4.33
hello Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/RR1b3 on line 44 Warning: file_get_contents(http://www.et.gr/idocs-nph/search/fekForm.html): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/RR1b3 on line 44
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.3 - 7.4.25
hello Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/RR1b3 on line 44 Warning: file_get_contents(http://www.et.gr/idocs-nph/search/fekForm.html): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/RR1b3 on line 44
Output for 5.2.6 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.37, 5.6.0 - 5.6.28, 7.0.0 - 7.0.8, 7.1.0
hello Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/RR1b3 on line 44 Warning: file_get_contents(http://www.et.gr/idocs-nph/search/fekForm.html): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/RR1b3 on line 44
Output for 5.0.3 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.5
hello Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/RR1b3 on line 44 Warning: file_get_contents(http://www.et.gr/idocs-nph/search/fekForm.html): failed to open stream: Connection refused in /in/RR1b3 on line 44
Output for 5.0.1 - 5.0.2
hello Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/RR1b3 on line 44 Warning: file_get_contents(http://www.et.gr/idocs-nph/search/fekForm.html): failed to open stream: Success in /in/RR1b3 on line 44
Output for 5.0.0
hello Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/RR1b3 on line 44 Warning: file_get_contents(http://www.et.gr/idocs-nph/search/fekForm.html): failed to open stream: Bad file descriptor in /in/RR1b3 on line 44
Output for 4.4.5 - 4.4.9
hello Fatal error: Call to undefined function: http_build_query() in /in/RR1b3 on line 40
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
hello Fatal error: Call to undefined function: http_build_query() in /in/RR1b3 on line 40
Process exited with code 255.
Output for 4.3.0 - 4.3.1
hello Fatal error: Call to undefined function: http_build_query() in /in/RR1b3 on line 40

preferences:
66.52 ms | 426 KiB | 5 Q