3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Captcha{ public static function Captcha($sol){ $random = rand(1, 15); if (empty($sol)) { return 'What is ' . $random . ' + ' . $random . ' '; } $answer = $random + $random; if ($sol != $answer) { return false; } else { return true; } } } for ($i=0; $i < 100; $i++) { echo Captcha::Captcha($i); }
Output for 7.1.0 - 7.1.16, 7.2.0 - 7.2.4
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Captcha has a deprecated constructor in /in/H4Q1n on line 2 Fatal error: Constructor Captcha::Captcha() cannot be static in /in/H4Q1n on line 2
Process exited with code 255.

preferences:
64.15 ms | 406 KiB | 5 Q