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
#!/bin/bash | |
# phpbrew-php will determine the PHP version of the project from the NetBeans project or composer.json. | |
command_exists () { | |
type "$1" &> /dev/null ; | |
} | |
vergte() { | |
[ "$1" = "`echo -e "$1\n$2" | sort -V | tail -n1`" ] |
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
0xfEBDC084cA75b7d053D22b93644d9D9A012f7859 |
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 FooController extends Controller | |
{ | |
/** | |
* @var FooGateway | |
*/ | |
protected $foos; | |
/** |
Example inputs:
Variable | Value |
---|---|
key | the shared secret key here |
message | the message to hash here |
Reference outputs for example inputs above:
| Type | Hash |
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
#!/usr/bin/env php | |
<?php | |
/** | |
* Magic 8 Ball IRC bot | |
* Created by Lance Brignoni | |
* Converted to PHP by Arnold Daniels | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 3 of the License, or | |
* (at your option) any later version. |
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 | |
$file = $argv[1]; | |
$tagToStruct = function($value, $tag) { | |
$key = substr($tag, 1); | |
return ["<$key>" => $value]; | |
}; | |
$callbacks = [ |
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 | |
$one = [ | |
'arithmetic' => ['+$a', '-$a'], | |
'bitwise' => ['~$a'], | |
'incdec' => ['++$a', '--$a'], | |
'logical' => ['!$a'], | |
]; | |
$two = [ |
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_dump("1" == 1); | |
var_dump("1" != 1); |
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 | |
/** | |
* Render and send e-mail | |
*/ | |
class Email extends PHPMailer | |
{ | |
/** | |
* @var Twig_Environment | |
*/ |