Since you are using exit
and return
within the global scope (not inside a function), then the behavior is almost the same.
The difference in this case will appear if your file is called through include()
or require()
. exit
will terminate the program, while return
will take the control back to the calling script (where include
or require
was called).
Related Posts:
- Where to get php_mcrypt.dll for PHP 7.2?
- When do I use the PHP constant “PHP_EOL”?
- Using $this when not in object context in PHP
- How to use PHP’s password_hash to hash and verify passwords
- PHP password_hash(), password_verify()
- PHP &$string – What does this mean?
- PHP – Failed to open stream : No such file or directory
- Simplest way to profile a PHP script
- Popup window in PHP?
- Subtract 1 day with PHP
- Warning: session_start(): Cannot send session cookie – headers already sent by (output started at [duplicate]
- PHP – Indirect modification of overloaded property
- Why is the response on localhost so slow?
- PHP header(Location: …): Force URL change in address bar
- Sqoop Incremental Import
- simple IPython example raises exception on sys.exit()
- How to get a minecarft session ID?
- What does ‘
- Python: What OS am I running on?
- ER-Diagram: Ternary Relationship – How to read properly?
- How can I diff 2 files while ignoring leading white space
- Setting Curl’s Timeout in PHP
- Java: Not a statement
- Double slashes on WordPress Admin URL redirects to wp-login
- WordPress category loop offset possible?
- Adding Custom Fields for Img in Posts
- Guidance with The Loop for CMS
- How do I make wordpress comment fields required?
- Prevent WordPress from loading comments
- Using PHP in a Stylesheet (possibly a “.htaccess” problem?)
- Go to / Scroll to Password Field on WordPress Posts After Submit With Message(s)
- Enhanced WordPress Search
- WordPress Redirect: Default Password Reset URL [duplicate]
- Wrap First Character after in a tag
- How to count custom post types with conditional operators
- How to Insert Shortcodes into Theme?
- Custom Post Type Plugin not loading category template and loading 404 instead
- How to filter posts by post format “standard” from wp-json api?
- Register JS for block on frontend only
- Why is file_get_contents returning page source?
- Second level subcategory
- wordpress site | All-in-one-cufon IE Issue
- WordPress Script stops suddenly
- Woocommerce api: create product with images – bad request
- PHP Fatal error: Uncaught Error: Call to undefined function wp_kses_normalize_entities() in new wordpress installation
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Are nonces in WP REST API optional by default?
- HTML tags not showing in excerpt
- How to insert HTML/JavaScript form into WordPress page? [closed]
- Add .htm extention to a custom taxonomy
- Custom gallery in wp3.5
- Creating a CSV with PHP inside the plugin directory
- Excecuting php function in shortcode
- pagination on data fetched using SQL query
- do_action(), iFrame Gets Displayed Despite Password Protection [closed]
- esc_url( ) won’t use https
- retain querystring values when savincustom options in admin
- Use post ID in functions.php file adminside
- How to show childs of certain custom post type in option list?
- How to edit HTML of my website on WordPress? [closed]
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- wpdb Cannot Update column in Database
- Change default gallery images – Currently they are displaying full size imagese
- Send email with list of active plugins upon activation/deactivation
- How to pick “full/thumbnail” images in the loop?
- A better code for no post format?
- How to remove the two duplicate values
- AJAX function running TWICE with WordPress admin-ajax.php
- OOP PHP class extends TwentyTwenty_Customize in Child Theme
- Woocommerce – Exclude variation attribute on specific variation
- Sort new column in Users wp-admin
- How to create admin setting for this small plugin
- Can’t pass var from php wp_ajax into ajax script : result undefined or null
- Custom PHP form needs refresh to load page correctly
- Child-Theme Category View with modified permalinks (%category% removed)
- Log out without confirmation request (nonce)
- Show data obtained from a function and place it in a shortocode function
- Delete empty title_tags, find a h1 heading and echo it
- Get posts from year from URL
- HELP: cannot log into wordpress. PHP error
- WordPress is setting from header wrongly in wp_mail
- Add post title as a link parameter
- How do I get object if class is instantiated only like this new classname()
- How to create a php page to collect information from a html page
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- Passing different content to template parts
- Hide cart when empty [closed]
- Overwriting a Shortcode
- Post Title Not showing up
- MySQL database migration to WordPress
- Is this WordPress code causing page weirdness? Can’t scroll to bottom
- Search result page – display values from the result’s metaboxes
- WordPress add parameters with friendly url structure
- Different behaviour between “include_once” and directly echoing out html code?
- What is a good SSH server to use on Windows? [closed]
- In systemd, what’s the difference between After= and Requires=?
- Windows Server restart / shutdown history
- How do I set the global PATH environment variable on OS X?
- nmap find all alive hostnames and IPs in LAN
- Tags being Inserted in html from plugin PHP not passing through the_content