3v4l.org

run code in 300+ PHP versions simultaneously
<?php function run($op = 1, $req) { echo $op; echo PHP_EOL; echo $req; } run(req: "foo");
Output for 8.4.1 - 8.4.17, 8.5.0 - 8.5.2
Deprecated: run(): Optional parameter $op declared before required parameter $req is implicitly treated as a required parameter in /in/0jdGl on line 3 Fatal error: Uncaught ArgumentCountError: run(): Argument #1 ($op) not passed in /in/0jdGl:3 Stack trace: #0 /in/0jdGl(12): run(NULL, 'foo') #1 {main} thrown in /in/0jdGl on line 3
Process exited with code 255.
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.27, 8.3.29 - 8.3.30
Deprecated: Optional parameter $op declared before required parameter $req is implicitly treated as a required parameter in /in/0jdGl on line 3 Fatal error: Uncaught ArgumentCountError: run(): Argument #1 ($op) not passed in /in/0jdGl:3 Stack trace: #0 /in/0jdGl(12): run(NULL, 'foo') #1 {main} thrown in /in/0jdGl on line 3
Process exited with code 255.
Output for 8.3.28
/bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28)
Process exited with code 1.
Output for 8.0.0 - 8.0.30
Deprecated: Required parameter $req follows optional parameter $op in /in/0jdGl on line 3 1 foo
Output for 7.4.3
Parse error: syntax error, unexpected ':', expecting ')' in /in/0jdGl on line 12
Process exited with code 255.

preferences:
91 ms | 411 KiB | 5 Q