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 funcaoExemplo($parametro1, $parametro2) { | |
return "Faça alguma coisa com o $parametro1 e com o $parametro2"; | |
} | |
echo funcaoExemplo('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 | |
$funcaoExemplo = function($parametro1, $parametro2) { | |
return "Faça alguma coisa com o $parametro1 e com o $parametro2"; | |
}; | |
echo $funcaoExemplo('Hello','Função Anônima'); | |
?> |
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 | |
$nome = 'Adler'; | |
$sobrenome = 'Brediks'; | |
$mostraMeuNome = function() use ($nome, $sobrenome) { | |
$sobrenome .= ' Medrado'; | |
echo "Seu nome é: $nome $sobrenome"; | |
}; | |
$mostraMeuNome(); | |
?> |
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 | |
$nome = 'Adler'; | |
$sobrenome = 'Brediks'; | |
$mostraMeuNome = function() use ($nome, &$sobrenome) { | |
$sobrenome .= ' Medrado'; | |
echo "Seu nome é: $nome $sobrenome"; | |
}; | |
echo '<br>'; | |
$mostraMeuNome(); | |
echo '<br>'; |
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 | |
$arrExemploMap = array(1,2,3,4,5,6,7,8,9,10); | |
$ret = array_map(function($v) { | |
return $v * $v; | |
}, $arrExemploMap); | |
var_dump($ret); | |
?> |
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 Lambida { | |
public function hello($param1, $callback) { | |
echo 'Esse é o valor do $param1: ' . $param1 . '<br />'; | |
echo $callback(); | |
} | |
} | |
$lambida = new Lambida(); | |
$lambida->hello('Eu amo muito tudo isso', 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
// from Horofox in #node.js | |
var mongoose = require('mongoose'); | |
var db = mongoose.connect('mongodb://localhost/mydb'); | |
function allowPosts(mongoose) { | |
var Schema = mongoose.Schema; | |
var Posts = new Schema({ | |
name : String, | |
subject: String, | |
comment : String, |
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
./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/private/etc --with-apxs2=/usr/sbin/apxs --enable-cli --with-config-file-path=/etc --with-libxml-dir=/usr --with-openssl=/usr | |
--with-kerberos=/usr --with-zlib=/usr --enable-gd-native-ttf --with-icu-dir=/usr --with-iodbc=/usr | |
--with-ldap=/usr --with-ldap-sasl=/usr --with-libedit=/usr --enable-mbstring --enable-mbregex --enable-bcmath | |
--with-bz2=/usr --enable-calendar --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem | |
--enable-sysvshm --with-tidy --enable-wddx --with-xmlrpc --with-iconv-dir=/usr --with-xsl=/usr | |
--with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/mysql/mysql.sock | |
--with-readline=/usr --enable-shmop --with-snmp=/usr --with-curl=/usr --enable-dba --enable-exif --enable-ftp | |
--with-gd --with-freetype-dir=/usr/X11/ --with-jpeg-dir=/usr/X11/ --with-png-dir=/usr/X11/ --enable-zip | |
--with-pcre-regex=/usr --with-pgsql=/usr --with-pdo-pgsql=/usr |
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
#clonando o projeto para /usr/local/src | |
cd /usr/local/src | |
git clone https://github.com/derickr/xdebug | |
#acessa o diretório com os fontes | |
cd xdebug | |
#roda o phpize | |
phpize |
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 | |
phpinfo(); | |
?> |
OlderNewer