Skip to content

Instantly share code, notes, and snippets.

@msjyoo
Created July 6, 2014 12:04
Show Gist options
  • Save msjyoo/ab8bb3417f0c3031a3b7 to your computer and use it in GitHub Desktop.
Save msjyoo/ab8bb3417f0c3031a3b7 to your computer and use it in GitHub Desktop.
This Gist an example code complying with the PocketMine-MP Contributing Syntax Standard.
<?php
namespace DeveloperName\Example;
class ExampleClass{
const EXAMPLE_CLASS_CONSTANT = 1;
public $examplePublicVariable = "defaultValue";
private $examplePrivateVariable;
public function __construct($firstArgument, &$secondArgument = null){
if($firstArgument === "exampleValue"){ //Remember to use === instead == when possible
//do things
}elseif($firstArgument === "otherValue"){
$secondArgument = function(){
return [
0 => "value1",
1 => "value2",
2 => "value3",
3 => "value4",
4 => "value5",
5 => "value6",
];
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment