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
var _=["a","eq","href","attr","#",4]; | |
$(_[0])[_[1]](_[5])[_[3]](_[2],_[_[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
chgrp -R sharer /srv/share; find /srv/share/* -type d -exec chmod g+srw {} \; |
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
replace "<\?=\$(.*)\?>" to "<?php echo \$\1; ?>" | |
and then "<\?(?!php)" to "<?php" |
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 | |
echo foo()[0]; // PHP Parse error: syntax error, unexpected '[', expecting ',' or ';' | |
function foo() { | |
return array("cant thouch this"); | |
} | |
// use this instead: | |
list($tmp)= foo(); | |
echo $tmp; |
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"; $foo=array(); ${true?$var:"bar"}[]=$var; var_dump($foo); | |
/* Output: | |
array(1) { | |
[0]=> | |
string(3) "foo" | |
} | |
*/ |
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 echo 0 || 1337 ? 4 : 0 | -4 ? 5 : 0 ? 7 ^ 5: 0 ; // 2 |
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
(while true; do echo -n $'\a';sleep 1; done;) & |
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
setTimeout(function (obj){(function(){ | |
/*here goes the callback code*/ | |
}).apply(obj)},time,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 | |
$in_array=array("foo"=>"fooval","baz"=>"bazval"); | |
$in_array+=array_fill_keys(array("foo","bar","baz"),false); | |
// array_fill_keys is since PHP 5.2.0 | |
// useage: | |
echo $in_array["foo"]?:"foodef"; | |
// short ternary operator is since PHP 5.3.0 | |
echo "\n"; |
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 | |
// echo (new Foo())->$bar; // fails | |
// PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' | |
echo Foo::getI()->bar; //works | |
class Foo { | |
public function __construct() { | |
$this->bar="hello world\n"; | |
} | |
static function getI() { |