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
salathe@php3:~# echo '<?php $str="example"; var_dump($str[1]); ?>' | ./php | |
X-Powered-By: PHP/3.0.18 | |
Content-type: text/html | |
string(1) "x" |
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
root@4a7e05606bd1:/# cat foo.php | |
<?php | |
class MySocketServer { function run() {} } | |
(new MySocketServer)->run(); | |
root@4a7e05606bd1:/# php foo.php | |
root@4a7e05606bd1:/# echo $? | |
0 |
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
/** | |
* {@inheritdoc} | |
* | |
* @note Image dimensions returned as array(width, height) | |
*/ | |
public function fetchMetaDataFrom($filePath) | |
{ | |
if (!file_exists($filePath)) | |
throw new MetaDataFileNotFoundException(sprintf("File %s could not be found for metadata retrieval", $filePath)); |
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 ☃() { var_dump(__FUNCTION__); } | |
☃(); |
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
# available in /etc/nginx/nginx.conf | |
user www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 768; | |
} |
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
root@php1box:/tmp/php# ./phpf.cgi | |
Content-type: text/html | |
<html><head><title>PHPF Usage</title></head><body> | |
<center><h1>PHPF Usage</h1></center> | |
Call <i>phpf.cgi</i> with a url like <tt>http://host@domain/~user/phpf.cgi?arg</tt> where arg is one of:<br> | |
<pre> <tt>form+dest_url</tt></pre> | |
</body></html> |
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 Seedstream; | |
use React\EventLoop\LoopInterface, | |
React\Socket\ConnectionInterface; | |
class Pusher | |
{ | |
private $loop; |
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 | |
$var = "foo"; | |
list($foo, $bar, $baz) = $var; | |
var_dump($foo, $bar, $baz); | |
list($foo, $bar, $baz) = "foo"; | |
var_dump($foo, $bar); | |
/* |
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 | |
while (TRUE) { | |
$microtime = microtime(true); | |
$date = DateTime::createFromFormat('U.u', $microtime); | |
if (!$date) { | |
var_dump($microtime, (string) $microtime); | |
exit; | |
} | |
} |
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 ╯°□°)╯︵┻━┻ extends Exception { } | |
throw new ╯°□°)╯︵┻━┻; |