online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
<?php function isBot($userAgent) { return (bool)array_filter(['bot', 'google-', 'crawl'], function($needle) use ($userAgent) { return stripos($userAgent, $needle) !== false; }); } // Funkcja testująca różne User Agenty function testUserAgents() { $userAgents = [ 'Mozilla/5.0 (compatible; OnCrawl/2.0; +https://www.oncrawl.com)', 'Mozilla/5.0 (compatible; Google-InspectionTool/1.0;)', // Popularne przeglądarki 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Firefox/115.0', 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1', // Boty 'Googlebot/2.1 (+http://www.google.com/bot.html)', 'Mozilla/5.0 (compatible; Bingbot/2.0; +http://www.bing.com/bingbot.htm)', 'DuckDuckBot/1.1 (+https://duckduckgo.com/duckduckbot)', 'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)', 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)', // Fałszywe boty (test) 'Mozilla/5.0 (compatible; Fakebot/1.0; +http://fakebot.com)', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Bot/537.36', ]; foreach ($userAgents as $agent) { $result = isBot($agent) ? 'BOT' : 'Przeglądarka'; echo "User-Agent: $agent\nWynik: $result\n\n"; } } // Uruchomienie testów testUserAgents(); ?>
googlebot bingbot yahoo duckduckbot baiduspider yandexbot facebookexternalhit facebot mj12bot twitterbot slurp crawl spider bot crawler googlebot-mobile googlebot-image mediapartners-google adsbot-google google-sitemaps feedfetcher-google ahrefsbot seokicks-robot semrushbot majesticbot seznambot

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue