Skip to content

Instantly share code, notes, and snippets.

<?php
class A implements Serializable
{
public function serialize()
{
$dt = new \DateTime();
return serialize([
$dt,
serialize([$dt])
]);
#!/usr/bin/php -q
<?php
if(isset($argv[1]) && strlen($argv[1])) {
$file = $argv[1];
}else{
echo 'Please Specify a File';
exit(1);
}
<?php
// namespace and use
class DefaultController extends Controller
{
public function saveAction($listId, $id)
{
$list = $this->getDataManager()->getRepository('BiozshockListsBundle:MyList')->find($listId);
//FIXME: replace with filter.
@biozshock
biozshock / ob_start_test.php
Created November 30, 2011 21:19
Php nested ob_start explanation
<?php
// without OB
echo 'before_ob' . PHP_EOL;
ob_start(); // first level begins
// this line will be in $second
echo 'second_ob' . PHP_EOL;
ob_start(); // second level begins
// these 2 lines will be in $first