Skip to content

Instantly share code, notes, and snippets.

@krisanalfa
Created February 7, 2014 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisanalfa/8858502 to your computer and use it in GitHub Desktop.
Save krisanalfa/8858502 to your computer and use it in GitHub Desktop.
How return walk in PHP
<?php
$error = false;
function a() {
global $error;
$error = true;
var_dump('a');
}
function b() {
global $error;
$error = false;
var_dump('b');
}
function c() {
global $error;
a();
if ($error) { return; }
b();
}
c();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment