Skip to content

Instantly share code, notes, and snippets.

@vegvari
Created February 26, 2016 18:12
Show Gist options
  • Select an option

  • Save vegvari/0fb6ab27be4f54130f44 to your computer and use it in GitHub Desktop.

Select an option

Save vegvari/0fb6ab27be4f54130f44 to your computer and use it in GitHub Desktop.
PHP facepalm
<?php
trait foo
{
public function bar() {}
}
class bar
{
use foo;
public function __construct() {}
}
<?php
namespace fuck_you_php;
trait foo
{
public function bar() {}
}
class bar
{
use foo;
public function __construct() {}
}
@vegvari
Copy link
Author

vegvari commented Feb 26, 2016

First one: Fatal error: bar has colliding constructor definitions coming from traits

Second one: works fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment