GithubHelp home page GithubHelp logo

zce's Introduction

Introduction

ZCE standing for Zend Certificate Engineer is a enterprise standard test that evaluates the competence about PHP in a wide range of aspects of the language. There are 11 groups of knowledge that are challenged when taking the test. The material listed in this repository is compiled for that purpose.

Practise makes perfect

A number of code snippets, most of them are relatively short, can be found in the folder named "practise". You can fork them if you want to have a look via localhost. You can even find the anwser for each question within the file listed. Normally in each file, there is an echo or print line which output something either string or integer. You have to calculate when looking the code snippet to find the output by yourself if you want to do some practice.

Copyright

The content in this repository is under CC BY-NC-ND

Update September 2019

We are going to update the question here instead of the "practise" folder. Currently, we have 137 questions awaiting for you.


1. What's the output?
$a = 'a'; $b = 'b';

echo isset($c) ? $a.$b.$c : ($c = 'c').'d';
  • A: abc
  • B: ab
  • C: cd
  • D: ac
Answer

Answer: C

As $c is not declared then we get else, meaning echo ($c = 'c').'d';, which returns "cd". This is the first question, so hello world :-)


2. What's the output?
class ZCE {
	public $me = 1;
	public function __construct($me) { 
		$this->me = $me; 
	}
	public function getProp() {
		return function($he) {
			return $this->me*$he;
		};
	}
}

$a = new ZCE(2);

$a->getProp = function($x) {
	return $x*$x;
};

$m = $a->getProp();

echo $m(3);
  • A: 5
  • B: 6
  • C: 7
  • D: 8
Answer

Answer: B

We have two functions named getProp(), one declared inside the class and another one declared with the object $a and that override the previous one. Yet, when we call $m = $a->getProp();, we still access to the method declared inside the ZCE class.

Check the result at https://3v4l.org/eAOR4

zce's People

Contributors

yeungon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zce's Issues

Q and A

hi guys,

if you have any question, feel free to put it here!

cheers,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.