Skip to content

Instantly share code, notes, and snippets.

@mattsches
mattsches / Roman.php
Created January 30, 2013 08:06
PHP Roman Numerals Code Kata solution. A collaborative effort of the people @ PHP User Group Rheinhessen, Jan '13.
<?php
/**
* Converts Roman numbers to integers
*/
class Roman
{
/**
* @var array
*/
@mattsches
mattsches / sf2tt_001.php
Created June 16, 2012 14:02
EventListener mit PRE_SET_DATA-Event in Symfony2
/* ... */
public function buildForm(FormBuilder $builder, array $options)
{
$builder->addEventListener(FormEvents::PRE_SET_DATA,
function (DataEvent $event) use ($builder)
{
$form = $event->getForm();
/* @var \Sperrobjekt\Sf2ttBundle\Entity\Category $data */
$data = $event->getData();
@mattsches
mattsches / test.php
Created February 22, 2012 12:05 — forked from rodneyrehm/test.php
PHPGangsta: Doppelte Array-Einträge entfernen
<?php
if (extension_loaded('xdebug')) {
echo "WARNING: xdebug is enabled\n";
}
function _count()
{
$array = array(1, 5, 8, 'Michael', 5, 4, 9, 'Martin', 18, 12, 'Michael', 4, 12);