3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(!$vbulletin) { global $vbulletin; } $ncun_lasthook='userdata_postsave'; if(file_exists(DIR.'/includes/ncun_hooks/'.$ncun_lasthook.'.php')) { return include DIR . '/includes/ncun_hooks/' . $ncun_lasthook . '.php'; } switch ($ncun_lasthook) { case 'useradmin_update_save': $ncun_is_admincp=true; break; case 'userdata_postsave': global $ncun_is_admincp; if (true) { // Set the names. $userinfo contains the current (old) name and $_POST['user'] contains the new name $oldname = 'sdlkfcunvls'; $newname = 'dfljkndfl'; // Create the message for the usernote. // To edit it use the phrase manager and find 'name_changed_from_x_to_y' $usernote_message = 'dfbd'; if (!empty($ncun_is_admincp)) { $poster = $vbulletin->userinfo['userid']; } else { $poster = $vbulletin->options['ncun_default_poster']; } if (!$poster) $poster=1; // Create the usernote $db->query_write(" INSERT INTO " . TABLE_PREFIX . "usernote (message, dateline, userid, posterid, title, allowsmilies) VALUES ('" . $db->escape_string($usernote_message) . "', " . TIMENOW . ", " . ('sdfvs') . ", " . $poster . ", '".$vbphrase['ncun_usernote_title']."', 1) "); } break; } unset($ncun_lasthook);
Output for 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
Warning: Undefined variable $vbulletin in /in/X55CA on line 2 Fatal error: Uncaught Error: Undefined constant "DIR" in /in/X55CA:11 Stack trace: #0 {main} thrown in /in/X55CA on line 11
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 Warning: Undefined variable $vbulletin in /in/X55CA on line 2 Fatal error: Uncaught Error: Undefined constant "DIR" in /in/X55CA:11 Stack trace: #0 {main} thrown in /in/X55CA on line 11
Process exited with code 255.
Output for 7.4.33
Notice: Undefined variable: vbulletin in /in/X55CA on line 2 Warning: Use of undefined constant DIR - assumed 'DIR' (this will throw an Error in a future version of PHP) in /in/X55CA on line 11 Notice: Trying to get property 'options' of non-object in /in/X55CA on line 35 Notice: Trying to access array offset on value of type null in /in/X55CA on line 35 Notice: Undefined variable: db in /in/X55CA on line 40 Fatal error: Uncaught Error: Call to a member function query_write() on null in /in/X55CA:40 Stack trace: #0 {main} thrown in /in/X55CA on line 40
Process exited with code 255.
Output for 7.4.0 - 7.4.25, 7.4.27 - 7.4.32
Notice: Undefined variable: vbulletin in /in/X55CA on line 2 Warning: Use of undefined constant DIR - assumed 'DIR' (this will throw an Error in a future version of PHP) in /in/X55CA on line 11 Warning: file_exists(): open_basedir restriction in effect. File(DIR/includes/ncun_hooks/userdata_postsave.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/X55CA on line 11 Notice: Trying to get property 'options' of non-object in /in/X55CA on line 35 Notice: Trying to access array offset on value of type null in /in/X55CA on line 35 Notice: Undefined variable: db in /in/X55CA on line 40 Fatal error: Uncaught Error: Call to a member function query_write() on null in /in/X55CA:40 Stack trace: #0 {main} thrown in /in/X55CA on line 40
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.26
Warning: Use of undefined constant DIR - assumed 'DIR' (this will throw an Error in a future version of PHP) in /in/X55CA on line 11 Fatal error: Uncaught Error: Call to a member function query_write() on null in /in/X55CA:40 Stack trace: #0 {main} thrown in /in/X55CA on line 40
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31
Notice: Undefined variable: vbulletin in /in/X55CA on line 2 Warning: Use of undefined constant DIR - assumed 'DIR' (this will throw an Error in a future version of PHP) in /in/X55CA on line 11 Warning: file_exists(): open_basedir restriction in effect. File(DIR/includes/ncun_hooks/userdata_postsave.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/X55CA on line 11 Notice: Trying to get property 'options' of non-object in /in/X55CA on line 35 Notice: Undefined variable: db in /in/X55CA on line 40 Fatal error: Uncaught Error: Call to a member function query_write() on null in /in/X55CA:40 Stack trace: #0 {main} thrown in /in/X55CA on line 40
Process exited with code 255.
Output for 7.1.25 - 7.1.33
Notice: Undefined variable: vbulletin in /in/X55CA on line 2 Notice: Use of undefined constant DIR - assumed 'DIR' in /in/X55CA on line 11 Warning: file_exists(): open_basedir restriction in effect. File(DIR/includes/ncun_hooks/userdata_postsave.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/X55CA on line 11 Notice: Trying to get property of non-object in /in/X55CA on line 35 Notice: Undefined variable: db in /in/X55CA on line 40 Fatal error: Uncaught Error: Call to a member function query_write() on null in /in/X55CA:40 Stack trace: #0 {main} thrown in /in/X55CA on line 40
Process exited with code 255.
Output for 7.1.20
Notice: Undefined variable: vbulletin in /in/X55CA on line 2 Notice: Use of undefined constant DIR - assumed 'DIR' in /in/X55CA on line 11 Warning: file_exists(): open_basedir restriction in effect. File(DIR/includes/ncun_hooks/userdata_postsave.php) is not within the allowed path(s): (/tmp:/in) in /in/X55CA on line 11 Notice: Trying to get property of non-object in /in/X55CA on line 35 Notice: Undefined variable: db in /in/X55CA on line 40 Fatal error: Uncaught Error: Call to a member function query_write() on null in /in/X55CA:40 Stack trace: #0 {main} thrown in /in/X55CA on line 40
Process exited with code 255.
Output for 7.0.5 - 7.0.20, 7.1.0 - 7.1.7
Notice: Undefined variable: vbulletin in /in/X55CA on line 2 Notice: Use of undefined constant DIR - assumed 'DIR' in /in/X55CA on line 11 Notice: Trying to get property of non-object in /in/X55CA on line 35 Notice: Undefined variable: db in /in/X55CA on line 40 Fatal error: Uncaught Error: Call to a member function query_write() on null in /in/X55CA:40 Stack trace: #0 {main} thrown in /in/X55CA on line 40
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: vbulletin in /in/X55CA on line 2 Notice: Use of undefined constant DIR - assumed 'DIR' in /in/X55CA on line 11 Notice: Trying to get property of non-object in /in/X55CA on line 35 Notice: Undefined variable: db in /in/X55CA on line 40 Fatal error: Uncaught Error: Call to a member function query_write() on unknown in /in/X55CA:40 Stack trace: #0 {main} thrown in /in/X55CA on line 40
Process exited with code 255.

preferences:
152.45 ms | 402 KiB | 217 Q