3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This is fine. class Foo { public $ordinary; public function bar($a) {} // Untyped param. } class FooChild extends Foo { public mixed $ordinary; function bar(mixed $a) {} // Child declares the param as mixed, which is allowed. }
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.5
Fatal error: Type of FooChild::$ordinary must not be defined (as in class Foo) in /in/seDWM on line 9
Process exited with code 255.
Output for 8.2.18
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.2.18/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.2.18/modules/sodium.so.so (/usr/lib/php/8.2.18/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Type of FooChild::$ordinary must not be defined (as in class Foo) in /in/seDWM on line 9
Process exited with code 255.

preferences:
159.59 ms | 1399 KiB | 60 Q