This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class BoundingBox | |
*/ | |
class BoundingBox { | |
/** | |
* @var float $lat | |
* @var float $lon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace wctrn\realloc; | |
abstract class Option { | |
abstract function get( int $id ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace wctrn\realloc; | |
interface Thing { | |
public function the_content( string $content ) : void; | |
} | |
class Tag implements Thing { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
// Something throws an Exception or Error. | |
} catch ( Throwable $t ) { | |
// will match only in PHP 7 | |
} catch ( Exception $e ) { | |
// will be reached in PHP 5 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace wctrn\realloc; | |
require_once 'late-static-bindings-post.php'; | |
class Page extends Post { | |
public function get_content() { | |
return 'Hello Turin!'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace wctrn\realloc; | |
class Post { | |
public static function init() { | |
return new static(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace wctrn\realloc; | |
class Post { | |
protected $content; | |
public function get_content() : string { | |
return $this->content; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace wctrn\realloc; | |
class Post { | |
protected $content; | |
public function set_content( string $content ) { | |
$this->content = $content; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace wctrn\realloc; | |
class Post { | |
public function get_content() { | |
return 'Hello World!'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'namespace-class.php'; | |
// Namespace: Using | |
echo ( new \wctrn\realloc\Post() )->get_content(), PHP_EOL; | |
// Namespaces: Importing | |
use \wctrn\realloc\Post; | |
echo ( new Post() )->get_content(), PHP_EOL; |
NewerOlder