3v4l.org

run code in 300+ PHP versions simultaneously
<?php $safe_var = 'all your base they belong to us'; file_put_contents('/tmp/exploit.txt',$safe_var ); // imagine lots of stuff going on here... $safe_var = file_get_contents('/tmp/exploit.txt'); function make_literal(string $non_literal):string { $literal = ''; for( $i = 0; $i< strlen($non_literal); $i++ ){ $literal .= chr(ord($non_literal[$i])); } return $literal; } if ( !is_noble($safe_var)) { printf( "Darn! I can't use the data I need to use.\n"); } printf( "But wait...\n"); $safe_var = make_literal($safe_var); if ( is_noble($safe_var)) { printf( "Well, since you did not provide any way to handle *legitimate* exceptions\n"); printf( "then I will just work around you, you annoying little is_literal() function!\n\n"); echo strtoupper($safe_var); echo "!!!"; }
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Call to undefined function is_noble() in /in/oCBp7:17 Stack trace: #0 {main} thrown in /in/oCBp7 on line 17
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught Error: Call to undefined function is_noble() in /in/oCBp7:17 Stack trace: #0 {main} thrown in /in/oCBp7 on line 17
Process exited with code 255.

preferences:
151.75 ms | 401 KiB | 156 Q