3v4l.org

run code in 300+ PHP versions simultaneously
<?php $secret = 'секретный ключ'; class test { public function test(int $secret){} } $test = new test(); $test->test( $secret );
Output for 8.2.28 - 8.2.29, 8.3.5 - 8.3.25, 8.4.4 - 8.4.12
Fatal error: Uncaught TypeError: test::test(): Argument #1 ($secret) must be of type int, string given, called in /in/YXOrW on line 7 and defined in /in/YXOrW:4 Stack trace: #0 /in/YXOrW(7): test->test('\xD1\x81\xD0\xB5\xD0\xBA\xD1\x80\xD0\xB5\xD1\x82\xD0\xBD\xD1...') #1 {main} thrown in /in/YXOrW on line 4
Process exited with code 255.
Output for 8.1.32
Fatal error: Uncaught TypeError: test::test(): Argument #1 ($secret) must be of type int, string given, called in /in/YXOrW on line 8 and defined in /in/YXOrW:4 Stack trace: #0 /in/YXOrW(8): test->test('\xD1\x81\xD0\xB5\xD0\xBA\xD1\x80\xD0\xB5\xD1\x82\xD0\xBD\xD1...') #1 {main} thrown in /in/YXOrW on line 4
Process exited with code 255.

preferences:
54.44 ms | 407 KiB | 5 Q