// CS50 Library
CS50::init(__DIR__ . "/../config.json");

How does CS50::init(directory) work?

  • Do you have a more specific question? The init function is very straightforward and very well documented. Dec 13, 2016 at 13:03
  • mind explaining?why is :: used? Dec 13, 2016 at 14:23

1 Answer 1


To answer the specific question from your comment "why is :: used?"

From the config section of the spec

(That :: syntax just means that init is "inside of" an "object" called CS50. An object in PHP, meanwhile, is similar in spirit to, but more featureful then, a struct in C.

The CS50 class is defined around line 70 of CS50.php. You'll find more info on php classes and objects in the php doc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .