Skip to content

Instantly share code, notes, and snippets.

@giorgiosironi
Created December 17, 2013 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giorgiosironi/8012114 to your computer and use it in GitHub Desktop.
Save giorgiosironi/8012114 to your computer and use it in GitHub Desktop.
Constructor parameters
<?php
class Car
{
public function __toString()
{
return 'I am a car';
}
}
$ferrari = new Car(new Model("Ferrari"));
echo $ferrari, PHP_EOL;
// I am a car
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment