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 | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
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 | |
$author = trim(`whoami`); | |
$pid = pcntl_fork(); | |
if ($pid === 0) { | |
// Child process here | |
$stomp = new Stomp(); | |
$stomp->subscribe('/topic/Chat'); | |
while (true) { | |
$frame = $stomp->readFrame(); |
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
<? | |
data : { | |
a: 10; | |
b: { | |
echo 'Test'; | |
}; | |
logic: function() { | |
echo "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 | |
function hello() { | |
echo 'Hello, magic PHP!'; | |
} | |
function getCallback() { | |
return 'hello'; | |
} | |
$result = ${'_'.!$_=getCallback()}(); |
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 | |
use Go\Aop\Aspect; | |
use Go\Aop\Intercept\MethodInvocation; | |
use Go\Lang\Annotation\Around; | |
/** | |
* Privileged aspect shows the power of privileged advices. | |
* | |
* Privileged advice is running in the scope of target for the current joinpoint |
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 Aspect; | |
use Go\Aop\Aspect; | |
use Go\Aop\Intercept\MethodInvocation; | |
use Go\Lang\Annotation\After; | |
use Go\Lang\Annotation\AfterThrowing; | |
use Go\Lang\Annotation\Before; | |
use Go\Lang\Annotation\Around; |
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 Test { | |
private $a='data'; | |
protected $b=123; | |
public $c=true; | |
} | |
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 | |
use Warlock\Annotation\Autowired; | |
class Example | |
{ | |
/** | |
* @Autowired("logger", required=true) | |
* @var LoggerInterface |
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
class MagicMethodAccessor { | |
public function test() | |
{ | |
echo 'Cool'; | |
} | |
final public function __get($name) | |
{ | |
if (method_exists($this, $name)) { | |
$method = (new ReflectionMethod($this, $name))->getClosure($this); |
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 | |
use Protocol\FCGI; | |
use Protocol\FCGI\FrameParser; | |
use Protocol\FCGI\Record\BeginRequest; | |
use Protocol\FCGI\Record\EndRequest; | |
use Protocol\FCGI\Record\Params; | |
use Protocol\FCGI\Record\Stdin; | |
use Protocol\FCGI\Record\Stdout; |
OlderNewer