3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $counter = 0; $counter2 = 20; $content = file_get_contents("http://example.com"); // sleep(2); while($counter < $counter2) { $counter++; $first_step = explode( '<h2 class="rgs">' , $content ); $second_step = explode("</h2>" , $first_step[$counter] ); // echo $second_step[0]; $link[$counter] = htmlspecialchars($second_step[0]); // echo "$link"; // echo "<br>"; }
based on vJZsR
Output for 5.3.18 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19, 7.0.4, 7.0.20, 7.1.5 - 7.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/VUbQG on line 5 Warning: file_get_contents(http://example.com): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/VUbQG on line 5 Notice: Undefined offset: 1 in /in/VUbQG on line 12 Notice: Undefined offset: 2 in /in/VUbQG on line 12 Notice: Undefined offset: 3 in /in/VUbQG on line 12 Notice: Undefined offset: 4 in /in/VUbQG on line 12 Notice: Undefined offset: 5 in /in/VUbQG on line 12 Notice: Undefined offset: 6 in /in/VUbQG on line 12 Notice: Undefined offset: 7 in /in/VUbQG on line 12 Notice: Undefined offset: 8 in /in/VUbQG on line 12 Notice: Undefined offset: 9 in /in/VUbQG on line 12 Notice: Undefined offset: 10 in /in/VUbQG on line 12 Notice: Undefined offset: 11 in /in/VUbQG on line 12 Notice: Undefined offset: 12 in /in/VUbQG on line 12 Notice: Undefined offset: 13 in /in/VUbQG on line 12 Notice: Undefined offset: 14 in /in/VUbQG on line 12 Notice: Undefined offset: 15 in /in/VUbQG on line 12 Notice: Undefined offset: 16 in /in/VUbQG on line 12 Notice: Undefined offset: 17 in /in/VUbQG on line 12 Notice: Undefined offset: 18 in /in/VUbQG on line 12 Notice: Undefined offset: 19 in /in/VUbQG on line 12 Notice: Undefined offset: 20 in /in/VUbQG on line 12
Output for 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.0.6, 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/VUbQG on line 5 Warning: file_get_contents(http://example.com): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/VUbQG on line 5 Notice: Undefined offset: 1 in /in/VUbQG on line 12 Notice: Undefined offset: 2 in /in/VUbQG on line 12 Notice: Undefined offset: 3 in /in/VUbQG on line 12 Notice: Undefined offset: 4 in /in/VUbQG on line 12 Notice: Undefined offset: 5 in /in/VUbQG on line 12 Notice: Undefined offset: 6 in /in/VUbQG on line 12 Notice: Undefined offset: 7 in /in/VUbQG on line 12 Notice: Undefined offset: 8 in /in/VUbQG on line 12 Notice: Undefined offset: 9 in /in/VUbQG on line 12 Notice: Undefined offset: 10 in /in/VUbQG on line 12 Notice: Undefined offset: 11 in /in/VUbQG on line 12 Notice: Undefined offset: 12 in /in/VUbQG on line 12 Notice: Undefined offset: 13 in /in/VUbQG on line 12 Notice: Undefined offset: 14 in /in/VUbQG on line 12 Notice: Undefined offset: 15 in /in/VUbQG on line 12 Notice: Undefined offset: 16 in /in/VUbQG on line 12 Notice: Undefined offset: 17 in /in/VUbQG on line 12 Notice: Undefined offset: 18 in /in/VUbQG on line 12 Notice: Undefined offset: 19 in /in/VUbQG on line 12 Notice: Undefined offset: 20 in /in/VUbQG on line 12