3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Tests linguistiques</title> </head> <body> <br> Testeur de nom <br><br> <form action="" method="post"> Proposez un nom : <input type="text" name="nom" /> <input type="submit" value="OK"> </form> <?php echo file_get_contents("https://www.google.fr"); function requete ($requete) { $doc = new DOMDocument(); $doc->loadHTMLFile("https://www.google.fr/search?q=%22" . $requete . "%22"); $nombreResultats = $doc->getElementById('resultStats')->nodeValue; $page = file_get_contents("https://www.google.fr/search?q=%22" . $requete . "%22"); if (stripos($page, "Aucun") == false) { echo "https://www.google.fr/search?q=%22" . $requete . "%22" . " : " . $nombreResultats . "<br>"; } $n = 0; while ($n <= strlen($nombreResultats)) { if ($nombreResultats[$n] == "0" || $nombreResultats[$n] == "1" || $nombreResultats[$n] == "2" || $nombreResultats[$n] == "3" || $nombreResultats[$n] == "4" || $nombreResultats[$n] == "5" || $nombreResultats[$n] == "6" || $nombreResultats[$n] == "7" || $nombreResultats[$n] == "8" || $nombreResultats[$n] == "9") { $nombreResultats2 = $nombreResultats2 . $nombreResultats[$n]; } $n = $n + 1; } if (stripos($page, "Aucun") != false) { $nombreResultats2 = "0"; echo "https://www.google.fr/search?q=%22" . $requete . "%22" . " : " . "Aucun r├ęsultat <br>"; } return intval ($nombreResultats2); } if ($_POST["nom"]) { $nom = $_POST["nom"]; $totalConcret = requete("un%20" . $nom); $testConcret = requete("je%20vois%20un%20" . $nom) + requete("je%20sens%20un%20" . $nom) + requete("je%20touche%20un%20" . $nom) + requete("je%20goute%20un%20" . $nom) + requete("j'entends%20un%20" . $nom); echo $totalConcret . "<br>"; echo $testConcret . "<br>"; if ($testConcret >= $totalConcret/500) { echo "Ceci est un nom concret !"; } else { echo "Ceci est un nom abstrait !"; } } ?> </body> </html>
Output for 5.4.15 - 5.4.45, 5.5.32 - 5.5.33, 5.6.18 - 5.6.19, 7.0.4, 7.0.20, 7.1.5 - 7.2.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Tests linguistiques</title> </head> <body> <br> Testeur de nom <br><br> <form action="" method="post"> Proposez un nom : <input type="text" name="nom" /> <input type="submit" value="OK"> </form> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/6hkYB on line 16 Warning: file_get_contents(https://www.google.fr): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/6hkYB on line 16 Notice: Undefined index: nom in /in/6hkYB on line 44 </body> </html>
Output for 5.5.24 - 5.5.31, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.0.6, 7.1.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Tests linguistiques</title> </head> <body> <br> Testeur de nom <br><br> <form action="" method="post"> Proposez un nom : <input type="text" name="nom" /> <input type="submit" value="OK"> </form> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/6hkYB on line 16 Warning: file_get_contents(https://www.google.fr): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/6hkYB on line 16 Notice: Undefined index: nom in /in/6hkYB on line 44 </body> </html>
Output for 5.3.19 - 5.4.14
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Tests linguistiques</title> </head> <body> <br> Testeur de nom <br><br> <form action="" method="post"> Proposez un nom : <input type="text" name="nom" /> <input type="submit" value="OK"> </form> Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/6hkYB on line 16 Warning: file_get_contents(https://www.google.fr): failed to open stream: No such file or directory in /in/6hkYB on line 16 Notice: Undefined index: nom in /in/6hkYB on line 44 </body> </html>