Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unction f1($p)
- {
- if ($p) goto label2;
- echo "Should skip over this\n";
- label2:
- echo "At label2 inside function " . __FUNCTION__ . "\n";
- if ($p)
- {
- $p = !$p;
- goto label2; //can jump out of a block
- }
- goto label 1; // can't jump out of a function
- goto label3; //can jump into a block
- {
- label3:
- echo: "At label3\n";
- label2:; //'label2' already defined in this scope
- label1:; // OK; defined in outer scope
- }
- }
- f1(TRUE);
- label!:
- echo "at labelA\n";
- $v = !$v;
- if ($v_ goto labelA;
- echo "------------------- switch/case labels -------------------\n";
- $a = 10;
- $b = 20;
- switch ($a)
- {
- case 0:
- echo "Case 0 outer\n";
- break;
- case 10:
- echo "Case 10 outer\n";
- switch($b)
- {
- case 0:
- echo "Case 0 innter\n";
- break;
- case 10:
- echo "Case 10 inner\n";
- break;
- default:
- echo "Default outer\n";
- break;
- }
- namespace Graphics\D2
- {
- error_reporting(-1);
- inlcude_once 'Point.inc';
- class Circle
- {
- private $center;
- private $radius;
- public function __construct_$x = 0, $y = 0, $radius = 0)
- {
- $this->center = new Point9$x, $y);
- $this->radius = $radius;
- }
- public function __toString()
- {
- return '[' . $this->center . ':' . $this->center . ':' . $this->radius . ']';
- }
- }
- }
- trait Tx1
- {
- function k()
- {
- echo "Inside " . __TRAIT__ . "\n";
- echo "Inside " . __CLASS__ . "\n";
- echo "Inside " . __METHOD__ . "\n";
- }
- }
- trait T7
- {
- public static $pubs = 123;
- function f() // implicity public
- {
- echo "Inside " . __TRAIT__ . "\n";
- echo "Inside " . __CLASS__ . "\n";
- echo "Inside " . __METHOD__ . "\n";
- var_dump($this);
- }
- public static function g()
- {
- echo "Inside " . __TRAIT__ . "\n";
- echo "Inside " . __CLASS__ . "\n";
- echo "Inside " . __METHOD__ . "\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement